mrrl

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

commit 41bca093b249b6c2dceb4d66f3059298ceae388c
parent db08eb6e32be0ed87c95f91f9c8e709ff2f0ae83
Author: Jan Pobrislo <ccx@te2000.cz>
Date:   Wed, 22 Oct 2025 04:00:31 +0000

ocaml packages

Diffstat:
Mtemplates/pkg/dune | 11++++++++---
Mtemplates/pkg/ocaml | 6++++--
Atemplates/pkg/ocaml-base | 39+++++++++++++++++++++++++++++++++++++++
Mtemplates/pkg/ocaml-findlib | 3+++
Mtemplates/pkg/ocamlbuild | 4+++-
Atemplates/pkg/opam | 38++++++++++++++++++++++++++++++++++++++
Mtemplates/pkg/wip.environment | 1+
Mvariants/ccx-x86_64/dune | 11+++++++----
Mvariants/ccx-x86_64/ocaml | 4+++-
Avariants/ccx-x86_64/ocaml-base | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvariants/ccx-x86_64/ocaml-findlib | 4+++-
Mvariants/ccx-x86_64/ocamlbuild | 4+++-
Avariants/ccx-x86_64/opam | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvariants/ccx-x86_64/wip.environment | 9+++++----
Mvariants/root-x86_64/dune | 11+++++++----
Mvariants/root-x86_64/ocaml | 4+++-
Avariants/root-x86_64/ocaml-base | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvariants/root-x86_64/ocaml-findlib | 4+++-
Mvariants/root-x86_64/ocamlbuild | 4+++-
Avariants/root-x86_64/opam | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvariants/root-x86_64/wip.environment | 9+++++----
21 files changed, 538 insertions(+), 28 deletions(-)

diff --git a/templates/pkg/dune b/templates/pkg/dune @@ -4,7 +4,7 @@ #+{{pkg_install_name("busybox-diffutils")}} #+{{pkg_install_name("gnu-make")}} #+{{pkg_install_name("ocaml")}} -#@untar:-z:sha256:4e1279ff0ef80c862eaa5207a77020d741e89ef94f0e4a92a37c4188dbf08256:. +#@untar:-z:sha256:579c738f8ca191ba0a9b22dbe78f1377542442c9827cf4939f8964f09f9edb28:. {% endblock %} {%- block prepare %} # This allows 'dune --version' to output the correct version instead of "n/a" @@ -13,10 +13,10 @@ sed -i "/^(name dune)/a (version {{pkg_version}})" dune-project sed -i 's/stdune.csexp/dune-configurator.csexp/' vendor/csexp/src/dune {% endblock %} -{%- block build %} +{%- block configure %} ./configure \ --prefix="$prefix" \ - --libdir="$prefix/library" \ + --libdir="$prefix/library.ocaml" \ --bindir="$prefix/command" \ --sbindir="$prefix/command" \ --etcdir="$prefix/config/etc" \ @@ -28,6 +28,8 @@ sed -i 's/stdune.csexp/dune-configurator.csexp/' vendor/csexp/src/dune --localedir="$prefix/locale" \ --localstatedir='{{var_dir}}' +{% endblock %} +{%- block build %} ocaml boot/bootstrap.ml --verbose ./dune.exe build \ -p dune,dune-configurator \ @@ -48,3 +50,6 @@ check_static command/dune {% block genlinks_begin %} x["./command/dune"]=1 {% endblock %} +{% block genlinks_rules %} +$2 == "library.ocaml" { link($0); next } +{% endblock -%} diff --git a/templates/pkg/ocaml b/templates/pkg/ocaml @@ -1,7 +1,7 @@ {%- set pkg_version="5.4.0" -%} {%- set pkg_source="tar.xz" -%} {% extends "autotools_static" %} -{%- block configure_args %}--enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs{% endblock %} +{%- block configure_args %}--enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs --libdir="$prefix/library.ocaml"{% endblock %} {% block check -%} check_static command/ocamlopt @@ -9,4 +9,6 @@ check_static command/ocamlopt {% block genlinks_begin %} x["./command/ocamlopt"]=1 {% endblock %} - +{% block genlinks_rules %} +$2 == "library.ocaml" { link($0); next } +{% endblock -%} diff --git a/templates/pkg/ocaml-base b/templates/pkg/ocaml-base @@ -0,0 +1,39 @@ +{%- set pkg_version="0.16.3" -%} +{%- set src_dir="base-"+pkg_version -%} +{% extends "genlinks" %} +{% block package_deps -%} +#+{{pkg_install_name("busybox-diffutils")}} +#+{{pkg_install_name("gnu-make")}} +#+{{pkg_install_name("dune")}} +#@untar:-z:{{downloads["base-" + assertion(pkg_version) + ".tar.gz"]}}:. +{% endblock %} +{%- block build %} + dune build --release --verbose + +{% endblock %} +{%- block install %} +dune install \ + --destdir="$pthbs_destdir" \ + --prefix="$prefix" \ + --libdir="$prefix/library.ocaml" \ + --bindir="$prefix/command" \ + --sbindir="$prefix/command" \ + --etcdir="$prefix/config/etc" \ + --mandir="$prefix/man" \ + --docdir="$prefix/doc/{{shortname}}" \ + --datadir="$prefix/data" \ + +{% endblock %} +{% block check -%} +dune runtest --build-dir=.testenv --verbose + +{% endblock %} +{% block genlinks_begin %} + x["./library.ocaml/base/base.ml"]=1 + x["./library.ocaml/base/base.cma"]=1 + x["./library.ocaml/base/base.cmi"]=1 +{% endblock %} +{% block genlinks_rules %} +$2 == "library.ocaml" { link($0); next } +{% endblock -%} + diff --git a/templates/pkg/ocaml-findlib b/templates/pkg/ocaml-findlib @@ -26,3 +26,6 @@ check_static command/ocamlfind {% block genlinks_begin %} x["./command/ocamlfind"]=1 {% endblock %} +{% block genlinks_rules %} +$2 == "library.ocaml" { link($0); next } +{% endblock -%} diff --git a/templates/pkg/ocamlbuild b/templates/pkg/ocamlbuild @@ -23,4 +23,6 @@ check_static command/ocamlbuild {% block genlinks_begin %} x["./command/ocamlbuild"]=1 {% endblock %} - +{% block genlinks_rules %} +$2 == "library.ocaml" { link($0); next } +{% endblock -%} diff --git a/templates/pkg/opam b/templates/pkg/opam @@ -0,0 +1,38 @@ +{%- set pkg_version="2.4.1" -%} +{% extends "genlinks" %} +{% block package_deps -%} +#+{{pkg_install_name("busybox-diffutils")}} +#+{{pkg_install_name("gnu-make")}} +#+{{pkg_install_name("dune")}} +#@untar:-z:{{downloads["opam-full-" + assertion(pkg_version) + ".tar.gz"]}}:. +{% endblock %} +{%- block configure %} +./configure \ + --prefix="$prefix" \ + --libdir="$prefix/library.ocaml" \ + --bindir="$prefix/command" \ + --sbindir="$prefix/command" \ + --etcdir="$prefix/config/etc" \ + --mandir="$prefix/man" \ + --docdir="$prefix/doc/{{shortname}}" \ + --datadir="$prefix/data" \ + --datarootdir="$prefix/data" \ + --infodir="$prefix/info" \ + --localedir="$prefix/locale" \ + --localstatedir='{{var_dir}}' \ + --with-dune='{{pkg_install_dir("dune")}}/command/dune' \ + --with-mccs \ + --with-vendored-deps + +{% endblock %} +{% block check -%} +make tests +check_static command/opam + +{% endblock %} +{% block genlinks_begin %} + x["./command/opam"]=1 +{% endblock %} +{% block genlinks_rules %} +$2 == "library.ocaml" { link($0); next } +{% endblock -%} diff --git a/templates/pkg/wip.environment b/templates/pkg/wip.environment @@ -2,4 +2,5 @@ #+{{pkg_install_name("ocaml")}} #+{{pkg_install_name("dune")}} #+{{pkg_install_name("ocamlbuild")}} +#+{{pkg_install_name("ocaml-base")}} {#- #+{{pkg_install_name("ocaml-findlib")}} #} diff --git a/variants/ccx-x86_64/dune b/variants/ccx-x86_64/dune @@ -4,8 +4,8 @@ #+busybox-awk.5c33e58d30be821f0a1fc8ba082d0a34aaecacad2a1c3a8f25b05cd07b2c6dec #+busybox-diffutils.89043788a08f3d90f6fc1e02d690f6e5eefa88e11c61a1fae5048e457e46eb6f #+gnu-make.8b0f1b53392f1db9019f1d8e7ac20d3d9a58501db09a7ab0b2f81939fb4a81e3 -#+ocaml.d9ce98b461adb90067d52ee35a375a6f2d8accee313da46b28df6fd9df8ce79e -#@untar:-z:sha256:4e1279ff0ef80c862eaa5207a77020d741e89ef94f0e4a92a37c4188dbf08256:. +#+ocaml.5b34db3f087fd067e8cf20c9806c599c52cf1d4564105f3841aa3594496ef578 +#@untar:-z:sha256:579c738f8ca191ba0a9b22dbe78f1377542442c9827cf4939f8964f09f9edb28:. # - build script start - @@ -17,10 +17,9 @@ sed -i 's/stdune.csexp/dune-configurator.csexp/' vendor/csexp/src/dune - ./configure \ --prefix="$prefix" \ - --libdir="$prefix/library" \ + --libdir="$prefix/library.ocaml" \ --bindir="$prefix/command" \ --sbindir="$prefix/command" \ --etcdir="$prefix/config/etc" \ @@ -32,6 +31,8 @@ sed -i 's/stdune.csexp/dune-configurator.csexp/' vendor/csexp/src/dune --localedir="$prefix/locale" \ --localstatedir='/var/pthbs' + + ocaml boot/bootstrap.ml --verbose ./dune.exe build \ -p dune,dune-configurator \ @@ -69,6 +70,8 @@ function link(src) { $1!="."{exit 1} +$2 == "library.ocaml" { link($0); next } + $2 == "config" { link($0); next } $2 == "keys" { link($0); next } $2 == "zsh" { link($0); next } diff --git a/variants/ccx-x86_64/ocaml b/variants/ccx-x86_64/ocaml @@ -60,7 +60,7 @@ cd 'ocaml-5.4.0' -autotools_config_static --enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs +autotools_config_static --enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs --libdir="$prefix/library.ocaml" make -j${JOBS:-1} -l$((1+${JOBS:-1})) @@ -94,6 +94,8 @@ function link(src) { $1!="."{exit 1} +$2 == "library.ocaml" { link($0); next } + $2 == "config" { link($0); next } $2 == "keys" { link($0); next } $2 == "zsh" { link($0); next } diff --git a/variants/ccx-x86_64/ocaml-base b/variants/ccx-x86_64/ocaml-base @@ -0,0 +1,97 @@ +#!/usr/bin/env pthbs-build +#+busybox.be48119e488fda368379eb49b553d609d0988c3dd70c079af2eaa8c23c42043d +#+busybox-findutils.804ee3af0afdd7b1aa159f81593b490bacd3a0b622a7c1566ce82196ae88f771 +#+busybox-awk.5c33e58d30be821f0a1fc8ba082d0a34aaecacad2a1c3a8f25b05cd07b2c6dec +#+busybox-diffutils.89043788a08f3d90f6fc1e02d690f6e5eefa88e11c61a1fae5048e457e46eb6f +#+gnu-make.8b0f1b53392f1db9019f1d8e7ac20d3d9a58501db09a7ab0b2f81939fb4a81e3 +#+dune.89c382449ac23b592a6dad5b76c5d9339492743812d4a8d4762535fbdbacffe7 +#@untar:-z:sha256:9bf9e503e2bd010325c7b0f5ae007ce1e5d3da61f0e06d2fbb64e9d12ccff93c:. + + +# - build script start - +prefix=/home/ccx/versions/$pthbs_package +dest=${pthbs_destdir%/}${prefix} +cd 'base-0.16.3' + + + + dune build --release --verbose + + +dune install \ + --destdir="$pthbs_destdir" \ + --prefix="$prefix" \ + --libdir="$prefix/library.ocaml" \ + --bindir="$prefix/command" \ + --sbindir="$prefix/command" \ + --etcdir="$prefix/config/etc" \ + --mandir="$prefix/man" \ + --docdir="$prefix/doc/ocaml-base" \ + --datadir="$prefix/data" \ + + + +dune runtest --build-dir=.testenv --verbose + + +cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" +find -type d -o -print | awk -F/ ' +BEGIN { + x["./library.ocaml/base/base.ml"]=1 + x["./library.ocaml/base/base.cma"]=1 + x["./library.ocaml/base/base.cmi"]=1 +} + +function r1(s) { + sub("^[.]/[^/]*", ".", s) + return s +} +function s1(repl, s) { + sub("^[.]/[^/]*", "./"repl, s) + return s +} +function link(src) { + x[$0]=0 + printf "%s\t%s\n", $0, src + printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" +} +$1!="."{exit 1} + + +$2 == "library.ocaml" { link($0); next } + +$2 == "config" { link($0); next } +$2 == "keys" { link($0); next } +$2 == "zsh" { link($0); next } +$2 == "env" { link($0); next } +$2 == "command" { link($0); next } +$2 == "bin" { link(s1("command", $0)); next } + +$2 == "library.so" { link($0); next } +$2 == "library" { link($0); next } +$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } +$2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } + +$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } + +$2 == "man" { link($0); next } +$2 == "info" { link($0); next } +$2 == "doc" { link($0); next } +$2 == "icons" { link($0); next } +$2 == "terminfo" { link($0); next } +$2 == "data" { link($0); next } +$2 == "include" { link($0); next } + +{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } + +END { + for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } + for(fname in x) { + if(x[fname]) { + printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" + exit 3 + } + } +}' >.install-links.new +mv .install-links.new .install-links + diff --git a/variants/ccx-x86_64/ocaml-findlib b/variants/ccx-x86_64/ocaml-findlib @@ -6,7 +6,7 @@ #+musl-cross-make.c8a0fd5e5e3f323f7c1c660f3fd06f389185bea4c3b65613a1cdb47b7e1c9738 #+gnu-make.8b0f1b53392f1db9019f1d8e7ac20d3d9a58501db09a7ab0b2f81939fb4a81e3 #+m4.c851eab644fdd4d6bb61ea5a4ac7a820da348ace61aeee745f0053b1aaab2f24 -#+ocaml.d9ce98b461adb90067d52ee35a375a6f2d8accee313da46b28df6fd9df8ce79e +#+ocaml.5b34db3f087fd067e8cf20c9806c599c52cf1d4564105f3841aa3594496ef578 #@untar:-z:sha256:2df996279ae16b606db5ff5879f93dbfade0898db9f1a3e82f7f845faa2930a2:. @@ -56,6 +56,8 @@ function link(src) { $1!="."{exit 1} +$2 == "library.ocaml" { link($0); next } + $2 == "config" { link($0); next } $2 == "keys" { link($0); next } $2 == "zsh" { link($0); next } diff --git a/variants/ccx-x86_64/ocamlbuild b/variants/ccx-x86_64/ocamlbuild @@ -6,7 +6,7 @@ #+musl-cross-make.c8a0fd5e5e3f323f7c1c660f3fd06f389185bea4c3b65613a1cdb47b7e1c9738 #+gnu-make.8b0f1b53392f1db9019f1d8e7ac20d3d9a58501db09a7ab0b2f81939fb4a81e3 #+m4.c851eab644fdd4d6bb61ea5a4ac7a820da348ace61aeee745f0053b1aaab2f24 -#+ocaml.d9ce98b461adb90067d52ee35a375a6f2d8accee313da46b28df6fd9df8ce79e +#+ocaml.5b34db3f087fd067e8cf20c9806c599c52cf1d4564105f3841aa3594496ef578 #@untar:-z:sha256:4e1279ff0ef80c862eaa5207a77020d741e89ef94f0e4a92a37c4188dbf08256:. @@ -54,6 +54,8 @@ function link(src) { $1!="."{exit 1} +$2 == "library.ocaml" { link($0); next } + $2 == "config" { link($0); next } $2 == "keys" { link($0); next } $2 == "zsh" { link($0); next } diff --git a/variants/ccx-x86_64/opam b/variants/ccx-x86_64/opam @@ -0,0 +1,103 @@ +#!/usr/bin/env pthbs-build +#+busybox.be48119e488fda368379eb49b553d609d0988c3dd70c079af2eaa8c23c42043d +#+busybox-findutils.804ee3af0afdd7b1aa159f81593b490bacd3a0b622a7c1566ce82196ae88f771 +#+busybox-awk.5c33e58d30be821f0a1fc8ba082d0a34aaecacad2a1c3a8f25b05cd07b2c6dec +#+busybox-diffutils.89043788a08f3d90f6fc1e02d690f6e5eefa88e11c61a1fae5048e457e46eb6f +#+gnu-make.8b0f1b53392f1db9019f1d8e7ac20d3d9a58501db09a7ab0b2f81939fb4a81e3 +#+dune.89c382449ac23b592a6dad5b76c5d9339492743812d4a8d4762535fbdbacffe7 +#@untar:-z:sha256:c4d053029793c714e4e7340b1157428c0f90783585fb17f35158247a640467d9:. + + +# - build script start - +prefix=/home/ccx/versions/$pthbs_package +dest=${pthbs_destdir%/}${prefix} +cd 'opam-2.4.1' + + +./configure \ + --prefix="$prefix" \ + --libdir="$prefix/library.ocaml" \ + --bindir="$prefix/command" \ + --sbindir="$prefix/command" \ + --etcdir="$prefix/config/etc" \ + --mandir="$prefix/man" \ + --docdir="$prefix/doc/opam" \ + --datadir="$prefix/data" \ + --datarootdir="$prefix/data" \ + --infodir="$prefix/info" \ + --localedir="$prefix/locale" \ + --localstatedir='/var/pthbs' \ + --with-dune='/home/ccx/versions/dune.89c382449ac23b592a6dad5b76c5d9339492743812d4a8d4762535fbdbacffe7/command/dune' \ + --with-mccs \ + --with-vendored-deps + + +make -j${JOBS:-1} -l$((1+${JOBS:-1})) + +make DESTDIR="$pthbs_destdir" install + + + +make tests +check_static command/opam + + +cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" +find -type d -o -print | awk -F/ ' +BEGIN { + x["./command/opam"]=1 +} + +function r1(s) { + sub("^[.]/[^/]*", ".", s) + return s +} +function s1(repl, s) { + sub("^[.]/[^/]*", "./"repl, s) + return s +} +function link(src) { + x[$0]=0 + printf "%s\t%s\n", $0, src + printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" +} +$1!="."{exit 1} + + +$2 == "library.ocaml" { link($0); next } + +$2 == "config" { link($0); next } +$2 == "keys" { link($0); next } +$2 == "zsh" { link($0); next } +$2 == "env" { link($0); next } +$2 == "command" { link($0); next } +$2 == "bin" { link(s1("command", $0)); next } + +$2 == "library.so" { link($0); next } +$2 == "library" { link($0); next } +$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } +$2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } + +$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } + +$2 == "man" { link($0); next } +$2 == "info" { link($0); next } +$2 == "doc" { link($0); next } +$2 == "icons" { link($0); next } +$2 == "terminfo" { link($0); next } +$2 == "data" { link($0); next } +$2 == "include" { link($0); next } + +{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } + +END { + for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } + for(fname in x) { + if(x[fname]) { + printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" + exit 3 + } + } +}' >.install-links.new +mv .install-links.new .install-links + diff --git a/variants/ccx-x86_64/wip.environment b/variants/ccx-x86_64/wip.environment @@ -1,4 +1,5 @@ #!/usr/bin/env pthbs-build -#+ocaml.d9ce98b461adb90067d52ee35a375a6f2d8accee313da46b28df6fd9df8ce79e -#+dune.f816aef205ce92078d20ccb3427628574850f6c0f562db3a062e8b53003ed678 -#+ocamlbuild.8a091660a42bded8aac9f4be840cad31b49f2eb0c837201d3c036cbe408bae6c- \ No newline at end of file +#+ocaml.5b34db3f087fd067e8cf20c9806c599c52cf1d4564105f3841aa3594496ef578 +#+dune.89c382449ac23b592a6dad5b76c5d9339492743812d4a8d4762535fbdbacffe7 +#+ocamlbuild.bc0dcc5465fec021273e3aced8531c2c40c0d06249ce95766c14fdbd1e2b6608 +#+ocaml-base.ebacc5fdaad89d4e0bb39bb76dc5945517531679436afa7f451271cff8fcf2dc+ \ No newline at end of file diff --git a/variants/root-x86_64/dune b/variants/root-x86_64/dune @@ -4,8 +4,8 @@ #+busybox-awk.2db96ae9bd5ed9b9476bf92bb3bfae69caca475abd57385640428943edaa5fc5 #+busybox-diffutils.c5eee57596d172f36d2db9220e421b72e49a339032512dcaec3563e463e0786d #+gnu-make.7c89ba8600db3ad1223a633a8783e077a4273e6371515d54d113a687898684c6 -#+ocaml.24768db1c0406058ce52f0144b7d465d03d857fb912f449c2f07e20f5a02fbd7 -#@untar:-z:sha256:4e1279ff0ef80c862eaa5207a77020d741e89ef94f0e4a92a37c4188dbf08256:. +#+ocaml.7dac3082b76965ebaab371cfb7848a931581faf39bda33a9701667cb7503f802 +#@untar:-z:sha256:579c738f8ca191ba0a9b22dbe78f1377542442c9827cf4939f8964f09f9edb28:. # - build script start - @@ -17,10 +17,9 @@ sed -i 's/stdune.csexp/dune-configurator.csexp/' vendor/csexp/src/dune - ./configure \ --prefix="$prefix" \ - --libdir="$prefix/library" \ + --libdir="$prefix/library.ocaml" \ --bindir="$prefix/command" \ --sbindir="$prefix/command" \ --etcdir="$prefix/config/etc" \ @@ -32,6 +31,8 @@ sed -i 's/stdune.csexp/dune-configurator.csexp/' vendor/csexp/src/dune --localedir="$prefix/locale" \ --localstatedir='/var/pthbs' + + ocaml boot/bootstrap.ml --verbose ./dune.exe build \ -p dune,dune-configurator \ @@ -69,6 +70,8 @@ function link(src) { $1!="."{exit 1} +$2 == "library.ocaml" { link($0); next } + $2 == "config" { link($0); next } $2 == "keys" { link($0); next } $2 == "zsh" { link($0); next } diff --git a/variants/root-x86_64/ocaml b/variants/root-x86_64/ocaml @@ -60,7 +60,7 @@ cd 'ocaml-5.4.0' -autotools_config_static --enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs +autotools_config_static --enable-native-compiler --disable-native-toplevel --enable-installing-bytecode-programs --libdir="$prefix/library.ocaml" make -j${JOBS:-1} -l$((1+${JOBS:-1})) @@ -94,6 +94,8 @@ function link(src) { $1!="."{exit 1} +$2 == "library.ocaml" { link($0); next } + $2 == "config" { link($0); next } $2 == "keys" { link($0); next } $2 == "zsh" { link($0); next } diff --git a/variants/root-x86_64/ocaml-base b/variants/root-x86_64/ocaml-base @@ -0,0 +1,97 @@ +#!/usr/bin/env pthbs-build +#+busybox.1c53cabaafc9be2067b20d66609b37bc474e9bc93e2f223b4c06996fe65dff1e +#+busybox-findutils.77e02cf8e8c855b16cb60636507ca0c104c8b812535721b3ddd00deb85fab783 +#+busybox-awk.2db96ae9bd5ed9b9476bf92bb3bfae69caca475abd57385640428943edaa5fc5 +#+busybox-diffutils.c5eee57596d172f36d2db9220e421b72e49a339032512dcaec3563e463e0786d +#+gnu-make.7c89ba8600db3ad1223a633a8783e077a4273e6371515d54d113a687898684c6 +#+dune.b068a60fd03c7e3430a7806029d31de91e5078867a215dd94af050646989fdcc +#@untar:-z:sha256:9bf9e503e2bd010325c7b0f5ae007ce1e5d3da61f0e06d2fbb64e9d12ccff93c:. + + +# - build script start - +prefix=/versions/$pthbs_package +dest=${pthbs_destdir%/}${prefix} +cd 'base-0.16.3' + + + + dune build --release --verbose + + +dune install \ + --destdir="$pthbs_destdir" \ + --prefix="$prefix" \ + --libdir="$prefix/library.ocaml" \ + --bindir="$prefix/command" \ + --sbindir="$prefix/command" \ + --etcdir="$prefix/config/etc" \ + --mandir="$prefix/man" \ + --docdir="$prefix/doc/ocaml-base" \ + --datadir="$prefix/data" \ + + + +dune runtest --build-dir=.testenv --verbose + + +cd "$pthbs_destdir/versions/$pthbs_package" +find -type d -o -print | awk -F/ ' +BEGIN { + x["./library.ocaml/base/base.ml"]=1 + x["./library.ocaml/base/base.cma"]=1 + x["./library.ocaml/base/base.cmi"]=1 +} + +function r1(s) { + sub("^[.]/[^/]*", ".", s) + return s +} +function s1(repl, s) { + sub("^[.]/[^/]*", "./"repl, s) + return s +} +function link(src) { + x[$0]=0 + printf "%s\t%s\n", $0, src + printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" +} +$1!="."{exit 1} + + +$2 == "library.ocaml" { link($0); next } + +$2 == "config" { link($0); next } +$2 == "keys" { link($0); next } +$2 == "zsh" { link($0); next } +$2 == "env" { link($0); next } +$2 == "command" { link($0); next } +$2 == "bin" { link(s1("command", $0)); next } + +$2 == "library.so" { link($0); next } +$2 == "library" { link($0); next } +$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } +$2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } + +$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } + +$2 == "man" { link($0); next } +$2 == "info" { link($0); next } +$2 == "doc" { link($0); next } +$2 == "icons" { link($0); next } +$2 == "terminfo" { link($0); next } +$2 == "data" { link($0); next } +$2 == "include" { link($0); next } + +{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } + +END { + for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } + for(fname in x) { + if(x[fname]) { + printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" + exit 3 + } + } +}' >.install-links.new +mv .install-links.new .install-links + diff --git a/variants/root-x86_64/ocaml-findlib b/variants/root-x86_64/ocaml-findlib @@ -6,7 +6,7 @@ #+musl-cross-make.f87ce5b6081b67490d8993a640c0abb7213f4c5f3fc2d9e1736ba20b727ae9cd #+gnu-make.7c89ba8600db3ad1223a633a8783e077a4273e6371515d54d113a687898684c6 #+m4.73357211084c9dfb7638b68c241c68fcf78321090d5142b65e9ab4f2e82848e7 -#+ocaml.24768db1c0406058ce52f0144b7d465d03d857fb912f449c2f07e20f5a02fbd7 +#+ocaml.7dac3082b76965ebaab371cfb7848a931581faf39bda33a9701667cb7503f802 #@untar:-z:sha256:2df996279ae16b606db5ff5879f93dbfade0898db9f1a3e82f7f845faa2930a2:. @@ -56,6 +56,8 @@ function link(src) { $1!="."{exit 1} +$2 == "library.ocaml" { link($0); next } + $2 == "config" { link($0); next } $2 == "keys" { link($0); next } $2 == "zsh" { link($0); next } diff --git a/variants/root-x86_64/ocamlbuild b/variants/root-x86_64/ocamlbuild @@ -6,7 +6,7 @@ #+musl-cross-make.f87ce5b6081b67490d8993a640c0abb7213f4c5f3fc2d9e1736ba20b727ae9cd #+gnu-make.7c89ba8600db3ad1223a633a8783e077a4273e6371515d54d113a687898684c6 #+m4.73357211084c9dfb7638b68c241c68fcf78321090d5142b65e9ab4f2e82848e7 -#+ocaml.24768db1c0406058ce52f0144b7d465d03d857fb912f449c2f07e20f5a02fbd7 +#+ocaml.7dac3082b76965ebaab371cfb7848a931581faf39bda33a9701667cb7503f802 #@untar:-z:sha256:4e1279ff0ef80c862eaa5207a77020d741e89ef94f0e4a92a37c4188dbf08256:. @@ -54,6 +54,8 @@ function link(src) { $1!="."{exit 1} +$2 == "library.ocaml" { link($0); next } + $2 == "config" { link($0); next } $2 == "keys" { link($0); next } $2 == "zsh" { link($0); next } diff --git a/variants/root-x86_64/opam b/variants/root-x86_64/opam @@ -0,0 +1,103 @@ +#!/usr/bin/env pthbs-build +#+busybox.1c53cabaafc9be2067b20d66609b37bc474e9bc93e2f223b4c06996fe65dff1e +#+busybox-findutils.77e02cf8e8c855b16cb60636507ca0c104c8b812535721b3ddd00deb85fab783 +#+busybox-awk.2db96ae9bd5ed9b9476bf92bb3bfae69caca475abd57385640428943edaa5fc5 +#+busybox-diffutils.c5eee57596d172f36d2db9220e421b72e49a339032512dcaec3563e463e0786d +#+gnu-make.7c89ba8600db3ad1223a633a8783e077a4273e6371515d54d113a687898684c6 +#+dune.b068a60fd03c7e3430a7806029d31de91e5078867a215dd94af050646989fdcc +#@untar:-z:sha256:c4d053029793c714e4e7340b1157428c0f90783585fb17f35158247a640467d9:. + + +# - build script start - +prefix=/versions/$pthbs_package +dest=${pthbs_destdir%/}${prefix} +cd 'opam-2.4.1' + + +./configure \ + --prefix="$prefix" \ + --libdir="$prefix/library.ocaml" \ + --bindir="$prefix/command" \ + --sbindir="$prefix/command" \ + --etcdir="$prefix/config/etc" \ + --mandir="$prefix/man" \ + --docdir="$prefix/doc/opam" \ + --datadir="$prefix/data" \ + --datarootdir="$prefix/data" \ + --infodir="$prefix/info" \ + --localedir="$prefix/locale" \ + --localstatedir='/var/pthbs' \ + --with-dune='/versions/dune.b068a60fd03c7e3430a7806029d31de91e5078867a215dd94af050646989fdcc/command/dune' \ + --with-mccs \ + --with-vendored-deps + + +make -j${JOBS:-1} -l$((1+${JOBS:-1})) + +make DESTDIR="$pthbs_destdir" install + + + +make tests +check_static command/opam + + +cd "$pthbs_destdir/versions/$pthbs_package" +find -type d -o -print | awk -F/ ' +BEGIN { + x["./command/opam"]=1 +} + +function r1(s) { + sub("^[.]/[^/]*", ".", s) + return s +} +function s1(repl, s) { + sub("^[.]/[^/]*", "./"repl, s) + return s +} +function link(src) { + x[$0]=0 + printf "%s\t%s\n", $0, src + printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" +} +$1!="."{exit 1} + + +$2 == "library.ocaml" { link($0); next } + +$2 == "config" { link($0); next } +$2 == "keys" { link($0); next } +$2 == "zsh" { link($0); next } +$2 == "env" { link($0); next } +$2 == "command" { link($0); next } +$2 == "bin" { link(s1("command", $0)); next } + +$2 == "library.so" { link($0); next } +$2 == "library" { link($0); next } +$2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } +$2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } + +$2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } + +$2 == "man" { link($0); next } +$2 == "info" { link($0); next } +$2 == "doc" { link($0); next } +$2 == "icons" { link($0); next } +$2 == "terminfo" { link($0); next } +$2 == "data" { link($0); next } +$2 == "include" { link($0); next } + +{ printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } + +END { + for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } + for(fname in x) { + if(x[fname]) { + printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" + exit 3 + } + } +}' >.install-links.new +mv .install-links.new .install-links + diff --git a/variants/root-x86_64/wip.environment b/variants/root-x86_64/wip.environment @@ -1,4 +1,5 @@ #!/usr/bin/env pthbs-build -#+ocaml.24768db1c0406058ce52f0144b7d465d03d857fb912f449c2f07e20f5a02fbd7 -#+dune.1d25a4b37df573d62cc68eebc730a603d9cbf818e03f0ebc1d3f10de1d369ef8 -#+ocamlbuild.9bd6ff3483b106d31e35088eecaf7e0b8333762e2552198437cf4a919898a858- \ No newline at end of file +#+ocaml.7dac3082b76965ebaab371cfb7848a931581faf39bda33a9701667cb7503f802 +#+dune.b068a60fd03c7e3430a7806029d31de91e5078867a215dd94af050646989fdcc +#+ocamlbuild.7eaa6dc8723366dd4c460566e807f1740d9b422033342b8edf8a18eca72a2b10 +#+ocaml-base.5bcb5f53c0c99e9d9a898ccd1cfd81231584507490e43e5b3451e53becfca08c+ \ No newline at end of file