mrrl

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

squashfs-tools (3530B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.d2d7aa00eac6ec561a10d126b1866f22e226a1276307466251e80fd8a4a1ebc7
      3 #+busybox-findutils.85b2328981df683d1ae7597eebdf3a332aa4241b936c0030fe3618cec1f4841a
      4 #+busybox-awk.4c3f8cc249ba35f1206fcaf2979bcfd66d09b117eeea4e6a939024825a542496
      5 #+busybox-diffutils.24775f761d337796ffe81623350e4bf2f039067f593411146bfeb9c80567d182
      6 #+musl-cross-make.e4735d8572f9b6654a7381ebdfbd62e665d1d1da5e06a56923e89274cc6a510f
      7 #+gnu-make.75a726f6c19f7bc10b95a84da3ce72fb785ebdf587504430c6b74cfb6610b728
      8 #+attr.46baa596555f06cb46fe11ba335ef72ce62da80f0c62814e3c9956bc27ea500f
      9 #+zstd.9736e321b1b8e6549f338d427549f01301473de674823230efeaeb274d899796
     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'/home/ccx/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=/home/ccx/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/home/ccx/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