mrrl

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

git (3032B)


      1 #!/usr/bin/env pthbs-build
      2 #+musl-cross-make.d0431fc0def788be03da43136972361827de52c8e6f0a6f3890dc57fe32e8ecc
      3 #+gnu-make.444e811a68f4f16724e21354b710fad3592e53a2dbf7c0c78658f3d4e7c8e465
      4 #+busybox.f4ef3d511c029095beda8d21dd48f7730bec63fb09792ca951402d6620338089
      5 #+busybox-diffutils.4a0933977737282afcd82b39d435b50946a700fe13472d24e4580a41fa852123
      6 #+m4.3cffaef6909a65493ddc9aba4c53f77dc594ff5ab8b58c57acaa34c654b09ff3
      7 #+libressl.a4cd21faaf27a6507f54f2b1254a95643eab1b19b22b162083d4547efdbe50a4
      8 #+curl.21ad0cb79fe4506199334186bf7ab7f83815f77114417dd3b8075a87e9d5f3bf
      9 #@untar:-J:sha256:f612c1abc63557d50ad3849863fc9109670139fc9901e574460ec76e0511adb9:.
     10 
     11 check_static() {
     12 	local exe || true
     13 	exe=$pthbs_destdir/'/versions'/$pthbs_package/$1
     14 	if ! test -f $exe; then
     15 		printf '%s\n' "Error: file '$1' doesn't exist!"
     16 		exit 1
     17 	fi
     18 	interp_info=$(readelf --string-dump=.interp "$exe") || exit $?
     19 	if test x '!=' "x$interp_info"; then
     20 		printf '%s\n' "Error: '$1' is a dynamic binary!"
     21 		exit 1
     22 	fi
     23 }
     24 
     25 prefix=/versions/$pthbs_package
     26 
     27 make -j${JOBS:-1} -l$((1+${JOBS:-1})) -C ./git-2.43.2 \
     28 	LD_LIBRARY_PATH="$pthbs_build_environment/library:$pthbs_build_environment/library.so" \
     29 	CPATH="$pthbs_build_environment/include" \
     30 	LDFLAGS="-static --static -L$pthbs_build_environment/library" \
     31 	CPPFLAGS="-D_GNU_SOURCE" \
     32 	NO_REGEX=NeedsStartEnd \
     33 	NO_TCLTK=1 NO_PYTHON=1 NO_EXPAT=1 NO_GETTEXT=1 \
     34 	DESTDIR="$pthbs_destdir" \
     35 	prefix="$prefix" \
     36 	gitexecdir="$prefix"/git-core \
     37 	bindir="$prefix/command" \
     38 	mandir="$prefix/man" \
     39 	infodir="$prefix/info" \
     40 	sharedir="$prefix/share" \
     41 	gitwebdir="$prefix/gitweb" \
     42 	V=1 all install
     43 
     44 check_static command/git
     45 
     46 
     47 cd "$pthbs_destdir/versions/$pthbs_package"
     48 find -type d -o -print | awk -F/ '
     49 BEGIN {
     50 	x["./command/git"]=1
     51 	x["./command/git-upload-archive"]=1
     52 	x["./command/git-receive-pack"]=1
     53 }
     54 
     55 function r1(s) {
     56 	sub("^[.]/[^/]*", ".", s)
     57 	return s
     58 }
     59 function s1(repl, s) {
     60 	sub("^[.]/[^/]*", "./"repl, s)
     61 	return s
     62 }
     63 function link(src) {
     64 	x[$0]=0
     65 	printf "%s\t%s\n", $0, src
     66 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     67 }
     68 $1!="."{exit 1}
     69 
     70 
     71 $2 == "command" { link($0); next }
     72 $2 == "bin" { link(s1("command", $0)); next }
     73 
     74 $2 == "library.so" { link($0); next }
     75 $2 == "library" { link($0); next }
     76 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     77 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     78 
     79 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     80 
     81 $2 == "man" { link($0); next }
     82 $2 == "info" { link($0); next }
     83 $2 == "doc" { link($0); next }
     84 $2 == "icons" { link($0); next }
     85 $2 == "terminfo" { link($0); next }
     86 $2 == "data" { link($0); next }
     87 $2 == "include" { link($0); next }
     88 
     89 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     90 
     91 END {
     92 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     93 	for(fname in x) {
     94 		if(x[fname]) {
     95 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     96 			exit 3
     97 		}
     98 	}
     99 }' >.install-links.new
    100 mv .install-links.new .install-links