mrrl

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

execline (2937B)


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