pthbs

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

commit f84e8b2fe6baa79696afd2a43da7d596bdb7ca85
parent 99343c852a317bc8be059aa13c5323ae1eed8f52
Author: Jan Pobříslo <ccx@te2000.cz>
Date:   Thu, 22 Feb 2024 16:45:44 +0100

Add package for git

Diffstat:
Mdownloadlist.sha256 | 1+
Mpackages/default.environment | 1+
Apackages/git | 151++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpackages/userspace.environment | 5+++--
Atemplates/pkg/git | 44++++++++++++++++++++++++++++++++++++++++++++
Mtemplates/pkg/userspace.environment | 1+
6 files changed, 201 insertions(+), 2 deletions(-)

diff --git a/downloadlist.sha256 b/downloadlist.sha256 @@ -32,3 +32,4 @@ ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd 783756 https:// 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 +f612c1abc63557d50ad3849863fc9109670139fc9901e574460ec76e0511adb9 7388636 http://cdn.kernel.org/pub/software/scm/git/git-2.43.2.tar.xz diff --git a/packages/default.environment b/packages/default.environment @@ -25,6 +25,7 @@ #+logincaps.8e9f7e96eef8efbff3010abce4a360be2ab9c8675e2f90aaf4375bebf32e16f3 #+snaprep.9fc58ee4729913adada7f715d37f7af5b6ef324f46e73b27ea939323b83c5a46 #+curl.89817d84a4bbdf318a33f048c405c15e9d09f10cb34ce3429ca30a5193ef936d +#+git.7ef800d7867e524d853f98065a259dc2103b134c0e72383b1707939289e64196 #+linux.c21eb54792cc5b7c4df9de554a3c4b1bd6f15cf18764d359b9dafaa017d6d863 #+core-system-conf.ee44833f65709792d6a577809e1b59b2d21c647b8a9c34ca560c351bea6ddc85 #+core-system-rc.d1343a44b2baa7d2732a7de0df109009c04d81dbe6d22964887f5af83598179c diff --git a/packages/git b/packages/git @@ -0,0 +1,151 @@ +#!/usr/bin/env pthbs-build +#+musl-cross-make.6377e568aa49eae6525f0f5ed4a7d2505704941ef74850d2f208da7b12c7865d +#+gnu-make.1d42a93ec73db6119517d6554dbd49317209dc527295acb4ea8e804be913b9a3 +#+busybox.a41e637082cdc82c38a093db7af3615cc2f417a0e8034f7a7ba88d64e852e101 +#+busybox-diffutils.28aa9a4a515da839eaf2e9873bccf363e8eb4829bff3307d2f000204690dfc82 +#+m4.b4d536e5f08f9c11575bfc61d943c9714bc556ed473eedb0520288720ff13871 +#+libressl.a087ee244e4ac7ad15304e99e603fa31a783a58b671a7ce6add769036c525298 +#+curl.89817d84a4bbdf318a33f048c405c15e9d09f10cb34ce3429ca30a5193ef936d +#@untar:-J:sha256:f612c1abc63557d50ad3849863fc9109670139fc9901e574460ec76e0511adb9:. + +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/git" \ + --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 +} + + + +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 +} + +prefix=/home/ccx/versions/$pthbs_package + +make -j${JOBS:-1} -l$((1+${JOBS:-1})) \ + LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so" + CPATH="$pthbs_build_environment/include" \ + LDFLAGS="-static --static -L$pthbs_build_environment/library" \ + CPPFLAGS="-D_GNU_SOURCE" \ + NO_REGEX=NeedsStartEnd \ + NO_TCLTK=1 NO_PYTHON=1 NO_EXPAT=1 NO_GETTEXT=1 \ + DESTDIR="$pthbs_destdir" \ + prefix="$prefix" \ + gitexecdir="$prefix"/git-core \ + V=1 all install + +check_static command/git + + + +cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" +find -type d -o -print | awk -F/ ' +BEGIN { + x["./command/git"]=1 + x["./command/git-upload-archive"]=1 + x["./command/git-receive-pack"]=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/userspace.environment b/packages/userspace.environment @@ -24,4 +24,5 @@ #+fileset.f6f04ce01f2f3903f917b62be00ae696e8692478b44f946528379ebbb426eea0 #+logincaps.8e9f7e96eef8efbff3010abce4a360be2ab9c8675e2f90aaf4375bebf32e16f3 #+snaprep.9fc58ee4729913adada7f715d37f7af5b6ef324f46e73b27ea939323b83c5a46 -#+curl.89817d84a4bbdf318a33f048c405c15e9d09f10cb34ce3429ca30a5193ef936d- \ No newline at end of file +#+curl.89817d84a4bbdf318a33f048c405c15e9d09f10cb34ce3429ca30a5193ef936d +#+git.7ef800d7867e524d853f98065a259dc2103b134c0e72383b1707939289e64196+ \ No newline at end of file diff --git a/templates/pkg/git b/templates/pkg/git @@ -0,0 +1,44 @@ +{% extends "autotools" %} +{%- block extra_deps %} +#+{{pkg_install_name("libressl")}} +#+{{pkg_install_name("curl")}} +#@untar:-J:sha256:f612c1abc63557d50ad3849863fc9109670139fc9901e574460ec76e0511adb9:. +{%- endblock %} +{% block at_script %} + +check_static() { + local exe || true + exe=$pthbs_destdir/'{{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 +} + +prefix={{versions}}/$pthbs_package + +{{make}} \ + LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so" + CPATH="$pthbs_build_environment/include" \ + LDFLAGS="-static --static -L$pthbs_build_environment/library" \ + CPPFLAGS="-D_GNU_SOURCE" \ + NO_REGEX=NeedsStartEnd \ + NO_TCLTK=1 NO_PYTHON=1 NO_EXPAT=1 NO_GETTEXT=1 \ + DESTDIR="$pthbs_destdir" \ + prefix="$prefix" \ + gitexecdir="$prefix"/git-core \ + V=1 all install + +check_static command/git + +{% endblock %} +{% block genlinks_begin %} + x["./command/git"]=1 + x["./command/git-upload-archive"]=1 + x["./command/git-receive-pack"]=1 +{% endblock %} diff --git a/templates/pkg/userspace.environment b/templates/pkg/userspace.environment @@ -25,3 +25,4 @@ #+{{pkg_install_name("logincaps")}} #+{{pkg_install_name("snaprep")}} #+{{pkg_install_name("curl")}} +#+{{pkg_install_name("git")}}