squashfs-tools (3503B)
1 #!/usr/bin/env pthbs-build 2 #+busybox.539513a18a06a21e4660004fea30f3658959c5c7f54488b66b5fee7120b0c27c 3 #+busybox-findutils.3ba95afbbde5f39d6a3c0b17d82ff2e5350904cf19dd40acdf1c60ed126d3bda 4 #+busybox-awk.4ac003d165540d0084cd08c1386f136343851ef344ac5ff844769b058049d859 5 #+busybox-diffutils.b820ef7a40bea977a2bf740425ae15b2d9a21097bcf3a2f5ec77c21782b9deb8 6 #+musl-cross-make.ef7f483eefcad5b8f2d6c8329e61a0acaca7864b88e9521cb839392c62f45676 7 #+gnu-make.6c204d453a2d9b4e29dd7b9f93fc7c5a928284402b8646493cf72004f748753c 8 #+attr.2d680604ab0298e0def243d138924446fa34b27a0fd1c64cf1f5396d3e6c6619 9 #+zstd.bbfd2dca53c37a5aebdd65f7ffb17acdeeca6a6eabea214449e1729754748c25 10 #@untar:-z:sha256:4672b5c47d9418d3a5ae5b243defc6d9eae8275b9771022247c6a6082c815914:. 11 12 13 # - build script start - 14 15 build_env_static() { 16 export LD_LIBRARY_PATH="$pthbs_build_environment/library" 17 export CPATH="$pthbs_build_environment/include" 18 export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS" 19 } 20 21 check_static() { 22 local exe || true 23 exe=$pthbs_destdir'/versions'/$pthbs_package/$1 24 if ! test -f $exe; then 25 printf '%s\n' "Error: file '$1' doesn't exist!" 26 exit 1 27 fi 28 local interp_info || true 29 interp_info=$(readelf --string-dump=.interp "$exe") || exit $? 30 if test x '!=' "x$interp_info"; then 31 printf '%s\n' "Error: '$1' is a dynamic binary!" 32 exit 1 33 fi 34 } 35 36 prefix=/versions/$pthbs_package 37 dest=${pthbs_destdir%/}${prefix} 38 cd 'squashfs-tools-4.7.2' 39 40 41 42 build_env_static 43 m() { 44 make -j${JOBS:-1} -l$((1+${JOBS:-1})) -C squashfs-tools \ 45 GZIP_SUPPORT=1 \ 46 XZ_SUPPORT=0 \ 47 LZO_SUPPORT=0 \ 48 LZ4_SUPPORT=0 \ 49 ZSTD_SUPPORT=1 \ 50 COMP_DEFAULT=zstd \ 51 XATTR_SUPPORT=1 \ 52 XATTR_OS_SUPPORT=1 \ 53 XATTR_DEFAULT=1 \ 54 USE_PREBUILT_MANPAGES=y \ 55 INSTALL_PREFIX="$prefix" \ 56 INSTALL_DIR="$dest/command" \ 57 INSTALL_MANPAGES_DIR="$dest/man/man1" \ 58 "$@" 59 } 60 61 m 62 63 # workaround install script demanding unused GNU sed 64 cat >squashfs-tools/generate-manpages/functions.sh <<EOF 65 SED() { 66 exit 100 67 } 68 ECHO=$(which echo) 69 SED=SED 70 EOF 71 m install 72 73 74 75 check_static command/mksquashfs 76 77 78 cd "$pthbs_destdir/versions/$pthbs_package" 79 find -type d -o -print | awk -F/ ' 80 BEGIN { 81 x["./command/mksquashfs"]=1 82 } 83 84 function r1(s) { 85 sub("^[.]/[^/]*", ".", s) 86 return s 87 } 88 function s1(repl, s) { 89 sub("^[.]/[^/]*", "./"repl, s) 90 return s 91 } 92 function link(src) { 93 x[$0]=0 94 printf "%s\t%s\n", $0, src 95 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 96 } 97 $1!="."{exit 1} 98 99 100 $2 == "config" { link($0); next } 101 $2 == "keys" { link($0); next } 102 $2 == "zsh" { link($0); next } 103 $2 == "env" { link($0); next } 104 $2 == "command" { link($0); next } 105 $2 == "bin" { link(s1("command", $0)); next } 106 107 $2 == "library.so" { link($0); next } 108 $2 == "library" { link($0); next } 109 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 110 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 111 112 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 113 114 $2 == "man" { link($0); next } 115 $2 == "info" { link($0); next } 116 $2 == "doc" { link($0); next } 117 $2 == "icons" { link($0); next } 118 $2 == "terminfo" { link($0); next } 119 $2 == "data" { link($0); next } 120 $2 == "include" { link($0); next } 121 122 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 123 124 END { 125 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 126 for(fname in x) { 127 if(x[fname]) { 128 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 129 exit 3 130 } 131 } 132 }' >.install-links.new 133 mv .install-links.new .install-links 134