mrrl

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

git (3059B)


      1 #!/usr/bin/env pthbs-build
      2 #+musl-cross-make.98979eb41109d371f19d0637d51116db18c7aeef61fbf804a68094c22a302a78
      3 #+gnu-make.ba8d7c64a23885182fc1c9dc0331d52adcdbc45df6000fb81e8e1dd3ee05694b
      4 #+busybox.ee3440974794767b833fd3299226771f170d3f8601cf225cb884f0a513db8ab3
      5 #+busybox-diffutils.c2ebcfcad050ad71b8e30322a463b5c009f254c7a42e95c627d32665e17134dc
      6 #+m4.46e121f61e0af52abf876bf2688ecfe70eeb04185028d6adde0085e865fdfe75
      7 #+libressl.633500bb0c83790bc40476a011548bd124f73c708cd70ea1988c192fd90a8dad
      8 #+curl.992057c4266e8a94e1f331944e0b16ddf8b96d8d45da0532587b6123aab2316e
      9 #@untar:-J:sha256:f612c1abc63557d50ad3849863fc9109670139fc9901e574460ec76e0511adb9:.
     10 
     11 check_static() {
     12 	local exe || true
     13 	exe=$pthbs_destdir/'/home/ccx/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=/home/ccx/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/home/ccx/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