mrrl

Minimal Reliable Reproducible Linux
git clone https://ccx.te2000.cz/git/mrrl
Log | Files | Refs | Submodules | README

commit 478bf278864f895f6fe551c0c9dce47aa06e0378
parent 1f6dbb5a460e28db9460e3684be072c9527fe478
Author: Jan Pobříslo <ccx@te2000.cz>
Date:   Thu, 22 Feb 2024 15:03:07 +0100

Add curl

Diffstat:
MREADME | 1-
Mdownloadlist.sha256 | 1+
Apackages/curl | 130+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpackages/default.environment | 1+
Mpackages/userspace.environment | 5+++--
Atemplates/pkg/curl | 23+++++++++++++++++++++++
Mtemplates/pkg/userspace.environment | 1+
7 files changed, 159 insertions(+), 3 deletions(-)

diff --git a/README b/README @@ -131,7 +131,6 @@ Work in progress * versioned system configuration including init * rsync * add acl and xattr support - * possibly libretls or xxhash for faster hashes * linux * build fully-featured kernel for real hardware * libelf diff --git a/downloadlist.sha256 b/downloadlist.sha256 @@ -31,3 +31,4 @@ ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd 783756 https:// 9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5 3332400 https://sourceforge.net/projects/zsh/files/zsh/5.9/zsh-5.9.tar.xz d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b 80888824 https://ftpmirror.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz 6d4b8d5bbb25a1f8336639e56ec5088052d43a95256697a85c4ce91323c25954 4473978 http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.8.2.tar.gz +3ccd55d91af9516539df80625f818c734dc6f2ecf9bada33c76765e99121db15 2630108 https://curl.haxx.se/download/curl-8.6.0.tar.xz diff --git a/packages/curl b/packages/curl @@ -0,0 +1,130 @@ +#!/usr/bin/env pthbs-build +#+musl-cross-make.6377e568aa49eae6525f0f5ed4a7d2505704941ef74850d2f208da7b12c7865d +#+gnu-make.1d42a93ec73db6119517d6554dbd49317209dc527295acb4ea8e804be913b9a3 +#+busybox.a41e637082cdc82c38a093db7af3615cc2f417a0e8034f7a7ba88d64e852e101 +#+busybox-diffutils.28aa9a4a515da839eaf2e9873bccf363e8eb4829bff3307d2f000204690dfc82 +#+m4.b4d536e5f08f9c11575bfc61d943c9714bc556ed473eedb0520288720ff13871 +#@untar:-z:sha256::. + +autotools() { + cd "$1" + shift + export LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so" + export CPATH="$pthbs_build_environment/include" + export CFLAGS="-L$pthbs_build_environment/library -D_GNU_SOURCE $CFLAGS" + prefix=/home/ccx/versions/$pthbs_package + ./configure -C \ + --prefix="$prefix" \ + --build="$(${CC:-gcc} -dumpmachine)" \ + --bindir="$prefix/command" \ + --sbindir="$prefix/command" \ + --infodir="$prefix/info" \ + --localedir="$prefix/locale" \ + --mandir="$prefix/man" \ + --libdir="$prefix/library" \ + --docdir="$prefix/doc/curl" \ + --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_static() { + export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" + autotools "$@" --enable-static --disable-shared +} + +check_static() { + local exe || true + exe=$pthbs_destdir/'/home/ccx/versions'/$pthbs_package/$1 + if ! test -f $exe; then + printf '%s\n' "Error: file '$1' doesn't exist!" + exit 1 + fi + interp_info=$(readelf --string-dump=.interp "$exe") || exit $? + if test x '!=' "x$interp_info"; then + printf '%s\n' "Error: '$1' is a dynamic binary!" + exit 1 + fi +} + + + +autotools_static curl-8.6.0 --disable-nls \ + --enable-ipv6 \ + --enable-unix-sockets \ + --enable-static \ + --with-openssl \ + --disable-ldap \ + --enable-websockets \ + --without-libssh2 +check_static command/curl + +make -C curl-8.6.0/tests + + + +cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" +find -type d -o -print | awk -F/ ' +BEGIN { + x["./command/curl"]=1 + x["./library/libcurla"]=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 + printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" +} +$1!="."{exit 1} + + +$2 == "command" { link($0); next } +$2 == "bin" { link(s1("command", $0)); next } + +$2 == "library.so" { link($0); next } +$2 == "library" { link($0); next } +$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } +$2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next } + +$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } + +$2 == "man" { link($0); next } +$2 == "info" { link($0); next } +$2 == "doc" { link($0); next } +$2 == "icons" { link($0); next } +$2 == "terminfo" { link($0); next } + +$2 == "include" { link($0); next } + +{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } + +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/default.environment b/packages/default.environment @@ -24,6 +24,7 @@ #+fileset.f6f04ce01f2f3903f917b62be00ae696e8692478b44f946528379ebbb426eea0 #+logincaps.8e9f7e96eef8efbff3010abce4a360be2ab9c8675e2f90aaf4375bebf32e16f3 #+snaprep.9fc58ee4729913adada7f715d37f7af5b6ef324f46e73b27ea939323b83c5a46 +#+curl.a2eb053342c35cca18ecf493eb520b21847b7eae2ba4cce0325df2a65404c9bb #+linux.c21eb54792cc5b7c4df9de554a3c4b1bd6f15cf18764d359b9dafaa017d6d863 #+core-system-conf.ee44833f65709792d6a577809e1b59b2d21c647b8a9c34ca560c351bea6ddc85 #+core-system-rc.d1343a44b2baa7d2732a7de0df109009c04d81dbe6d22964887f5af83598179c diff --git a/packages/userspace.environment b/packages/userspace.environment @@ -23,4 +23,5 @@ #+containers.4ab3e9e798fbdc13aeb84ff63edf12809cec8b239742247d703e44930969da26 #+fileset.f6f04ce01f2f3903f917b62be00ae696e8692478b44f946528379ebbb426eea0 #+logincaps.8e9f7e96eef8efbff3010abce4a360be2ab9c8675e2f90aaf4375bebf32e16f3 -#+snaprep.9fc58ee4729913adada7f715d37f7af5b6ef324f46e73b27ea939323b83c5a46- \ No newline at end of file +#+snaprep.9fc58ee4729913adada7f715d37f7af5b6ef324f46e73b27ea939323b83c5a46 +#+curl.a2eb053342c35cca18ecf493eb520b21847b7eae2ba4cce0325df2a65404c9bb+ \ No newline at end of file diff --git a/templates/pkg/curl b/templates/pkg/curl @@ -0,0 +1,23 @@ +{% extends "autotools" %} +{%- block extra_deps %} +#@untar:-z:sha256::. +{%- endblock %} +{% block at_script %} + +autotools_static curl-8.6.0 --disable-nls \ + --enable-ipv6 \ + --enable-unix-sockets \ + --enable-static \ + --with-openssl \ + --disable-ldap \ + --enable-websockets \ + --without-libssh2 +check_static command/curl + +make -C curl-8.6.0/tests + +{% endblock %} +{% block genlinks_begin %} + x["./command/curl"]=1 + x["./library/libcurla"]=1 +{% endblock %} diff --git a/templates/pkg/userspace.environment b/templates/pkg/userspace.environment @@ -24,3 +24,4 @@ #+{{pkg_install_name("fileset")}} #+{{pkg_install_name("logincaps")}} #+{{pkg_install_name("snaprep")}} +#+{{pkg_install_name("curl")}}