pthbs

Packaging Through Hashed Build Scripts
git clone https://ccx.te2000.cz/git/pthbs
Log | Files | Refs | Submodules | README

commit 255c9a47218c093e27c6b7c7b3010f643b9438d7
parent 70d9a07196ee8d294426e5d371cdb6449d89e784
Author: Jan Pobříslo <ccx@te2000.cz>
Date:   Sat, 10 Jun 2023 12:54:15 +0200

Generate packages using templates with genpkg.py

Diffstat:
Mgenpkg.py | 2+-
Mpackages/busybox | 22++++++++++++----------
Mpackages/busybox:bootstrap | 17++++++++---------
Mpackages/gnu-make:bootstrap | 11++++++-----
Mpackages/musl-cross-make:bootstrap | 7+++----
5 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/genpkg.py b/genpkg.py @@ -8,7 +8,7 @@ import yaml class Main: - def __init__(self, out_dir="newpkg", template_dir="templates"): + def __init__(self, out_dir="packages", template_dir="templates"): self.out_dir = Path(out_dir) self.template_dir = Path(template_dir) self.env = jinja2.Environment( diff --git a/packages/busybox b/packages/busybox @@ -1,27 +1,29 @@ #!/usr/bin/env pthbs-build #+* +#+musl-cross-make.82eddae52f39e802227bbec1e7641684bee0527d489786471dc183439a9b894f +#+gnu-make.9e49ba21cb717e439f08ea97fbca88beb48e58d8a3e974ffcd633a5f73b338c5 +#+busybox.6d6253b047166a043210efc6fc25699c90bdbb0563dbd8ab0ca3153a01a6f3f6 #@git:aa4d303a3139107919f73cece4eaf85a7dc75db6:busybox #@sha256:e653a2f29743ec8f96d68f62c4db7c76db5ff769ec9e7cd6671397c7cc2b942f:busybox/.config : ${JOBS:=1} -pthbs_versions=/home/ccx/versions -mcm=$pthbs_versions/musl-cross-make.28f276dc3ccb79d848faef27306550919ffb3fe7ea079f400aa938663f00255a -make=$pthbs_versions/gnu-make.74047112114e76692c8ccca7573fcc41e6919135d4f63a14382c931be01101ae/bin/make -bb=$pthbs_versions/busybox.bb79828839f20c5ca7289b60219896456264b237bb0107ee9c9407b01704a2cc +mcm=/home/ccx/versions/musl-cross-make.82eddae52f39e802227bbec1e7641684bee0527d489786471dc183439a9b894f +make=/home/ccx/versions/gnu-make.9e49ba21cb717e439f08ea97fbca88beb48e58d8a3e974ffcd633a5f73b338c5 +bb=/home/ccx/versions/busybox.6d6253b047166a043210efc6fc25699c90bdbb0563dbd8ab0ca3153a01a6f3f6 -export PATH="$bb/$mcm/bin:/home/ccx/current/command:$PATH" +export PATH="$bb/bin:$mcm/bin:$make/bin" export CC="$mcm/bin/x86_64-linux-musl-gcc" export CXX="$mcm/bin/x86_64-linux-musl-g++" export CFLAGS="-D_GNU_SOURCE" -export LDFLAGS="-static" +export LDFLAGS="-static" cd busybox -$make V=1 LDFLAGS=-static HOSTLDFLAGS=-static \ +$make/bin/make V=1 LDFLAGS=-static HOSTLDFLAGS=-static \ HOSTCC="$CC -static" CC="$CC -static" HOSTCFLAGS=-D_GNU_SOURCE -j$JOBS -mkdir -p "$pthbs_destdir/${pthbs_versions%/}/$pthbs_package/command" -cp -a busybox "$pthbs_destdir/${pthbs_versions%/}/$pthbs_package/command/" -cd "$pthbs_destdir/${pthbs_versions%/}/$pthbs_package" +mkdir -p "$pthbs_destdir/home/ccx/versions/$pthbs_package/command" +cp -a busybox "$pthbs_destdir/home/ccx/versions/$pthbs_package/command/" +cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" echo false | ./command/busybox --list >/dev/null # test if it works ./command/busybox --list | awk ' { print "./command/busybox\t./command/busybox" $0 } diff --git a/packages/busybox:bootstrap b/packages/busybox:bootstrap @@ -4,23 +4,22 @@ #@sha256:e653a2f29743ec8f96d68f62c4db7c76db5ff769ec9e7cd6671397c7cc2b942f:busybox/.config : ${JOBS:=1} -pthbs_versions=/home/ccx/versions -mcm=/home/ccx/versions/musl-cross-make.28f276dc3ccb79d848faef27306550919ffb3fe7ea079f400aa938663f00255a -make=/home/ccx/versions/gnu-make.74047112114e76692c8ccca7573fcc41e6919135d4f63a14382c931be01101ae/bin/make +mcm=/home/ccx/versions/musl-cross-make.82eddae52f39e802227bbec1e7641684bee0527d489786471dc183439a9b894f +make=/home/ccx/versions/gnu-make.9e49ba21cb717e439f08ea97fbca88beb48e58d8a3e974ffcd633a5f73b338c5 -export PATH="$mcm/bin:/home/ccx/current/command:$PATH" +export PATH="$mcm/bin:$make/bin:$PATH" export CC="$mcm/bin/x86_64-linux-musl-gcc" export CXX="$mcm/bin/x86_64-linux-musl-g++" export CFLAGS="-D_GNU_SOURCE" -export LDFLAGS="-static" +export LDFLAGS="-static" cd busybox -$make V=1 LDFLAGS=-static HOSTLDFLAGS=-static \ +$make/bin/make V=1 LDFLAGS=-static HOSTLDFLAGS=-static \ HOSTCC="$CC -static" CC="$CC -static" HOSTCFLAGS=-D_GNU_SOURCE -j$JOBS -mkdir -p "$pthbs_destdir/${pthbs_versions%/}/$pthbs_package/command" -cp -a busybox "$pthbs_destdir/${pthbs_versions%/}/$pthbs_package/command/" -cd "$pthbs_destdir/${pthbs_versions%/}/$pthbs_package" +mkdir -p "$pthbs_destdir/home/ccx/versions/$pthbs_package/command" +cp -a busybox "$pthbs_destdir/home/ccx/versions/$pthbs_package/command/" +cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" echo false | ./command/busybox --list >/dev/null # test if it works ./command/busybox --list | awk ' { print "./command/busybox\t./command/busybox" $0 } diff --git a/packages/gnu-make:bootstrap b/packages/gnu-make:bootstrap @@ -4,13 +4,13 @@ : ${JOBS:=1} pthbs_versions=/home/ccx/versions -mcm=/home/ccx/versions/musl-cross-make.28f276dc3ccb79d848faef27306550919ffb3fe7ea079f400aa938663f00255a +mcm=/home/ccx/versions/musl-cross-make.82eddae52f39e802227bbec1e7641684bee0527d489786471dc183439a9b894f -export PATH="$mcm/bin:/home/ccx/current/command:$PATH" +export PATH="$mcm/bin:$PATH" export CC="$mcm/bin/x86_64-linux-musl-gcc" export CXX="$mcm/bin/x86_64-linux-musl-g++" export CFLAGS="-D_GNU_SOURCE" -export LDFLAGS="-static" +export LDFLAGS="-static" cd make-4.4.1 ./configure -C --prefix="$pthbs_versions/$pthbs_package" --build="$($CC -dumpmachine)" --disable-nls @@ -18,7 +18,7 @@ cd make-4.4.1 make -j$JOBS -l$(1+JOBS) make DESTDIR="$pthbs_destdir" install-strip -cd "$pthbs_destdir/${pthbs_versions%/}/$pthbs_package" +cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" find -type d -o -print | awk -F/ ' BEGIN { x["./bin/make"]=1 @@ -37,11 +37,12 @@ function link(src) { x[$0]=0 printf "%s\t%s\n", $0, src } -$1!="."{ exit 1 } +$1!="."{exit 1} $2 == "share" && $3 ~ /^(info|man)$/ { link(r1($0)); next } $2 == "bin" { link(s1("command", $0)); next } $2 == "include" { link($0); next } +$2 == "lib" { link($0); next } END { for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } diff --git a/packages/musl-cross-make:bootstrap b/packages/musl-cross-make:bootstrap @@ -2,14 +2,13 @@ #+* #@git:fe915821b652a7fa37b34a596f47d8e20bc72338:musl-cross-make -export TARGET=x86_64-linux-musl : ${JOBS:=1} -pthbs_versions=/home/ccx/versions -printf '%s\n' >musl-cross-make/config.mak "OUTPUT=${pthbs_destdir%/}$pthbs_versions/$pthbs_package" +export TARGET=x86_64-linux-musl +printf '%s\n' >musl-cross-make/config.mak "OUTPUT=${pthbs_destdir%/}/home/ccx/versions/$pthbs_package" make -C musl-cross-make -j$JOBS -l$(1+$JOBS) || exit $? make -C musl-cross-make install || exit $? -cd "$pthbs_destdir/${pthbs_versions%/}/$pthbs_package" +cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" find -type d -o -print | awk -F/ ' BEGIN { x["./bin/x86_64-linux-musl-g++"]=1