diff options
| author | Alexander Hill <ahill@breadpudding.dev> | 2025-11-23 20:05:48 -0500 |
|---|---|---|
| committer | Alexander Hill <ahill@breadpudding.dev> | 2025-11-23 20:05:48 -0500 |
| commit | bb0d0c543355b26804e81da284401c59dd453693 (patch) | |
| tree | be6fd2ce6090a277e116caf6832ee83bcdef79fd | |
| parent | edaecac8bf47c8b0d76602aed1e44026446a0f49 (diff) | |
Fixed LibreSSL and built bzip2, Zlib, and CMake
| -rw-r--r-- | STATUS.md | 7 | ||||
| -rwxr-xr-x | bootstrap.sh | 12 | ||||
| -rwxr-xr-x | rootbuild.sh | 28 | ||||
| -rw-r--r-- | sources/bzip2/bzip2.spec | 32 | ||||
| -rw-r--r-- | sources/cmake/cmake.spec | 30 | ||||
| -rw-r--r-- | sources/libressl/libressl.spec | 2 | ||||
| -rw-r--r-- | sources/zlib/zlib.spec | 28 |
7 files changed, 135 insertions, 4 deletions
@@ -3,11 +3,14 @@ This document tracks which packages can be built and packaged within the chroot. | Package | Can Build? | Can Package? | | ------------ | ---------- | ------------ | | `busybox` | No | No | +| `bzip2` | Yes | Yes | +| `cmake` | Yes | No | | `libarchive` | Yes | Yes | -| `libressl` | Yes | No | +| `libressl` | Yes | Yes | | `linux` | No | No | | `llvm` | No | No | | `make` | Yes | Yes | | `mold` | No | No | | `musl` | Yes | Yes | -| `xz` | Yes | Yes |
\ No newline at end of file +| `xz` | Yes | Yes | +| `zlib` | Yes | Yes |
\ No newline at end of file diff --git a/bootstrap.sh b/bootstrap.sh index 1d8f2cc..9db1e37 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -235,4 +235,14 @@ for name in $SOURCES; do done # Install Treetap -cp $TREETAP $BOOTSTRAP/root/bin/
\ No newline at end of file +cp $TREETAP $BOOTSTRAP/root/bin/ + +# Prepare for chroot build +mkdir -p $BOOTSTRAP/root/maple/ +cp rootbuild.sh $BOOTSTRAP/root/maple/ +export TT_DIR=$BOOTSTRAP/root/maple/.treetap +SOURCES=(libarchive libressl xz) +for name in $SOURCES; do + $TREETAP fetch $SPEC/$name/$name.spec +done +cp -r $SPEC $BOOTSTRAP/root/maple/
\ No newline at end of file diff --git a/rootbuild.sh b/rootbuild.sh new file mode 100755 index 0000000..0aeedfa --- /dev/null +++ b/rootbuild.sh @@ -0,0 +1,28 @@ +#!/bin/sh -e +export CFLAGS="-O3 -pipe" +export CXXFLAGS=$CFLAGS + +# xz Build +cd /maple +treetap build sources/xz/xz.spec +cd .treetap/sources/xz/*/*/xz-*/ +make -j $(nproc) install DESTDIR=/ + +# libarchive Build +cd /maple +treetap build sources/libarchive/libarchive.spec +cd .treetap/sources/libarchive/*/*/libarchive-*/ +make -j $(nproc) install DESTDIR=/ + +# Now we can build stuff exclusively with treetap +# NOTE: bzip2, xz, and zlib need to be built before libarchive or we will be +# missing functionality! ~ahill +# NOTE: CMake requires LibreSSL and libarchive to function properly so it is +# built after that. ~ahill +PACKAGES="bzip2 libressl make musl xz zlib libarchive cmake" +for pkg in $PACKAGES; do + treetap fetch sources/$pkg/$pkg.spec + treetap build sources/$pkg/$pkg.spec + treetap package sources/$pkg/$pkg.spec + treetap install .treetap/packages/*/$pkg-*.cpio.xz +done
\ No newline at end of file diff --git a/sources/bzip2/bzip2.spec b/sources/bzip2/bzip2.spec new file mode 100644 index 0000000..21757c3 --- /dev/null +++ b/sources/bzip2/bzip2.spec @@ -0,0 +1,32 @@ +# Maintainer: Alexander Hill <ahill@breadpudding.dev> +SRC_HASH="ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" +SRC_NAME="bzip2" +SRC_URL="https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz" +SRC_VERSION="1.0.8" + +build() { + tar xf ../$SRC_FILENAME + cd bzip2-*/ + # NOTE: bzip2 likes to hard-code CC, which won't work because gcc doesn't + # exist here. ~ahill + # NOTE: -D_FILE_OFFSET_BITS is present because it's present in the Makefile + # and we're completely overriding its defaults. I don't actually know + # if this will cause any issues if it's missing. ~ahill + make -O -j $TT_PROCS CC=$CC CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" PREFIX=/ + # NOTE: I'm not sure if it's possible to build bzip2 without building a + # static library, since the executable links with the static library + # and the shared library is isolated in a separate Makefile. ~ahill + make -O -f Makefile-libbz2_so -j $TT_PROCS CC=$CC CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" PREFIX=/ +} + +clean() { + rm -rf bzip2-*/ +} + +package() { + cd bzip2-*/ + make -O -j $TT_PROCS install PREFIX=$TT_INSTALLDIR + # NOTE: The second Makefile doesn't have an "install" target, so we just + # toss the shared object into /lib and call it a day! ~ahill + cp libbz2.so* $TT_INSTALLDIR/lib/ +}
\ No newline at end of file diff --git a/sources/cmake/cmake.spec b/sources/cmake/cmake.spec new file mode 100644 index 0000000..0e80903 --- /dev/null +++ b/sources/cmake/cmake.spec @@ -0,0 +1,30 @@ +# Maintainer: Alexander Hill <ahill@breadpudding.dev> +SRC_HASH="4104e94657d247c811cb29985405a360b78130b5d51e7f6daceb2447830bd579" +SRC_NAME="cmake" +SRC_URL="https://github.com/Kitware/CMake/releases/download/v4.2.0/cmake-4.2.0.tar.gz" +SRC_VERSION="4.2.0" + +build() { + tar xf ../$SRC_FILENAME + cd cmake-*/ + # NOTE: CMake's bootstrap script is strange because *everything* is located + # under the prefix, whether you like it or not. We're making use of + # /usr/bin this way, which is something I would like to avoid. ~ahill + ./bootstrap \ + --parallel=$TT_PROCS \ + --prefix=/usr \ + --system-bzip2 \ + --system-libarchive \ + --system-liblzma \ + --system-zlib + make -O -j $TT_PROCS +} + +clean() { + rm -rf cmake-*/ +} + +package() { + cd cmake-*/ + make -O -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR +}
\ No newline at end of file diff --git a/sources/libressl/libressl.spec b/sources/libressl/libressl.spec index 744eaaf..1f727ec 100644 --- a/sources/libressl/libressl.spec +++ b/sources/libressl/libressl.spec @@ -19,5 +19,5 @@ clean() { package() { cd libressl-*/ - make -j $TT_PROCS install DESTDIR=$TT_SYSROOT + make -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR }
\ No newline at end of file diff --git a/sources/zlib/zlib.spec b/sources/zlib/zlib.spec new file mode 100644 index 0000000..497775a --- /dev/null +++ b/sources/zlib/zlib.spec @@ -0,0 +1,28 @@ +# Maintainer: Alexander Hill <ahill@breadpudding.dev> +SRC_HASH="38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32" +SRC_NAME="zlib" +SRC_URL="https://www.zlib.net/zlib-1.3.1.tar.xz" +SRC_VERSION="1.3.1" + +build() { + tar xf ../$SRC_FILENAME + cd zlib-*/ + # NOTE: The prefix is set to /usr because man pages are stored under the + # prefix whether you like it or not. ~ahill + ./configure \ + --eprefix=$TT_PREFIX \ + --includedir=$TT_INCLUDEDIR \ + --libdir=$TT_LIBDIR \ + --prefix=/usr \ + --shared + make -O -j $TT_PROCS +} + +clean() { + rm -rf zlib-*/ +} + +package() { + cd zlib-*/ + make -O -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR +}
\ No newline at end of file |
