mrrl

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

skalibs (2686B)


      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 #@git:96b537f42695da1b865588baf591fdfcae76bd41:skalibs
      8 
      9 
     10 # - build script start -
     11 
     12 prefix=/home/ccx/versions/$pthbs_package
     13 dest=${pthbs_destdir%/}${prefix}
     14 cd 'skalibs'
     15 
     16 export CC="$pthbs_build_environment/command/x86_64-linux-musl-gcc"
     17 export CXX="$pthbs_build_environment/command/x86_64-linux-musl-g++"
     18 export LD="$pthbs_build_environment/command/x86_64-linux-musl-ld"
     19 export AR="$pthbs_build_environment/command/x86_64-linux-musl-ar"
     20 export CFLAGS="-O2 -ggdb"
     21 
     22 ./configure \
     23 	--prefix="$prefix" \
     24 	--sysdepdir="${prefix}/sysdeps" \
     25 	--binprefix="${prefix}/command" \
     26 	--extbinprefix="${prefix}/command" \
     27 	--dynlibdir="${prefix}/library.so" \
     28 	--libdir="${prefix}/library" \
     29 	--includedir="${prefix}/include" \
     30 	--disable-shared --enable-static
     31 
     32 make -j${JOBS:-1} -l$((1+${JOBS:-1}))
     33 
     34 make DESTDIR="$pthbs_destdir" install
     35 
     36 
     37 
     38 
     39 
     40 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     41 find -type d -o -print | awk -F/ '
     42 BEGIN {
     43 }
     44 
     45 function r1(s) {
     46 	sub("^[.]/[^/]*", ".", s)
     47 	return s
     48 }
     49 function s1(repl, s) {
     50 	sub("^[.]/[^/]*", "./"repl, s)
     51 	return s
     52 }
     53 function link(src) {
     54 	x[$0]=0
     55 	printf "%s\t%s\n", $0, src
     56 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     57 }
     58 $1!="."{exit 1}
     59 
     60 
     61 $2 == "config" { link($0); next }
     62 $2 == "keys" { link($0); next }
     63 $2 == "zsh" { link($0); next }
     64 $2 == "env" { link($0); next }
     65 $2 == "command" { link($0); next }
     66 $2 == "bin" { link(s1("command", $0)); next }
     67 
     68 $2 == "library.so" { link($0); next }
     69 $2 == "library" { link($0); next }
     70 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     71 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
     72 
     73 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     74 
     75 $2 == "man" { link($0); next }
     76 $2 == "info" { link($0); next }
     77 $2 == "doc" { link($0); next }
     78 $2 == "icons" { link($0); next }
     79 $2 == "terminfo" { link($0); next }
     80 $2 == "data" { link($0); next }
     81 $2 == "include" { link($0); next }
     82 
     83 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     84 
     85 END {
     86 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     87 	for(fname in x) {
     88 		if(x[fname]) {
     89 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     90 			exit 3
     91 		}
     92 	}
     93 }' >.install-links.new
     94 mv .install-links.new .install-links
     95