mrrl

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

execline (2616B)


      1 #!/usr/bin/env pthbs-build
      2 #+musl-cross-make.675bc960d97b88b341ba4c64ea1b10f6afd9c9f0394ed84ca848768c5e1b646c
      3 #+gnu-make.152d99fd58e3130b4bd4d23833643ca418555a0560e88962cd8a28ffcd9a9ab7
      4 #+busybox.7818e9d6df97d97317c8fcdf404811731aa0c5c3ab7eb6aec00c9652b6da511c
      5 #+skalibs.bea01bef48eb94cd6525a785479cbbbe7a203cd941e277a5e3b8d494d8dbf1cd
      6 #@git:fc71ed0e88d4ef910b504a96172bcc4a604aca8e:execline
      7 
      8 : ${JOBS:=1}
      9 prefix=/versions/$pthbs_package
     10 cd 'execline'
     11 ./configure  \
     12 	--prefix="$prefix" \
     13 	--dynlibdir="${prefix}/library.so" \
     14 	--bindir="${prefix}/command" \
     15 	--libdir="${prefix}/library" \
     16 	--shebangdir="${prefix}/command" \
     17 	--with-sysdeps='/versions/skalibs.bea01bef48eb94cd6525a785479cbbbe7a203cd941e277a5e3b8d494d8dbf1cd/sysdeps' \
     18 	--with-include="$pthbs_build_environment/include" \
     19 	--with-lib="$pthbs_build_environment/library" \
     20 	--with-dynlib="$pthbs_build_environment/library.so" \
     21 	--disable-shared --enable-static --enable-allstatic --enable-static-libc --absolute-paths
     22 
     23 make -j${JOBS:-1} -l$((1+${JOBS:-1}))
     24 make DESTDIR="$pthbs_destdir" install
     25 if ! test -e "${pthbs_destdir%/}$prefix/command/eltest"; then
     26     # TODO
     27     printf '%s\n' >"${pthbs_destdir%/}$prefix/command/eltest" \
     28         "#!$prefix/command/execlineb -S0" \
     29         's6-test $@'
     30     chmod +x "${pthbs_destdir%/}$prefix/command/eltest"
     31 fi
     32 
     33 cd "$pthbs_destdir/versions/$pthbs_package"
     34 find -type d -o -print | awk -F/ '
     35 BEGIN {
     36 }
     37 
     38 function r1(s) {
     39 	sub("^[.]/[^/]*", ".", s)
     40 	return s
     41 }
     42 function s1(repl, s) {
     43 	sub("^[.]/[^/]*", "./"repl, s)
     44 	return s
     45 }
     46 function link(src) {
     47 	x[$0]=0
     48 	printf "%s\t%s\n", $0, src
     49 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     50 }
     51 $1!="."{exit 1}
     52 
     53 
     54 $2 == "command" { link($0); next }
     55 $2 == "bin" { link(s1("command", $0)); next }
     56 
     57 $2 == "library.so" { link($0); next }
     58 $2 == "library" { link($0); next }
     59 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     60 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     61 
     62 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     63 
     64 $2 == "man" { link($0); next }
     65 $2 == "info" { link($0); next }
     66 $2 == "doc" { link($0); next }
     67 $2 == "icons" { link($0); next }
     68 $2 == "terminfo" { link($0); next }
     69 $2 == "data" { link($0); next }
     70 $2 == "include" { link($0); next }
     71 
     72 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     73 
     74 END {
     75 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     76 	for(fname in x) {
     77 		if(x[fname]) {
     78 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     79 			exit 3
     80 		}
     81 	}
     82 }' >.install-links.new
     83 mv .install-links.new .install-links