commit d219c3d06f1b41c38bf6e02674d61b6bf949ec8e
parent c14e1e0370b8552ff87504adef15ac97ebd6e471
Author: Jan Pobrislo <ccx@te2000.cz>
Date: Wed, 22 Oct 2025 02:33:33 +0000
ocaml
Diffstat:
8 files changed, 295 insertions(+), 1 deletion(-)
diff --git a/commitlist.sha1 b/commitlist.sha1
@@ -1775,7 +1775,6 @@ e12821ffb205f41fa8319ad109762a06e121c141 sources/libelf
fd2af33bd4b64be5221116f85dcf4cd220eb9a1c sources/libelf
409db79b3e7e5fc6b73305471d9bbb6ac5c14036 sources/logincaps
41039418205b48bda59372fb7c49453852853e8a sources/logincaps
-52261504e78293b651e73a518834c5c75d0b3bf6 sources/logincaps
79af0da183f068b99a69107b2764d9c8c3c3eaca sources/logincaps
e4da83dbb7d3fbea2421d5a327780653f8d1b40c sources/logincaps
28895911cdcf052b64d8f19325926a870bd457d5 sources/mdev-conf
diff --git a/downloadlist.sha256 b/downloadlist.sha256
@@ -62,3 +62,16 @@ ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157 958468 https://
7586962547803be7ecc4056efc927fb25214548722bd28171172f3599abb9764 151168812 https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.15.tar.xz
1387e0b67ff247d2abde998f90dfbf70c1491391a59ddfecb8ae698789f0a4f5 2240712 https://ftp.gnu.org/pub/gnu/findutils/findutils-4.10.0.tar.xz
e031b1e1d2b230f276f975bffb923f0ea15f798c839d15a3f26a1a39448e32d7 1845685 https://codeload.github.com/onetrueawk/awk/tar.gz/refs/tags/20250116
+dfaa8a2e11c799bc1765d8bef44911406ee5f4803027190382a939f88c912266 4471216 https://caml.inria.fr/pub/distrib/ocaml-5.4/ocaml-5.4.0.tar.xz
+579c738f8ca191ba0a9b22dbe78f1377542442c9827cf4939f8964f09f9edb28 3051854 https://github.com/ocaml/dune/archive/3.20.2.tar.gz
+865692630c07c3ab87c66cdfc2734c0fdfc9c34a57f8e89ffec7c7d15e7a70fa 37499 https://erratique.ch/software/astring/releases/astring-0.8.5.tbz
+d8d62e786b10d697e0457205a8eedeaa27ebcc90f1855f18df190cac2e3d8f37 42330 https://erratique.ch/software/bos/releases/bos-0.2.1.tbz
+9bf9e503e2bd010325c7b0f5ae007ce1e5d3da61f0e06d2fbb64e9d12ccff93c 442632 https://github.com/janestreet/base/archive/refs/tags/v0.16.3/base-0.16.3.tar.gz
+f1fb20805a22dd75a137d72704a370e7789cf6bdf63948e6817d1c226c141261 22699 https://erratique.ch/software/fmt/releases/fmt-0.9.0.tbz
+12b08ff192d037d9b6d69e9ca19d1d385184f20b3237c27231e437ac81ace70f 24345 https://erratique.ch/software/fpath/releases/fpath-0.7.3.tbz
+86f4a02807eb1a297aae44977d9f61e419c31458a5d7b23c6f55575e8e69d5ca 18458 https://erratique.ch/software/logs/releases/logs-0.7.0.tbz
+11aa7f5b83460e60431e3154e3e32c071d46e151ea5760cf24377805bf975540 8506 https://erratique.ch/software/rresult/releases/rresult-0.7.0.tbz
+452082626e651ac4b1633c2b4ae4cad7abeb1fb6a13046e699f95eec58b5d1c7 96315 https://erratique.ch/software/topkg/releases/topkg-1.0.5.tbz
+4e1279ff0ef80c862eaa5207a77020d741e89ef94f0e4a92a37c4188dbf08256 199103 https://github.com/ocaml/ocamlbuild/archive/0.14.1.tar.gz
+ffab41b0b0f65ade305043205229a7649591195cbe86e24f2c254e9dc5b14a34 10970 https://github.com/ocaml-dune/csexp/archive/1.5.1.tar.gz
+e564d5d1ca157314ba5fd64b4e89fa12c6cba8efee3becf6d09d7d9dda21ac5b 54920 https://ocaml.janestreet.com/ocaml-core/v0.16/files/sexplib-v0.16.0.tar.gz
diff --git a/templates/pkg/ocaml b/templates/pkg/ocaml
@@ -0,0 +1,12 @@
+{%- set pkg_version="5.4.0" -%}
+{%- set pkg_source="tar.xz" -%}
+{% extends "autotools_static" %}
+{%- block configure_args %}--enable-native-compiler --enable-native-toplevel --enable-installing-bytecode-programs{% endblock %}
+{% block check -%}
+check_static command/ocamlopt
+
+{% endblock %}
+{% block genlinks_begin %}
+ x["./command/ocamlopt"]=1
+{% endblock %}
+
diff --git a/templates/pkg/wip.environment b/templates/pkg/wip.environment
@@ -0,0 +1,2 @@
+{{ shebang }}
+#+{{pkg_install_name("ocaml")}}
diff --git a/variants/ccx-x86_64/ocaml b/variants/ccx-x86_64/ocaml
@@ -0,0 +1,131 @@
+#!/usr/bin/env pthbs-build
+#+busybox.1ece97f2192661a6f5605f3f9bccbc8e917ed4adcecd1d8ca7cf9710363f495f
+#+busybox-findutils.37324a26742f7757965c3863bab9b3b08211c9d57539f455839ecd90e6fa3a59
+#+busybox-awk.f58cd25bab650fb74567bab10fc34f5b591f481611f885dcd429aedbf73a490f
+#+busybox-diffutils.1aa76d52d9aa0d4541fde1ed8cac30606ca4ec9985ce43454ffc7cd60ab1a0be
+#+musl-cross-make.1047ba507930d3bb4139073c872c1e856d7d9f4c542bb22dd0af05422d475054
+#+gnu-make.55eb259e0f312d10457a458d9323e532dda3d8a934982a307b5298d7711bb299
+#+m4.eb034af582dcf74d192ecfbb596c3ad79b44ba2ed8fc6764f59e6491af2ce757
+#@untar:-J:sha256:dfaa8a2e11c799bc1765d8bef44911406ee5f4803027190382a939f88c912266:.
+
+
+# - build script start -
+
+build_env_static() {
+ export LD_LIBRARY_PATH="$pthbs_build_environment/library"
+ export CPATH="$pthbs_build_environment/include"
+ export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS"
+}
+check_static() {
+ local exe || true
+ exe=$pthbs_destdir'/home/ccx/versions'/$pthbs_package/$1
+ if ! test -f $exe; then
+ printf '%s\n' "Error: file '$1' doesn't exist!"
+ exit 1
+ fi
+ interp_info=$(readelf --string-dump=.interp "$exe") || exit $?
+ if test x '!=' "x$interp_info"; then
+ printf '%s\n' "Error: '$1' is a dynamic binary!"
+ exit 1
+ fi
+}
+
+autotools_config() {
+ prefix=/home/ccx/versions/$pthbs_package
+ ./configure -C \
+ --prefix="$prefix" \
+ --build="$(${CC:-gcc} -dumpmachine)" \
+ --bindir="$prefix/command" \
+ --sbindir="$prefix/command" \
+ --infodir="$prefix/info" \
+ --localedir="$prefix/locale" \
+ --mandir="$prefix/man" \
+ --libdir="$prefix/library" \
+ --docdir="$prefix/doc/ocaml" \
+ --datadir="$prefix/data" \
+ --datarootdir="$prefix/data" \
+ --localstatedir='/var/pthbs' \
+ "$@"
+
+}
+
+autotools_config_static() {
+ build_env_static
+ autotools_config "$@" --enable-static --disable-shared
+}
+prefix=/home/ccx/versions/$pthbs_package
+dest=${pthbs_destdir%/}${prefix}
+cd 'ocaml-5.4.0'
+
+
+
+
+autotools_config_static --enable-native-compiler --enable-native-toplevel --enable-installing-bytecode-programs
+
+
+make -j${JOBS:-1} -l$((1+${JOBS:-1}))
+
+make DESTDIR="$pthbs_destdir" install
+
+
+
+check_static command/ocamlopt
+
+
+cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./command/ocamlopt"]=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 == "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
@@ -0,0 +1,2 @@
+#!/usr/bin/env pthbs-build
+#+ocaml.946f13c9d755695a45095c8211d22ae385d67f6067044a286f7e78525fc736b8+
\ No newline at end of file
diff --git a/variants/root-x86_64/ocaml b/variants/root-x86_64/ocaml
@@ -0,0 +1,131 @@
+#!/usr/bin/env pthbs-build
+#+busybox.48c54b64ed4d28b2c4df9ff3167d560e1f8e4bc338c328a71779b3d28413c1e2
+#+busybox-findutils.fb6b808e4bf71082490eef4c8fd0369371046381b5087084822094c27cd7a36b
+#+busybox-awk.4e38799dd0815d4fb9b0c701fff3b41b58366ebf022ccec71b03b0881a2b326f
+#+busybox-diffutils.7c9e0bee30fb6332bf7fa171c534c15d5d7d4fb0702c8f3cad054b4c34cd52ab
+#+musl-cross-make.73b05cc53eb90f3881270d6a6cb7fe89b148029d6233f164737a24b2093d0d81
+#+gnu-make.e1f59e1987776008a08c9fe7ff91402ed39981e46614e7f4846429b4c41a7da7
+#+m4.01cbc5fe99a3badc83fa6f13499d0fd5a212ca9624d3b6e4fe26a9ec41a6133c
+#@untar:-J:sha256:dfaa8a2e11c799bc1765d8bef44911406ee5f4803027190382a939f88c912266:.
+
+
+# - build script start -
+
+build_env_static() {
+ export LD_LIBRARY_PATH="$pthbs_build_environment/library"
+ export CPATH="$pthbs_build_environment/include"
+ export LDFLAGS="-static -L$pthbs_build_environment/library $LDFLAGS"
+}
+check_static() {
+ local exe || true
+ exe=$pthbs_destdir'/versions'/$pthbs_package/$1
+ if ! test -f $exe; then
+ printf '%s\n' "Error: file '$1' doesn't exist!"
+ exit 1
+ fi
+ interp_info=$(readelf --string-dump=.interp "$exe") || exit $?
+ if test x '!=' "x$interp_info"; then
+ printf '%s\n' "Error: '$1' is a dynamic binary!"
+ exit 1
+ fi
+}
+
+autotools_config() {
+ prefix=/versions/$pthbs_package
+ ./configure -C \
+ --prefix="$prefix" \
+ --build="$(${CC:-gcc} -dumpmachine)" \
+ --bindir="$prefix/command" \
+ --sbindir="$prefix/command" \
+ --infodir="$prefix/info" \
+ --localedir="$prefix/locale" \
+ --mandir="$prefix/man" \
+ --libdir="$prefix/library" \
+ --docdir="$prefix/doc/ocaml" \
+ --datadir="$prefix/data" \
+ --datarootdir="$prefix/data" \
+ --localstatedir='/var/pthbs' \
+ "$@"
+
+}
+
+autotools_config_static() {
+ build_env_static
+ autotools_config "$@" --enable-static --disable-shared
+}
+prefix=/versions/$pthbs_package
+dest=${pthbs_destdir%/}${prefix}
+cd 'ocaml-5.4.0'
+
+
+
+
+autotools_config_static --enable-native-compiler --enable-native-toplevel --enable-installing-bytecode-programs
+
+
+make -j${JOBS:-1} -l$((1+${JOBS:-1}))
+
+make DESTDIR="$pthbs_destdir" install
+
+
+
+check_static command/ocamlopt
+
+
+cd "$pthbs_destdir/versions/$pthbs_package"
+find -type d -o -print | awk -F/ '
+BEGIN {
+ x["./command/ocamlopt"]=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 == "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
@@ -0,0 +1,2 @@
+#!/usr/bin/env pthbs-build
+#+ocaml.1d679d5d7687254c5489ee97731e63c4168c166c22d2e4b039554fc8464b5733+
\ No newline at end of file