mrrl

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

error-standalone (2252B)


      1 #!/usr/bin/env pthbs-build
      2 #+musl-cross-make.98979eb41109d371f19d0637d51116db18c7aeef61fbf804a68094c22a302a78
      3 #+gnu-make.ba8d7c64a23885182fc1c9dc0331d52adcdbc45df6000fb81e8e1dd3ee05694b
      4 #+busybox.ee3440974794767b833fd3299226771f170d3f8601cf225cb884f0a513db8ab3
      5 #+busybox-diffutils.c2ebcfcad050ad71b8e30322a463b5c009f254c7a42e95c627d32665e17134dc
      6 #@untar:-z:sha256:0e751989cea94e25d5166a6a1ed9bde218786e39dff82e1f01dff12fc78639d9:.
      7 
      8 build_env_static() {
      9 	export LD_LIBRARY_PATH="$pthbs_build_environment/library"
     10 	export CPATH="$pthbs_build_environment/include"
     11 	export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS"
     12 }
     13 prefix=/home/ccx/versions/$pthbs_package
     14 build_env_static
     15 cd error-standalone-2.0
     16 make -j${JOBS:-1} -l$((1+${JOBS:-1})) PREFIX=/home/ccx/versions/$pthbs_package \
     17 	DESTDIR="$pthbs_destdir" \
     18 	INCDIR="$prefix/include" \
     19 	LIBDIR="$prefix/library" \
     20 	install-static
     21 
     22 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     23 find -type d -o -print | awk -F/ '
     24 BEGIN {
     25 	x["./library/liberror.a"]=1
     26 	x["./include/error.h"]=1
     27 }
     28 
     29 function r1(s) {
     30 	sub("^[.]/[^/]*", ".", s)
     31 	return s
     32 }
     33 function s1(repl, s) {
     34 	sub("^[.]/[^/]*", "./"repl, s)
     35 	return s
     36 }
     37 function link(src) {
     38 	x[$0]=0
     39 	printf "%s\t%s\n", $0, src
     40 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     41 }
     42 $1!="."{exit 1}
     43 
     44 
     45 $2 == "command" { link($0); next }
     46 $2 == "bin" { link(s1("command", $0)); next }
     47 
     48 $2 == "library.so" { link($0); next }
     49 $2 == "library" { link($0); next }
     50 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     51 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     52 
     53 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     54 
     55 $2 == "man" { link($0); next }
     56 $2 == "info" { link($0); next }
     57 $2 == "doc" { link($0); next }
     58 $2 == "icons" { link($0); next }
     59 $2 == "terminfo" { link($0); next }
     60 $2 == "data" { link($0); next }
     61 $2 == "include" { link($0); next }
     62 
     63 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     64 
     65 END {
     66 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     67 	for(fname in x) {
     68 		if(x[fname]) {
     69 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     70 			exit 3
     71 		}
     72 	}
     73 }' >.install-links.new
     74 mv .install-links.new .install-links