commit 65d4ba51cec0a3f464b20da0a079724e9f9c2608
parent 7e6994a3b4d96c75bfb0119f249e62355cbf9fd8
Author: Jan Pobrislo <ccx@te2000.cz>
Date: Sun, 26 Oct 2025 23:22:03 +0000
ocaml packages
Diffstat:
9 files changed, 274 insertions(+), 38 deletions(-)
diff --git a/templates/dune b/templates/dune
@@ -0,0 +1,37 @@
+{% extends "genlinks" %}
+{% block template_deps -%}
+{{ super() -}}
+#+{{pkg_install_name("busybox-diffutils")}}
+#+{{pkg_install_name("musl-cross-make")}}
+#+{{pkg_install_name("ocaml")}}
+#+{{pkg_install_name("dune")}}
+{% endblock template_deps %}
+{%- block configure %}
+export DUNE_CACHE=disabled
+{{ super() }}
+{% endblock configure %}
+{%- block build %}
+dune build --release --no-buffer --verbose
+
+{% endblock build %}
+{%- 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 install %}
+{% block check -%}
+dune runtest --build-dir=.testenv --no-buffer --verbose
+
+{% endblock check %}
+{% block genlinks_rules %}
+{{ super() -}}
+$2 == "library.ocaml" { link($0); next }
+{% endblock genlinks_rules -%}
diff --git a/templates/pkg/ocaml-base b/templates/pkg/ocaml-base
@@ -1,45 +1,17 @@
{%- set pkg_version="0.17.3" -%}
{%- set src_dir="base-"+pkg_version -%}
-{% extends "genlinks" %}
+{% extends "dune" %}
{% block package_deps -%}
-#+{{pkg_install_name("busybox-diffutils")}}
-#+{{pkg_install_name("musl-cross-make")}}
-#+{{pkg_install_name("ocaml")}}
-#+{{pkg_install_name("dune")}}
#+{{pkg_install_name("ocaml_intrinsics_kernel")}}
+#+{{pkg_install_name("ocaml-sexplib0")}}
#@untar:-z:sha256:3f3f64789ab25bb5cb7f5f907dd651dec9cc9440981822fe75df6b94344b7208:.
{% endblock package_deps %}
{%- block prepare %}
{{ super() }}
sed -i 's/(bash /(run sh -c /' src/dune
{% endblock prepare %}
-{%- block build %}
-env
-dune build --release --verbose
-
-{% endblock build %}
-{%- 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 install %}
-{% block check -%}
-dune runtest --build-dir=.testenv --verbose
-
-{% endblock check %}
{% 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 genlinks_begin %}
-{% block genlinks_rules %}
-$2 == "library.ocaml" { link($0); next }
-{% endblock genlinks_rules -%}
diff --git a/templates/pkg/ocaml-sexplib0 b/templates/pkg/ocaml-sexplib0
@@ -0,0 +1,13 @@
+{%- set pkg_version="0.16.0" -%}
+{%- set upstream_name="sexplib0" -%}
+{% extends "dune" %}
+{% block package_deps -%}
+#@untar:-z:{{downloads[upstream_name + "-v" + assertion(pkg_version) + ".tar.gz"]}}:.
+{% endblock package_deps %}
+{% block genlinks_begin %}
+ x["./library.ocaml/sexplib0/sexplib0.a"]=1
+ x["./library.ocaml/sexplib0/sexplib0.ml"]=1
+ x["./library.ocaml/sexplib0/sexplib0.cma"]=1
+ x["./library.ocaml/sexplib0/sexplib0.cmi"]=1
+{% endblock genlinks_begin %}
+
diff --git a/variants/ccx-x86_64/ocaml-base b/variants/ccx-x86_64/ocaml-base
@@ -7,6 +7,7 @@
#+ocaml.ef754772d8f7327d0be86b448ecdefacca57060d3e358a9d917b40e9e323d763
#+dune.0bf1fa603f0e8ae0f1b4fd7e28d8be34f035e643e5594e0a380ce13485b06a6c
#+ocaml_intrinsics_kernel.16ed146b02bc9156f3992e8a5e86bf84358aedbbe209a79cdcae96f1a42b296b
+#+ocaml-sexplib0.178282d0a484d0433c2d8d0a83a9096de0277e2d7a6382c7ec25fe1b98094e81
#@untar:-z:sha256:3f3f64789ab25bb5cb7f5f907dd651dec9cc9440981822fe75df6b94344b7208:.
@@ -20,9 +21,11 @@ cd 'base-0.17.3'
sed -i 's/(bash /(run sh -c /' src/dune
+export DUNE_CACHE=disabled
-env
-dune build --release --verbose
+
+
+dune build --release --no-buffer --verbose
dune install \
@@ -38,7 +41,7 @@ dune install \
-dune runtest --build-dir=.testenv --verbose
+dune runtest --build-dir=.testenv --no-buffer --verbose
diff --git a/variants/ccx-x86_64/ocaml-sexplib0 b/variants/ccx-x86_64/ocaml-sexplib0
@@ -0,0 +1,104 @@
+#!/usr/bin/env pthbs-build
+#+busybox.47c820e8cf3f700bf5b693d7d379272d485e5078b2036912ce2e01bb998caf1f
+#+busybox-findutils.79fab8ce17646e27c958348822c367903ddbef44dcebb134d16caa4fc287b716
+#+busybox-awk.6efe6e8726ffa7c47dc117be114219675ccea315e4e29685e40a06b61d249f9b
+#+busybox-diffutils.f40ac7713836b6eaa4e46db3b7577b533f4738fb10bf732edc044ffc48eb9ec8
+#+musl-cross-make.e4735d8572f9b6654a7381ebdfbd62e665d1d1da5e06a56923e89274cc6a510f
+#+ocaml.ef754772d8f7327d0be86b448ecdefacca57060d3e358a9d917b40e9e323d763
+#+dune.0bf1fa603f0e8ae0f1b4fd7e28d8be34f035e643e5594e0a380ce13485b06a6c
+#@untar:-z:sha256:86dba26468194512f789f2fb709063515a9cb4e5c4461c021c239a369590701d:.
+
+
+# - build script start -
+
+prefix=/home/ccx/versions/$pthbs_package
+dest=${pthbs_destdir%/}${prefix}
+cd 'sexplib0-0.16.0'
+
+
+export DUNE_CACHE=disabled
+
+
+
+dune build --release --no-buffer --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-sexplib0" \
+ --datadir="$prefix/data" \
+
+
+
+dune runtest --build-dir=.testenv --no-buffer --verbose
+
+
+
+cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./library.ocaml/sexplib0/sexplib0.a"]=1
+ x["./library.ocaml/sexplib0/sexplib0.ml"]=1
+ x["./library.ocaml/sexplib0/sexplib0.cma"]=1
+ x["./library.ocaml/sexplib0/sexplib0.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/wip.environment b/variants/ccx-x86_64/wip.environment
@@ -2,5 +2,5 @@
#+ocaml.ef754772d8f7327d0be86b448ecdefacca57060d3e358a9d917b40e9e323d763
#+dune.0bf1fa603f0e8ae0f1b4fd7e28d8be34f035e643e5594e0a380ce13485b06a6c
#+ocamlbuild.1f92ef06cb109487b573ecdd2059d0b0ab559ec12ac113d9fa88a4372103d884
-#+ocaml-base.5c20b0cc9f927c498ae3ff65c4e99eebf885178e14024a7a36c4f8e5c79fe714
+#+ocaml-base.97ba47c744b53629841e7e0ff0642a4217d1f717f1112499d717a5fcef952dc4
#+opam.f141b6d40419926cd7592b4750565eca71de8fe11bb9803b2f04f5560cfd08b5
\ No newline at end of file
diff --git a/variants/root-x86_64/ocaml-base b/variants/root-x86_64/ocaml-base
@@ -7,6 +7,7 @@
#+ocaml.5f284ca479cb1311e030bce243d0075ef6bdbc702f514ca5a836b4638b203691
#+dune.d71d865a1e049f9cb3345d4588f36c028ef41ae48915a57ce510bfe02d623bf8
#+ocaml_intrinsics_kernel.9bc274eaa63c8f8bd585747fbfbb7ec0651449fa5d43713726de7e72abfb5307
+#+ocaml-sexplib0.851c0d6e52a0fb7f70665f83d49371fd771a570baf84a295047c82395dc53d5a
#@untar:-z:sha256:3f3f64789ab25bb5cb7f5f907dd651dec9cc9440981822fe75df6b94344b7208:.
@@ -20,9 +21,11 @@ cd 'base-0.17.3'
sed -i 's/(bash /(run sh -c /' src/dune
+export DUNE_CACHE=disabled
-env
-dune build --release --verbose
+
+
+dune build --release --no-buffer --verbose
dune install \
@@ -38,7 +41,7 @@ dune install \
-dune runtest --build-dir=.testenv --verbose
+dune runtest --build-dir=.testenv --no-buffer --verbose
diff --git a/variants/root-x86_64/ocaml-sexplib0 b/variants/root-x86_64/ocaml-sexplib0
@@ -0,0 +1,104 @@
+#!/usr/bin/env pthbs-build
+#+busybox.05cde6bebcef146cc4de9201c82e0ef427702cc3bfe1acb48c0587542ba53002
+#+busybox-findutils.2c87d98d861d724e141128f395bed58e70601468aee2a192d77d5791d83772b7
+#+busybox-awk.a5b9d5a1c719361e565a642a57d44356c26855fb0eda30c03eaf582ba6c3194b
+#+busybox-diffutils.977bc00da27e0150d3b3d395fe42cf24e0364b03390cab81002f27b34158d9fc
+#+musl-cross-make.ef7f483eefcad5b8f2d6c8329e61a0acaca7864b88e9521cb839392c62f45676
+#+ocaml.5f284ca479cb1311e030bce243d0075ef6bdbc702f514ca5a836b4638b203691
+#+dune.d71d865a1e049f9cb3345d4588f36c028ef41ae48915a57ce510bfe02d623bf8
+#@untar:-z:sha256:86dba26468194512f789f2fb709063515a9cb4e5c4461c021c239a369590701d:.
+
+
+# - build script start -
+
+prefix=/versions/$pthbs_package
+dest=${pthbs_destdir%/}${prefix}
+cd 'sexplib0-0.16.0'
+
+
+export DUNE_CACHE=disabled
+
+
+
+dune build --release --no-buffer --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-sexplib0" \
+ --datadir="$prefix/data" \
+
+
+
+dune runtest --build-dir=.testenv --no-buffer --verbose
+
+
+
+cd "$pthbs_destdir/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./library.ocaml/sexplib0/sexplib0.a"]=1
+ x["./library.ocaml/sexplib0/sexplib0.ml"]=1
+ x["./library.ocaml/sexplib0/sexplib0.cma"]=1
+ x["./library.ocaml/sexplib0/sexplib0.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/wip.environment b/variants/root-x86_64/wip.environment
@@ -2,5 +2,5 @@
#+ocaml.5f284ca479cb1311e030bce243d0075ef6bdbc702f514ca5a836b4638b203691
#+dune.d71d865a1e049f9cb3345d4588f36c028ef41ae48915a57ce510bfe02d623bf8
#+ocamlbuild.c3517ef4f01ee9188faf3fc292460b4865e24fed652e1079d153e4bc1345bdfc
-#+ocaml-base.252564aa8012b610c37cce1e79773e1877e60d6d9161fd000ffde23d3bcd4a23
+#+ocaml-base.ed2c503e1d03612b046b87504aca5128b49e8ce76469509d5cd22c7ba2806d3e
#+opam.44486356d5bffe311486abc4601e0f1e3e3af01d20c58849a9f1669ad07200f4
\ No newline at end of file