mirror of
https://linux.maple.camp/git/ahill/maplelinux-bootstrap.git
synced 2026-02-11 10:13:35 +00:00
Updated the build scripts and started working on Docker
This commit is contained in:
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk update
|
||||||
|
RUN apk upgrade
|
||||||
|
RUN apk add clang cmake curl git libc++ linux-headers makedoas python3 rsync samurai umount
|
||||||
|
RUN git clone https://github.com/cbpudding/maplelinux-bootstrap /maple
|
||||||
@@ -18,7 +18,7 @@ mkdir -p $MAPLE/lib
|
|||||||
# TODO: Does it make sense to have this long-term? Anything that depends on
|
# TODO: Does it make sense to have this long-term? Anything that depends on
|
||||||
# libc++ fails to link without it, but this should be fixed via a
|
# libc++ fails to link without it, but this should be fixed via a
|
||||||
# configuration change in LLVM. ~ahill
|
# configuration change in LLVM. ~ahill
|
||||||
ln -s . $MAPLE/lib/$HOST
|
ln -sf . $MAPLE/lib/$HOST
|
||||||
mkdir -p $MAPLE/maple/patches
|
mkdir -p $MAPLE/maple/patches
|
||||||
mkdir -p $MAPLE/maple/sources
|
mkdir -p $MAPLE/maple/sources
|
||||||
mkdir -p $MAPLE/mnt
|
mkdir -p $MAPLE/mnt
|
||||||
@@ -28,18 +28,18 @@ mkdir -p $MAPLE/sbin
|
|||||||
mkdir -p $MAPLE/sys
|
mkdir -p $MAPLE/sys
|
||||||
mkdir -p $MAPLE/tmp
|
mkdir -p $MAPLE/tmp
|
||||||
mkdir -p $MAPLE/usr
|
mkdir -p $MAPLE/usr
|
||||||
ln -s ../bin $MAPLE/usr/bin
|
ln -sf ../bin $MAPLE/usr/bin
|
||||||
mkdir -p $MAPLE/usr/include
|
mkdir -p $MAPLE/usr/include
|
||||||
ln -s ../lib $MAPLE/usr/lib
|
ln -sf ../lib $MAPLE/usr/lib
|
||||||
ln -s ../lib $MAPLE/usr/libexec
|
ln -sf ../lib $MAPLE/usr/libexec
|
||||||
ln -s ../sbin $MAPLE/usr/sbin
|
ln -sf ../sbin $MAPLE/usr/sbin
|
||||||
mkdir -p $MAPLE/usr/share
|
mkdir -p $MAPLE/usr/share
|
||||||
mkdir -p $MAPLE/var
|
mkdir -p $MAPLE/var
|
||||||
mkdir -p $MAPLE/var/cache
|
mkdir -p $MAPLE/var/cache
|
||||||
mkdir -p $MAPLE/var/lib
|
mkdir -p $MAPLE/var/lib
|
||||||
ln -s ../run/lock $MAPLE/var/lock
|
ln -sf ../run/lock $MAPLE/var/lock
|
||||||
mkdir -p $MAPLE/var/log
|
mkdir -p $MAPLE/var/log
|
||||||
ln -s ../run $MAPLE/var/run
|
ln -sf ../run $MAPLE/var/run
|
||||||
mkdir -p $MAPLE/var/spool
|
mkdir -p $MAPLE/var/spool
|
||||||
mkdir -p $MAPLE/var/tmp
|
mkdir -p $MAPLE/var/tmp
|
||||||
|
|
||||||
@@ -49,6 +49,11 @@ cd build
|
|||||||
# LLVM Build
|
# LLVM Build
|
||||||
tar xf ../sources/llvm-project-*.tar*
|
tar xf ../sources/llvm-project-*.tar*
|
||||||
cd llvm-project-*/
|
cd llvm-project-*/
|
||||||
|
# TODO: Python is a required part of LLVM, but we can't include the latest
|
||||||
|
# version due to conflicts with LibreSSL. Maybe we can piggyback off of
|
||||||
|
# Python 3.9 for a while, but that's not a sustainable solution long-term.
|
||||||
|
# ~ahill
|
||||||
|
# See also: https://peps.python.org/pep-0644/
|
||||||
cmake -B stage1 -G Ninja -S llvm \
|
cmake -B stage1 -G Ninja -S llvm \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX=$MAPLE/maple/tools \
|
-DCMAKE_INSTALL_PREFIX=$MAPLE/maple/tools \
|
||||||
@@ -88,6 +93,7 @@ export PATH="$MAPLE/maple/tools/bin:$PATH"
|
|||||||
tar xf ../sources/linux-*.tar*
|
tar xf ../sources/linux-*.tar*
|
||||||
cd linux-*/
|
cd linux-*/
|
||||||
LLVM=1 make -j $THREADS mrproper
|
LLVM=1 make -j $THREADS mrproper
|
||||||
|
# TODO: Why do we need rsync to install the Linux headers? ~ahill
|
||||||
LLVM=1 make -j $THREADS headers_install INSTALL_HDR_PATH=$MAPLE/usr
|
LLVM=1 make -j $THREADS headers_install INSTALL_HDR_PATH=$MAPLE/usr
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
@@ -103,13 +109,13 @@ make -j $THREADS install DESTDIR=$MAPLE
|
|||||||
# we need, but it is needed for compatibility. As of April 5th, 2025, zsh
|
# we need, but it is needed for compatibility. As of April 5th, 2025, zsh
|
||||||
# is known to be misconfigured as a result of missing libraries. ~ahill
|
# is known to be misconfigured as a result of missing libraries. ~ahill
|
||||||
for lib in $(grep "EMPTY_LIB_NAMES =" Makefile | sed "s/EMPTY_LIB_NAMES = //"); do
|
for lib in $(grep "EMPTY_LIB_NAMES =" Makefile | sed "s/EMPTY_LIB_NAMES = //"); do
|
||||||
ln -s libc.so $MAPLE/lib/lib$lib.so
|
ln -sf libc.so $MAPLE/lib/lib$lib.so
|
||||||
done
|
done
|
||||||
# NOTE: musl has some witchcraft associated with it that allows it to function
|
# NOTE: musl has some witchcraft associated with it that allows it to function
|
||||||
# as an implementation of ldd. Honestly, the idea of a library with as an
|
# as an implementation of ldd. Honestly, the idea of a library with as an
|
||||||
# entry point is something I have never thought of before, but I'm
|
# entry point is something I have never thought of before, but I'm
|
||||||
# interested in exploring the possibilities. ~ahill
|
# interested in exploring the possibilities. ~ahill
|
||||||
ln -s /lib/ld-musl-x86_64.so.1 $MAPLE/bin/ldd
|
ln -sf /lib/ld-musl-x86_64.so.1 $MAPLE/bin/ldd
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# dash Build
|
# dash Build
|
||||||
@@ -124,7 +130,7 @@ cd dash-*/
|
|||||||
--sharedstatedir=/usr/com
|
--sharedstatedir=/usr/com
|
||||||
make -j $THREADS
|
make -j $THREADS
|
||||||
make -j $THREADS install DESTDIR=$MAPLE
|
make -j $THREADS install DESTDIR=$MAPLE
|
||||||
ln -s dash $MAPLE/bin/sh
|
ln -sf dash $MAPLE/bin/sh
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# m4 Build
|
# m4 Build
|
||||||
@@ -300,7 +306,6 @@ cd ..
|
|||||||
# potential conflict with CMake. Adapted from Nick's contribution. ~ahill
|
# potential conflict with CMake. Adapted from Nick's contribution. ~ahill
|
||||||
export CFLAGS=$(echo $CFLAGS | sed "s/--sysroot=\S*//")
|
export CFLAGS=$(echo $CFLAGS | sed "s/--sysroot=\S*//")
|
||||||
export CXXFLAGS=$(echo $CXXFLAGS | sed "s/--sysroot=\S*//")
|
export CXXFLAGS=$(echo $CXXFLAGS | sed "s/--sysroot=\S*//")
|
||||||
tar xf ../sources/llvm-project-*.tar*
|
|
||||||
cd llvm-project-*/
|
cd llvm-project-*/
|
||||||
TOOLCHAIN_FILE=$HOST-maple-clang.cmake
|
TOOLCHAIN_FILE=$HOST-maple-clang.cmake
|
||||||
# NOTE: First time doing this. Did I do it right? ~ahill
|
# NOTE: First time doing this. Did I do it right? ~ahill
|
||||||
@@ -352,9 +357,9 @@ cmake -B stage2 -G Ninja -S llvm \
|
|||||||
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
|
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
|
||||||
cmake --build stage2
|
cmake --build stage2
|
||||||
cmake --install stage2
|
cmake --install stage2
|
||||||
ln -s clang $MAPLE/bin/cc
|
ln -sf clang $MAPLE/bin/cc
|
||||||
ln -s clang++ $MAPLE/bin/c++
|
ln -sf clang++ $MAPLE/bin/c++
|
||||||
ln -s ld.lld $MAPLE/bin/ld
|
ln -sf ld.lld $MAPLE/bin/ld
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
@@ -409,6 +409,13 @@ cd ..
|
|||||||
# xfsprogs Build
|
# xfsprogs Build
|
||||||
tar xf ../sources/xfsprogs-*.tar*
|
tar xf ../sources/xfsprogs-*.tar*
|
||||||
cd xfsprogs-*/
|
cd xfsprogs-*/
|
||||||
|
# NOTE: libxfs redefined PAGE_SIZE from the standard C library (limits.h), so
|
||||||
|
# we simply undefine it to get it to play nice with musl. ~ahill
|
||||||
|
sed -i "/#define PAGE_SIZE/d" libxfs/libxfs_priv.h
|
||||||
|
# NOTE: io/stat.c relies on the internal STATX__RESERVED definition to function.
|
||||||
|
# musl doesn't have STATX__RESERVED, so we replace it with STATX_ALL since
|
||||||
|
# that's what we're actually trying to achieve here. ~ahill
|
||||||
|
sed -i "s/~STATX__RESERVED/STATX_ALL/" io/stat.c
|
||||||
# Overriding system statx fixes an issue with musl compatability.
|
# Overriding system statx fixes an issue with musl compatability.
|
||||||
# Gentoo bugzilla for reference: https://bugs.gentoo.org/948468
|
# Gentoo bugzilla for reference: https://bugs.gentoo.org/948468
|
||||||
CFLAGS=-DOVERRIDE_SYSTEM_STATX ./configure \
|
CFLAGS=-DOVERRIDE_SYSTEM_STATX ./configure \
|
||||||
|
|||||||
Reference in New Issue
Block a user