commit 9a615eb42f189df9945cffba29b748812a6781ea
parent 481e666b5eaa6db28b62cd1d03b9c9fc58e6ae68
Author: Jan Pobříslo <ccx@te2000.cz>
Date: Fri, 16 Jun 2023 02:00:54 +0200
Add m4, flex, missing templates
Diffstat:
18 files changed, 363 insertions(+), 2 deletions(-)
diff --git a/downloadlist.sha256 b/downloadlist.sha256
@@ -1,5 +1,7 @@
dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3 2348200 https://ftp.gnu.org/gnu/make/make-4.4.1.tar.gz
8d284d896fca1c981b55850e92acd3ad9648a69227c028dda7ae3402af878edd 1125800 https://github.com/libcgroup/libcgroup/releases/download/v3.0/libcgroup-3.0.0.tar.gz
+e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995 1419096 https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz
+3be4a26d825ffdfda52a56fc43246456989a3630093cced3fbddf4771ee58a70 2953876 https://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.gz
# musl-cross-make
ab66fc2d1c3ec0359b8e08843c9f33b63e8707efdff5e4cc5c200eae24722cbf 21490848 https://ftpmirror.gnu.org/gnu/binutils/binutils-2.33.1.tar.xz
diff --git a/packages/default.environment b/packages/default.environment
@@ -9,4 +9,5 @@
#+s6-linux-init.863fd837322c69c2e92a9d75661c483a72e853f5438cb62be926b3b5d12406ea
#+mdevd.cd38a8e0d5b9494e35597d3c260b3710fc54c2020c2de4ad78a18ad53e196a6f
#+s6-dns.5fd84dae00e72969ebeb48aeaddfe4ed717127d66fd1c73413f071419f1df3b9
-#+s6-networking.b9d93d7943d89450f426f0cecf82c9febd56d5f4972d3edf39c30afb20e225f8-
\ No newline at end of file
+#+s6-networking.b9d93d7943d89450f426f0cecf82c9febd56d5f4972d3edf39c30afb20e225f8
+#+flex.c06b5bc14da41d80bd3be3c6bafdf5c8623e5b08175d6cbb943768844db9c328+
\ No newline at end of file
diff --git a/packages/flex b/packages/flex
@@ -0,0 +1,91 @@
+#!/usr/bin/env pthbs-build
+#+*
+#+musl-cross-make.174caae2eabc9cd58859ace659c02352f121b4021e96cf6381632129988e39ec
+#+gnu-make.1591841d61749dff544266ed7ceaf40631698486319b221a0dbb1bd0b2297ac9
+#+busybox.db62e4a9ea0f78c45e803fb9350b99b1b860457bb4b165ed18f11fb198375458
+#+m4.eaea879a1913330fe4b4366112c9ffc4929d436116505690cd0720b2759e1a23
+#@untar:-vz:sha256:e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995:.
+
+autotools() {
+ cd "$1"
+ shift
+ export LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so"
+ export CPATH="$pthbs_build_environment/include"
+ prefix=/home/ccx/versions/$pthbs_package
+ ./configure -C \
+ --prefix="$prefix" \
+ --build="$($CC -dumpmachine)" \
+ --bindir="$prefix/command" \
+ --sbindir="$prefix/command" \
+ --infodir="$prefix/info" \
+ --localedir="$prefix/locale" \
+ --mandir="$prefix/man" \
+ --libdir="$prefix/library.so" \
+ --docdir="$prefix/doc/flex" \
+ --localstatedir='/home/ccx/.local/var' \
+ "$@"
+ # --libexecdir=DIR program executables [EPREFIX/libexec]
+ # --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ # --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ # --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ # --includedir=DIR C header files [PREFIX/include]
+ # --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ # --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ # --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+
+ # ac_cv_func_malloc_0_nonnull=yes \
+ # ac_cv_func_realloc_0_nonnull=yes
+ make -j${JOBS:-1} -l$((1+${JOBS:-1}))
+ make DESTDIR="$pthbs_destdir" install
+}
+
+
+# from sabotage
+#printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > tests/Makefile.in
+#[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
+export LDFLAGS="-static"
+export CPPFLAGS="-D_GNU_SOURCE -DSTDC_HEADERS"
+# CFLAGS="$optcflags"
+autotools flex-2.6.4 --disable-nls --enable-static --disable-shared
+
+
+cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./command/flex"]=1
+ x["./command/flex++"]=1
+ x["./command/lex"]=1
+}
+
+function r1(s) {
+ sub("^[.]/[^/]*", ".", s)
+ return s
+}
+function s1(repl, s) {
+ sub("^[.]/[^/]*", "./"repl, s)
+ return s
+}
+function link(src) {
+ x[$0]=0
+ printf "%s\t%s\n", $0, src
+}
+$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 == "library.so" { link($0); next }
+$2 == "lib" { link(s1("library.so", $0)); next }
+$2 == "library" { link($0); next }
+
+END {
+ for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
+ for(fname in x) {
+ if(x[fname]) {
+ printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
+ exit 3
+ }
+ }
+}' >.install-links.new
+mv .install-links.new .install-links
diff --git a/packages/m4 b/packages/m4
@@ -0,0 +1,86 @@
+#!/usr/bin/env pthbs-build
+#+*
+#+musl-cross-make.174caae2eabc9cd58859ace659c02352f121b4021e96cf6381632129988e39ec
+#+gnu-make.1591841d61749dff544266ed7ceaf40631698486319b221a0dbb1bd0b2297ac9
+#+busybox.db62e4a9ea0f78c45e803fb9350b99b1b860457bb4b165ed18f11fb198375458
+#+*
+#+musl-cross-make.174caae2eabc9cd58859ace659c02352f121b4021e96cf6381632129988e39ec
+#+gnu-make.1591841d61749dff544266ed7ceaf40631698486319b221a0dbb1bd0b2297ac9
+#+busybox.db62e4a9ea0f78c45e803fb9350b99b1b860457bb4b165ed18f11fb198375458
+#@untar:-vz:sha256:3be4a26d825ffdfda52a56fc43246456989a3630093cced3fbddf4771ee58a70:.
+
+autotools() {
+ cd "$1"
+ shift
+ export LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so"
+ export CPATH="$pthbs_build_environment/include"
+ prefix=/home/ccx/versions/$pthbs_package
+ ./configure -C \
+ --prefix="$prefix" \
+ --build="$($CC -dumpmachine)" \
+ --bindir="$prefix/command" \
+ --sbindir="$prefix/command" \
+ --infodir="$prefix/info" \
+ --localedir="$prefix/locale" \
+ --mandir="$prefix/man" \
+ --libdir="$prefix/library.so" \
+ --docdir="$prefix/doc/m4" \
+ --localstatedir='/home/ccx/.local/var' \
+ "$@"
+ # --libexecdir=DIR program executables [EPREFIX/libexec]
+ # --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ # --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ # --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ # --includedir=DIR C header files [PREFIX/include]
+ # --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ # --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ # --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+
+ # ac_cv_func_malloc_0_nonnull=yes \
+ # ac_cv_func_realloc_0_nonnull=yes
+ make -j${JOBS:-1} -l$((1+${JOBS:-1}))
+ make DESTDIR="$pthbs_destdir" install
+}
+
+
+autotools m4-1.4.19 --disable-nls --enable-static --disable-shared
+
+
+cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./command/m4"]=1
+}
+
+function r1(s) {
+ sub("^[.]/[^/]*", ".", s)
+ return s
+}
+function s1(repl, s) {
+ sub("^[.]/[^/]*", "./"repl, s)
+ return s
+}
+function link(src) {
+ x[$0]=0
+ printf "%s\t%s\n", $0, src
+}
+$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 == "library.so" { link($0); next }
+$2 == "lib" { link(s1("library.so", $0)); next }
+$2 == "library" { link($0); next }
+
+END {
+ for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
+ for(fname in x) {
+ if(x[fname]) {
+ printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
+ exit 3
+ }
+ }
+}' >.install-links.new
+mv .install-links.new .install-links
diff --git a/templates/autotools b/templates/autotools
@@ -0,0 +1,46 @@
+{% extends "genlinks" %}
+{%- block script %}
+#+*
+#+{{pkg_install_name("musl-cross-make")}}
+#+{{pkg_install_name("gnu-make")}}
+#+{{pkg_install_name("busybox")}}
+{%- block extra_deps %}
+{%- endblock %}
+
+autotools() {
+ cd "$1"
+ shift
+ export LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so"
+ export CPATH="$pthbs_build_environment/include"
+ prefix={{versions}}/$pthbs_package
+ ./configure -C \
+ --prefix="$prefix" \
+ --build="$($CC -dumpmachine)" \
+ --bindir="$prefix/command" \
+ --sbindir="$prefix/command" \
+ --infodir="$prefix/info" \
+ --localedir="$prefix/locale" \
+ --mandir="$prefix/man" \
+ --libdir="$prefix/library.so" \
+ --docdir="$prefix/doc/{{name}}" \
+ --localstatedir='{{var_dir}}' \
+ "$@"
+ # --libexecdir=DIR program executables [EPREFIX/libexec]
+ # --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ # --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ # --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ # --includedir=DIR C header files [PREFIX/include]
+ # --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ # --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ # --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+
+ # ac_cv_func_malloc_0_nonnull=yes \
+ # ac_cv_func_realloc_0_nonnull=yes
+ {{make}}
+ make DESTDIR="$pthbs_destdir" install
+}
+
+{% block at_script %}
+autotools '{{name}}'
+{% endblock %}
+{% endblock %}
diff --git a/templates/pkg/default.environment b/templates/pkg/default.environment
@@ -10,3 +10,4 @@
#+{{pkg_install_name("mdevd")}}
#+{{pkg_install_name("s6-dns")}}
#+{{pkg_install_name("s6-networking")}}
+#+{{pkg_install_name("flex")}}
diff --git a/templates/pkg/flex b/templates/pkg/flex
@@ -0,0 +1,19 @@
+{% extends "autotools" %}
+{%- block extra_deps %}
+#+{{pkg_install_name("m4")}}
+#@untar:-vz:sha256:e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995:.
+{%- endblock %}
+{% block at_script %}
+# from sabotage
+#printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > tests/Makefile.in
+#[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
+export LDFLAGS="-static"
+export CPPFLAGS="-D_GNU_SOURCE -DSTDC_HEADERS"
+# CFLAGS="$optcflags"
+autotools flex-2.6.4 --disable-nls --enable-static --disable-shared
+{% endblock %}
+{% block genlinks_begin %}
+ x["./command/flex"]=1
+ x["./command/flex++"]=1
+ x["./command/lex"]=1
+{% endblock %}
diff --git a/templates/pkg/m4 b/templates/pkg/m4
@@ -0,0 +1,14 @@
+{% extends "autotools" %}
+{%- block extra_deps %}
+#+*
+#+{{pkg_install_name("musl-cross-make")}}
+#+{{pkg_install_name("gnu-make")}}
+#+{{pkg_install_name("busybox")}}
+#@untar:-vz:sha256:3be4a26d825ffdfda52a56fc43246456989a3630093cced3fbddf4771ee58a70:.
+{%- endblock %}
+{% block at_script %}
+autotools m4-1.4.19 --disable-nls --enable-static --disable-shared
+{% endblock %}
+{% block genlinks_begin %}
+ x["./command/m4"]=1
+{% endblock %}
diff --git a/templates/pkg/mdevd b/templates/pkg/mdevd
@@ -0,0 +1,4 @@
+{% extends "skaware" %}
+{%- block extra_deps %}
+#+{{pkg_install_name("execline")}}
+{%- endblock %}
diff --git a/templates/pkg/s6 b/templates/pkg/s6
@@ -0,0 +1,34 @@
+{% extends "genlinks" %}
+{%- block script %}
+#+*
+#+{{pkg_install_name("musl-cross-make")}}
+#+{{pkg_install_name("gnu-make")}}
+#+{{pkg_install_name("busybox")}}
+#+{{pkg_install_name("skalibs")}}
+#+{{pkg_install_name("execline")}}
+#@git:{{submodule.current.s6}}:s6
+#@sha256:627d1273036dc35239ba9dd1da45132e3bfce1ab8171dd27dc7952cdf09b698e:s6_clone3_newpid.patch
+
+: ${JOBS:=1}
+
+prefix={{versions}}/$pthbs_package
+cd s6
+patch -up 1 -i ../s6_clone3_newpid.patch
+./configure \
+ --prefix="$prefix" \
+ --dynlibdir="${prefix}/library.so" \
+ --bindir="${prefix}/command" \
+ --libdir="${prefix}/library" \
+ --shebangdir="${prefix}/command" \
+ --with-sysdeps='{{pkg_install_dir("skalibs")}}/sysdeps' \
+ --with-include="$pthbs_build_environment/include" \
+ --with-lib="$pthbs_build_environment/library" \
+ --with-dynlib="$pthbs_build_environment/library.so" \
+ --disable-shared --enable-static --enable-allstatic --enable-static-libc --absolute-paths
+
+{{make}} CFLAGS=-DWANT_CLONE_NEWPID
+make DESTDIR="$pthbs_destdir" install
+{% endblock %}
+{% block genlinks_begin %}
+{% endblock %}
+
diff --git a/templates/pkg/s6-dns b/templates/pkg/s6-dns
@@ -0,0 +1 @@
+{% extends "skaware" %}
diff --git a/templates/pkg/s6-linux-init b/templates/pkg/s6-linux-init
@@ -0,0 +1,5 @@
+{% extends "skaware" %}
+{%- block extra_deps %}
+#+{{pkg_install_name("execline")}}
+#+{{pkg_install_name("s6")}}
+{%- endblock %}
diff --git a/templates/pkg/s6-linux-utils b/templates/pkg/s6-linux-utils
@@ -0,0 +1 @@
+{% extends "skaware" %}
diff --git a/templates/pkg/s6-networking b/templates/pkg/s6-networking
@@ -0,0 +1,6 @@
+{% extends "skaware" %}
+{%- block extra_deps %}
+#+{{pkg_install_name("execline")}}
+#+{{pkg_install_name("s6")}}
+#+{{pkg_install_name("s6-dns")}}
+{%- endblock %}
diff --git a/templates/pkg/s6-portable-utils b/templates/pkg/s6-portable-utils
@@ -0,0 +1 @@
+{% extends "skaware" %}
diff --git a/templates/pkg/s6-rc b/templates/pkg/s6-rc
@@ -0,0 +1,5 @@
+{% extends "skaware" %}
+{%- block extra_deps %}
+#+{{pkg_install_name("execline")}}
+#+{{pkg_install_name("s6")}}
+{%- endblock %}
diff --git a/templates/skaware b/templates/skaware
@@ -0,0 +1,42 @@
+{% extends "genlinks" %}
+{%- block script %}
+#+*
+#+{{pkg_install_name("musl-cross-make")}}
+#+{{pkg_install_name("gnu-make")}}
+#+{{pkg_install_name("busybox")}}
+#+{{pkg_install_name("skalibs")}}
+{%- block extra_deps %}
+{%- endblock %}
+#@git:{{submodule.current[name]}}:{{name}}
+
+: ${JOBS:=1}
+{#
+#export CC="$pthbs_build_environment/command/{{triplet}}-gcc"
+#export CXX="$pthbs_build_environment/command/{{triplet}}-g++"
+#export LD="$pthbs_build_environment/command/{{triplet}}-ld"
+#export AR="$pthbs_build_environment/command/{{triplet}}-ar"
+export LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so"
+export CPATH="$pthbs_build_environment/include"
+#}
+prefix={{versions}}/$pthbs_package
+cd '{{name}}'
+{#
+# --libdir=DIR static library files [PREFIX/lib/$package]
+# --sysdepdir="${prefix}/sysdeps" \
+# --includedir="${prefix}/include" \
+#}
+./configure \
+ --prefix="$prefix" \
+ --dynlibdir="${prefix}/library.so" \
+ --bindir="${prefix}/command" \
+ --libdir="${prefix}/library" \
+ --shebangdir="${prefix}/command" \
+ --with-sysdeps='{{pkg_install_dir("skalibs")}}/sysdeps' \
+ --with-include="$pthbs_build_environment/include" \
+ --with-lib="$pthbs_build_environment/library" \
+ --with-dynlib="$pthbs_build_environment/library.so" \
+ --disable-shared --enable-static --enable-allstatic --enable-static-libc --absolute-paths
+
+{{make}}
+make DESTDIR="$pthbs_destdir" install
+{% endblock %}
diff --git a/vars.yaml b/vars.yaml
@@ -2,3 +2,5 @@ shebang: "#!/usr/bin/env pthbs-build"
triplet: x86_64-linux-musl
versions: /home/ccx/versions
make: "make -j${JOBS:-1} -l$((1+${JOBS:-1}))"
+#etc_dir: /home/ccx/.local/etc
+var_dir: /home/ccx/.local/var