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.757bcca6771cad3395ae302e0fdc835ebf5b4a965c08e30d758e6149b0bacbcd
      3 #+gnu-make.529116171fecc2bdac7c70e109d28270d765379c8a52cf7c3ea7453195bbf42b
      4 #+busybox.3664b94c09ea6d35ce73985026762c142829e53fed4a38541af3afb00c37dd4a
      5 #+busybox-diffutils.a22698424a7618572314d3da6953bf6652138ec492d3a0d01c37072f74adefc4
      6 #+m4.b78d93922dc9dbf43dd31037c98271490db5d6d1919b69b12122cf55fa1fb515
      7 #+libressl.dc3d77c147487b10dba1c94c97c776418f4c5d798583f17754b647912ff70066
      8 #+curl.e8bb8d9ef43708e68ea60ac3121f6f81bf13c685c1da92dbfaaf2a0abd99a2f9
      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