git (3032B)
1 #!/usr/bin/env pthbs-build 2 #+musl-cross-make.675bc960d97b88b341ba4c64ea1b10f6afd9c9f0394ed84ca848768c5e1b646c 3 #+gnu-make.152d99fd58e3130b4bd4d23833643ca418555a0560e88962cd8a28ffcd9a9ab7 4 #+busybox.7818e9d6df97d97317c8fcdf404811731aa0c5c3ab7eb6aec00c9652b6da511c 5 #+busybox-diffutils.3579038707d7520c09339ee4fc3b67ef03caeeaf8fff3b6f93c51ace141a4393 6 #+m4.9943b16e3463f08c59487393409dc10df95173d9d015f907948a44a96e7fd8ee 7 #+libressl.c6f4193f35d146e0af36bfb69d8f4a9be69da9ea0b9cb80b05ddd617ea12cece 8 #+curl.6c0999f7e80abc0e36e422e40cfd5dbbd08c0127561fad8947ab322628c8442a 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