ocaml-stdlib-shims (2847B)
1 #!/usr/bin/env pthbs-build 2 #+busybox.539513a18a06a21e4660004fea30f3658959c5c7f54488b66b5fee7120b0c27c 3 #+busybox-findutils.3ba95afbbde5f39d6a3c0b17d82ff2e5350904cf19dd40acdf1c60ed126d3bda 4 #+busybox-awk.4ac003d165540d0084cd08c1386f136343851ef344ac5ff844769b058049d859 5 #+busybox-diffutils.b820ef7a40bea977a2bf740425ae15b2d9a21097bcf3a2f5ec77c21782b9deb8 6 #+musl-cross-make.ef7f483eefcad5b8f2d6c8329e61a0acaca7864b88e9521cb839392c62f45676 7 #+ocaml.4ba185dd68257d664e10ef27e557636e8abb7a415a49a8137175a33e7b7ccf7d 8 #+dune.0bf65718bc1e5a3abfdf3b4104edc05e8902dfe2c665bbe2f24375f031b692c9 9 #@untar:-j:sha256:babf72d3917b86f707885f0c5528e36c63fccb698f4b46cf2bab5c7ccdd6d84a:. 10 11 12 # - build script start - 13 14 prefix=/versions/$pthbs_package 15 dest=${pthbs_destdir%/}${prefix} 16 cd 'stdlib-shims-0.3.0' 17 18 19 export DUNE_CACHE=disabled 20 21 22 23 dune build --no-buffer --verbose --release -j "${JOBS:-1}" 24 25 26 dune install \ 27 --destdir="$pthbs_destdir" \ 28 --prefix="$prefix" \ 29 --libdir="$prefix/library.ocaml" \ 30 --bindir="$prefix/command" \ 31 --sbindir="$prefix/command" \ 32 --etcdir="$prefix/config/etc" \ 33 --mandir="$prefix/man" \ 34 --docdir="$prefix/doc/ocaml-stdlib-shims" \ 35 --datadir="$prefix/data" \ 36 37 38 39 40 dune runtest --build-dir=.testenv --no-buffer --verbose 41 42 43 44 cd "$pthbs_destdir/versions/$pthbs_package" 45 find -type d -o -print | awk -F/ ' 46 BEGIN { 47 x["./library.ocaml/stdlib-shims/META"]=1 48 x["./library.ocaml/stdlib-shims/stdlib_shims.cma"]=1 49 x["./library.ocaml/stdlib-shims/stdlib_shims.cmxa"]=1 50 } 51 52 function r1(s) { 53 sub("^[.]/[^/]*", ".", s) 54 return s 55 } 56 function s1(repl, s) { 57 sub("^[.]/[^/]*", "./"repl, s) 58 return s 59 } 60 function link(src) { 61 x[$0]=0 62 printf "%s\t%s\n", $0, src 63 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 64 } 65 $1!="."{exit 1} 66 67 68 $2 == "library.ocaml" { link($0); next } 69 70 $2 == "config" { link($0); next } 71 $2 == "keys" { link($0); next } 72 $2 == "zsh" { link($0); next } 73 $2 == "env" { link($0); next } 74 $2 == "command" { link($0); next } 75 $2 == "bin" { link(s1("command", $0)); next } 76 77 $2 == "library.so" { link($0); next } 78 $2 == "library" { link($0); next } 79 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 80 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 81 82 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 83 84 $2 == "man" { link($0); next } 85 $2 == "info" { link($0); next } 86 $2 == "doc" { link($0); next } 87 $2 == "icons" { link($0); next } 88 $2 == "terminfo" { link($0); next } 89 $2 == "data" { link($0); next } 90 $2 == "include" { link($0); next } 91 92 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 93 94 END { 95 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 96 for(fname in x) { 97 if(x[fname]) { 98 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 99 exit 3 100 } 101 } 102 }' >.install-links.new 103 mv .install-links.new .install-links 104