Integrated Treetap into Maple Linux #1

Merged
ahill merged 74 commits from treetap into main 2026-01-25 22:51:04 +00:00
10 changed files with 211 additions and 12 deletions
Showing only changes of commit 38329ef5fd - Show all commits

View File

@ -3,14 +3,20 @@ This document tracks which packages can be built and packaged within the chroot.
| Package | Can Build? | Can Package? |
| ------------ | ---------- | ------------ |
| `busybox` | No | No |
| `byacc` | Yes | Yes |
| `bzip2` | Yes | Yes |
| `cmake` | Yes | Yes |
| `editline` | Yes | Yes |
| `flex` | Yes | Yes |
| `libarchive` | Yes | Yes |
| `libressl` | Yes | Yes |
| `linux` | No | No |
| `llvm` | No | No |
| `m4` | Yes | Yes |
| `make` | Yes | Yes |
| `mold` | Yes | Yes |
| `muon` | Yes | Yes |
| `musl` | Yes | Yes |
| `ncurses` | Yes | Yes |
| `xz` | Yes | Yes |
| `zlib` | Yes | Yes |

View File

@ -241,7 +241,7 @@ cp $TREETAP $BOOTSTRAP/root/bin/
mkdir -p $BOOTSTRAP/root/maple/
cp rootbuild.sh $BOOTSTRAP/root/maple/
export TT_DIR=$BOOTSTRAP/root/maple/.treetap
SOURCES=(libarchive libressl xz)
SOURCES=(busybox byacc bzip2 cmake editline flex libarchive libressl linux llvm m4 make mold muon musl ncurses xz zlib)
for name in $SOURCES; do
$TREETAP fetch $SPEC/$name/$name.spec
done

View File

@ -3,12 +3,15 @@ export CFLAGS="-O3 -pipe"
export CXXFLAGS=$CFLAGS
# xz Build
# NOTE: xz is needed to run "treetap package", so we manually install. ~ahill
cd /maple
treetap build sources/xz/xz.spec
cd .treetap/sources/xz/*/*/xz-*/
make -j $(nproc) install DESTDIR=/
# libarchive Build
# NOTE: bsdcpio is needed to run "treetap package", so we manually install.
# ~ahill
cd /maple
treetap build sources/libarchive/libarchive.spec
cd .treetap/sources/libarchive/*/*/libarchive-*/
@ -18,9 +21,12 @@ make -j $(nproc) install DESTDIR=/
# 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
# built after them. ~ahill
# NOTE: mold requires CMake to build. ~ahill
PACKAGES="bzip2 libressl make musl xz zlib libarchive cmake mold"
# NOTE: flex requires byacc and m4 to build. ~ahill
# NOTE: editline requires ncurses to build. ~ahill
cd /maple
PACKAGES="byacc bzip2 libressl m4 make muon musl ncurses xz zlib editline flex libarchive cmake mold"
for pkg in $PACKAGES; do
treetap fetch sources/$pkg/$pkg.spec
treetap build sources/$pkg/$pkg.spec

29
sources/byacc/byacc.spec Normal file
View File

@ -0,0 +1,29 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_HASH="192c2fae048d4e7f514ba451627f9c4e612765099f819c19191f9fde3e609673"
SRC_NAME="byacc"
SRC_URL="https://invisible-mirror.net/archives/byacc/byacc-20241231.tgz"
SRC_VERSION="20241231"
build() {
tar xf ../$SRC_FILENAME
cd byacc-*/
./configure $TT_AUTOCONF_COMMON
make -O -j $TT_PROCS
}
clean() {
rm -rf byacc-*/
}
package() {
cd byacc-*/
# NOTE: byacc's "make install" calls diff -c, which is unsupported by
# Busybox. Unfortunately, our other implementation of diff requires
# byacc to build, meaning we'll need to do a manual install to prevent
# a circular dependency. ~ahill
mkdir -p $TT_INSTALLDIR/bin
cp yacc $TT_INSTALLDIR/bin/
ln -s yacc $TT_INSTALLDIR/bin/byacc
mkdir -p $TT_INSTALLDIR/usr/share/man/man1
cp yacc.1 $TT_INSTALLDIR/usr/share/man/man1/
}

View File

@ -0,0 +1,24 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_HASH="21362b00653bbfc1c71f71a7578da66b5b5203559d43134d2dd7719e313ce041"
SRC_NAME="editline"
SRC_URL="https://thrysoee.dk/editline/libedit-20251016-3.1.tar.gz"
SRC_VERSION="20251016-3.1"
build() {
tar xf ../$SRC_FILENAME
cd libedit-*/
./configure $TT_AUTOCONF_COMMON --disable-static
# NOTE: wchar_t isn't defined correctly due to a bug in clang, preventing
# libedit from building properly. ~ahill
# See also: https://bugs.gentoo.org/870001
make -O -j $TT_PROCS CFLAGS="$CFLAGS -include stdc-predef.h"
}
clean() {
rm -rf libedit-*/
}
package() {
cd libedit-*/
make -O -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR
}

21
sources/flex/flex.spec Normal file
View File

@ -0,0 +1,21 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_HASH="e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995"
SRC_NAME="flex"
SRC_URL="https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz"
SRC_VERSION="2.6.4"
build() {
tar xf ../$SRC_FILENAME
cd flex-*/
./configure $TT_AUTOCONF_COMMON --disable-static
make -O -j $TT_PROCS
}
clean() {
rm -rf flex-*/
}
package() {
cd flex-*/
make -O -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR
}

20
sources/m4/m4.spec Normal file
View File

@ -0,0 +1,20 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_HASH="e4315fef49b08912b1d1db3774dd98f971397b2751c648512b6c8d852590dc50"
SRC_NAME="m4"
SRC_URL="http://haddonthethird.net/m4/m4-2.tar.bz2"
SRC_VERSION="2"
build() {
tar xf ../$SRC_FILENAME
cd m4-*/
make -O -j $TT_PROCS
}
clean() {
rm -rf m4-*/
}
package() {
cd m4-*/
make -O -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR
}

24
sources/muon/muon.spec Normal file
View File

@ -0,0 +1,24 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_FILENAME="muon-0.5.0.tar.gz"
SRC_HASH="565c1b6e1e58f7e90d8813fda0e2102df69fb493ddab4cf6a84ce3647466bee5"
SRC_NAME="muon"
SRC_URL="https://git.sr.ht/~lattis/muon/archive/0.5.0.tar.gz"
SRC_VERSION="0.5.0"
build() {
tar xf ../$SRC_FILENAME
cd muon-*/
./bootstrap.sh build
./build/muon-bootstrap setup build
./build/muon-bootstrap -C build samu
./build/muon -C build test -R
}
clean() {
rm -rf muon-*/
}
package() {
cd muon-*/
DESTDIR=$TT_INSTALLDIR ./build/muon -C build install
}

View File

@ -0,0 +1,30 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_HASH="136d91bc269a9a5785e5f9e980bc76ab57428f604ce3e5a5a90cebc767971cc6"
SRC_NAME="ncurses"
SRC_URL="https://invisible-island.net/archives/ncurses/ncurses-6.5.tar.gz"
SRC_VERSION="6.5"
build() {
tar xf ../$SRC_FILENAME
cd ncurses-*/
./configure $TT_AUTOCONF_COMMON \
--with-cxx-shared \
--with-shared \
--without-ada \
--without-normal \
--without-tests
make -O -j $TT_PROCS
}
clean() {
rm -rf ncurses-*/
}
package() {
cd ncurses-*/
make -O -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR
# NOTE: These symlinks exist for compatibility's sake, since some libraries
# will only look for "ncurses" and not "ncursesw". ~ahill
ln -s libncursesw.so $TT_INSTALLDIR/lib/libncurses.so
ln -s libncurses++w.so $TT_INSTALLDIR/lib/libncurses++.so
}

57
treetap
View File

@ -18,6 +18,15 @@
# Changelog #
#############
# November 24, 2025 (1.3.0)
# + Added TT_DATADIR [ahill]
# + Added TT_MESON_COMMON for easy Meson integration [ahill]
# + Added TT_RUNDIR [ahill]
# + Added TT_STATEDIR [ahill]
# * Fixed a bug where applying TT_AUTOCONF_COMMON with some versions of autoconf
# cause it to think we're cross-compiling when we're not. [ahill]
# * Switched from GNU cpio to bsdcpio to function on Maple Linux [ahill]
# November 22, 2025 (1.2.0)
# + Added support for the CCACHE environment variable [ahill]
# + Added TT_ARCH [ahill]
@ -82,6 +91,8 @@
# [scope: source]
# TT_CONFDIR - The desired path for configuration files
# [scope: source] [default: /etc]
# TT_DATADIR - The desired path for data files
# [scope: source] [default: /usr/share]
# TT_DIR - The path to the treetap directory
# [scope: global]
# TT_INCLUDEDIR - The desired path for header files
@ -90,6 +101,8 @@
# [scope: source]
# TT_LIBDIR - The desired path for libraries
# [scope: source] [default: /lib]
# TT_MESON_COMMON - The default meson arguments based on the environment
# [scope: source]
# TT_MICROARCH - The microarchitecture to optimize for
# [scope: source]
# TT_PKGDIR - The path to the package directory
@ -98,6 +111,10 @@
# [scope: source] [default: /]
# TT_PROCS - The number of processors on the build system
# [scope: source]
# TT_RUNDIR - The desired path for temporary runtime information
# [scope: source] [default: /run]
# TT_STATEDIR - The desired path for persistent runtime information
# [scope: source] [default: /var]
# TT_SYSROOT - The sysroot of the target system
# [scope: global]
# TT_TARGET - The target triple of the target system
@ -112,7 +129,7 @@
[ -z "$TT_DIR" ] && TT_DIR="$(pwd)/.treetap"
[ -z "$TT_PKGDIR" ] && TT_PKGDIR="$TT_DIR/packages"
[ -z "$TT_SYSROOT" ] && TT_SYSROOT=/
TT_VERSION="1.2.0"
TT_VERSION="1.3.0"
#####################
# Utility Functions #
@ -171,10 +188,13 @@ source_spec() {
TT_BUILD=$(clang -dumpmachine)
[ -z "$TT_TARGET" ] && TT_TARGET=$TT_BUILD
[ -z "$TT_CONFDIR" ] && TT_CONFDIR=/etc
[ -z "$TT_DATADIR" ] && TT_DATADIR=/usr/share
[ -z "$TT_INCLUDEDIR" ] && TT_INCLUDEDIR=/usr/include
[ -z "$TT_LIBDIR" ] && TT_LIBDIR=/lib
[ -z "$TT_PREFIX" ] && TT_PREFIX=/
[ -z "$TT_PROCS" ] && TT_PROCS=$(nproc)
[ -z "$TT_RUNDIR" ] && TT_RUNDIR=/run
[ -z "$TT_STATEDIR" ] && TT_STATEDIR=/var
# Attempt to guess TT_MICROARCH if it isn't defined
TT_ARCH=$(echo $TT_TARGET | cut -d"-" -f1)
@ -200,19 +220,25 @@ source_spec() {
# Create convenience variables
TT_AUTOCONF_COMMON=$(echo "--bindir=$TT_BINDIR \
--build=$TT_BUILD \
--datarootdir=/usr/share \
--host=$TT_TARGET \
--datarootdir=$TT_DATADIR \
--includedir=$TT_INCLUDEDIR \
--libdir=$TT_LIBDIR \
--libexecdir=$TT_LIBDIR \
--localstatedir=/var \
--localstatedir=$TT_STATEDIR \
--prefix=$TT_PREFIX \
--runstatedir=/run \
--runstatedir=$TT_RUNDIR \
--sbindir=$TT_BINDIR \
--sysconfdir=$TT_CONFDIR \
--target=$TT_TARGET \
--with-sysroot=$TT_SYSROOT" | xargs)
# NOTE: Some versions of autoconf does not like having host/target set
# unless we're actually cross-compiling.
if [ ! "$TT_BUILD" = "$TT_TARGET" ]; then
TT_AUTOCONF_COMMON=$(echo "$TT_AUTOCONF_COMMON \
--host=$TT_TARGET \
--target=$TT_TARGET" | xargs)
fi
TT_CMAKE_COMMON=$(echo "-DCMAKE_ASM_COMPILER_TARGET=$TT_TARGET \
-DCMAKE_C_COMPILER_TARGET=$TT_TARGET \
-DCMAKE_CXX_COMPILER_TARGET=$TT_TARGET \
@ -229,6 +255,19 @@ source_spec() {
-DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE" | xargs)
fi
TT_MESON_COMMON=$(echo "-Dbindir=$TT_BINDIR \
-Ddatadir=$TT_DATADIR \
-Dincludedir=$TT_INCLUDEDIR \
-Dinfodir=$TT_DATADIR/info \
-Dlibdir=$TT_LIBDIR \
-Dlibexecdir=$TT_LIBDIR \
-Dlocaledir=$TT_DATADIR/locale \
-Dlocalstatedir=$TT_STATEDIR \
-Dmandir=$TT_DATADIR/man \
-Dprefix=$TT_PREFIX \
-Dsbindir=$TT_BINDIR \
-Dsysconfdir=$TT_CONFDIR" | xargs)
true
}
@ -243,7 +282,7 @@ package_install() {
echo "Installing $(basename $1)"
PUSHD=$(pwd)
cd $TT_SYSROOT
xz -cdk $PKG_FULLPATH | cpio -idmu --quiet
bsdcpio -iJ < $PKG_FULLPATH
cd $PUSHD
exit 0
}
@ -255,7 +294,7 @@ package_uninstall() {
echo "Uninstalling $(basename $1)"
PUSHD=$(pwd)
cd $TT_SYSROOT
xz -cdk $PKG_FULLPATH | cpio -it --quiet | tail -n +2 | sort -r | while read path; do
bsdcpio -iJt < $PKG_FULLPATH | tail -n +2 | sort -r | while read path; do
if [ -d $path ]; then
rmdir --ignore-fail-on-non-empty $path
else
@ -342,7 +381,7 @@ source_package() {
echo "Archiving $SRC_NAME $SRC_VERSION for $TT_MICROARCH"
package > package-$(date +%Y%m%d%H%M%S).log
cd $TT_INSTALLDIR
find | cpio -o --quiet | xz -cz > "$TT_PKGDIR/$TT_MICROARCH/$SRC_NAME-$SRC_VERSION-$TT_MICROARCH.cpio.xz"
find | bsdcpio -Jo > "$TT_PKGDIR/$TT_MICROARCH/$SRC_NAME-$SRC_VERSION-$TT_MICROARCH.cpio.xz"
rm -rf $TT_INSTALLDIR
cd $PUSHD
exit 0