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