mrrl

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

opam (3673B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.d2d7aa00eac6ec561a10d126b1866f22e226a1276307466251e80fd8a4a1ebc7
      3 #+busybox-findutils.85b2328981df683d1ae7597eebdf3a332aa4241b936c0030fe3618cec1f4841a
      4 #+busybox-awk.4c3f8cc249ba35f1206fcaf2979bcfd66d09b117eeea4e6a939024825a542496
      5 #+diffutils.156555a911f29226b4808f1cf6a96ba5b0f8f0bc6b0807c8dce0304797940ea5
      6 #+patch.f68185f5f766e7ba981276f806b05c1b549d908db89557d83873e53100c3a74f
      7 #+gnu-make.75a726f6c19f7bc10b95a84da3ce72fb785ebdf587504430c6b74cfb6610b728
      8 #+musl-cross-make.e4735d8572f9b6654a7381ebdfbd62e665d1d1da5e06a56923e89274cc6a510f
      9 #+getconf.89c6e639314e02d4f0d7b559437f00620d0354b4c446cbeb45a03153c4114420
     10 #+ocaml.a604427fdad1fc3adfb39b93cce894b4d525cb8c8d9933a4a7e69f2fa9b3a605
     11 #+dune.01ed63774a01622c91b0c4d36562a7b8fb994ce0a75b1ada7f65fd9d3f5ae531
     12 #@untar:-z:sha256:c4d053029793c714e4e7340b1157428c0f90783585fb17f35158247a640467d9:.
     13 
     14 
     15 # - build script start -
     16 
     17 check_static() {
     18 	local exe || true
     19 	exe=$pthbs_destdir'/home/ccx/versions'/$pthbs_package/$1
     20 	if ! test -f $exe; then
     21 		printf '%s\n' "Error: file '$1' doesn't exist!"
     22 		exit 1
     23 	fi
     24 	local interp_info || true
     25 	interp_info=$(readelf --string-dump=.interp "$exe") || exit $?
     26 	if test x '!=' "x$interp_info"; then
     27 		printf '%s\n' "Error: '$1' is a dynamic binary!"
     28 		exit 1
     29 	fi
     30 }
     31 
     32 prefix=/home/ccx/versions/$pthbs_package
     33 dest=${pthbs_destdir%/}${prefix}
     34 cd 'opam-full-2.4.1'
     35 
     36 
     37 export DUNE_CACHE=disabled
     38 ./configure \
     39 	--prefix="$prefix" \
     40 	--libdir="$prefix/library.ocaml" \
     41 	--bindir="$prefix/command" \
     42 	--sbindir="$prefix/command" \
     43 	--mandir="$prefix/man" \
     44 	--docdir="$prefix/doc/opam" \
     45 	--datadir="$prefix/data" \
     46 	--datarootdir="$prefix/data" \
     47 	--infodir="$prefix/info" \
     48 	--localedir="$prefix/locale" \
     49 	--localstatedir='/var/pthbs' \
     50 	--with-dune='/home/ccx/versions/dune.01ed63774a01622c91b0c4d36562a7b8fb994ce0a75b1ada7f65fd9d3f5ae531/command/dune' \
     51 	--with-mccs \
     52 	--with-vendored-deps \
     53 	--enable-static
     54 
     55 
     56 make DUNE_ARGS=--verbose
     57 make DESTDIR="$pthbs_destdir" install
     58 
     59 
     60 
     61 make tests || true
     62 ## dynamic build
     63 #check_static bin/opam
     64 #check_static bin/opam-installer
     65 "$dest/bin/opam" --version
     66 "$dest/bin/opam-installer" --version
     67 
     68 
     69 
     70 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     71 find -type d -o -print | awk -F/ '
     72 BEGIN {
     73 	x["./bin/opam"]=1
     74 	x["./bin/opam-installer"]=1
     75 }
     76 
     77 function r1(s) {
     78 	sub("^[.]/[^/]*", ".", s)
     79 	return s
     80 }
     81 function s1(repl, s) {
     82 	sub("^[.]/[^/]*", "./"repl, s)
     83 	return s
     84 }
     85 function link(src) {
     86 	x[$0]=0
     87 	printf "%s\t%s\n", $0, src
     88 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     89 }
     90 $1!="."{exit 1}
     91 
     92 
     93 $2 == "library.ocaml" { link($0); next }
     94 
     95 $2 == "config" { link($0); next }
     96 $2 == "keys" { link($0); next }
     97 $2 == "zsh" { link($0); next }
     98 $2 == "env" { link($0); next }
     99 $2 == "command" { link($0); next }
    100 $2 == "bin" { link(s1("command", $0)); next }
    101 
    102 $2 == "library.so" { link($0); next }
    103 $2 == "library" { link($0); next }
    104 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
    105 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
    106 
    107 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
    108 
    109 $2 == "man" { link($0); next }
    110 $2 == "info" { link($0); next }
    111 $2 == "doc" { link($0); next }
    112 $2 == "icons" { link($0); next }
    113 $2 == "terminfo" { link($0); next }
    114 $2 == "data" { link($0); next }
    115 $2 == "include" { link($0); next }
    116 
    117 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
    118 
    119 END {
    120 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
    121 	for(fname in x) {
    122 		if(x[fname]) {
    123 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
    124 			exit 3
    125 		}
    126 	}
    127 }' >.install-links.new
    128 mv .install-links.new .install-links
    129