From 2493d38334ba194249e96946d0035ad9e6a5a1da Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 18:38:29 +0000 Subject: [PATCH 01/10] add ocaml v5.2.1 --- recipes/devel/ocaml.yaml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 recipes/devel/ocaml.yaml diff --git a/recipes/devel/ocaml.yaml b/recipes/devel/ocaml.yaml new file mode 100644 index 0000000..9196347 --- /dev/null +++ b/recipes/devel/ocaml.yaml @@ -0,0 +1,44 @@ +inherit: [autotools, autoconf] + +metaEnvironment: + PKG_VERSION: "5.3.0" + +checkoutSCM: + scm: url + url: https://github.com/ocaml/ocaml/archive/refs/tags/${PKG_VERSION}.tar.gz + digestSHA256: eb9eab2f21758d3cfb1e78c7f83f0b4dd6302824316aba4abee047a5a4f85029 + stripComponents: 1 + +buildTools: [m4, autotools] +buildVars: [STRIP] +buildScript: | + rsync -a --delete $1/ . + mkdir -p .bob + pushd .bob + ln -s $(which ${STRIP}) strip + popd + export PATH=${PATH}:$(pwd)/.bob + + ./configure \ + ${AUTOCONF_BUILD:+--build=${AUTOCONF_BUILD}} \ + ${AUTOCONF_HOST:+--host=${AUTOCONF_HOST}} \ + ${AUTOCONF_TARGET:+--target=${AUTOCONF_TARGET}} \ + --prefix="/usr" \ + --sysconfdir="/etc" \ + --localstatedir="/var" \ + --libdir=/usr/lib \ + --enable-shared --enable-static \ + --enable-unix-lib \ + --without-zstd + + makeParallel V=1 + make install DESTDIR=$(pwd)/install + +packageScript: | + rsync -a --delete $1/install/ . + pushd usr/bin + find . -type f -exec sed -i 's@#!/usr/bin/ocamlrun@#!/usr/bin/env ocamlrun@g' {} \; + popd + +provideTools: + ocaml: "usr/bin" From 62473f045649d08d0eb4fde175c055d6ae8d1d17 Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 18:40:07 +0000 Subject: [PATCH 02/10] add ocamlfind v1.9.8 --- recipes/devel/ocamlfind.yaml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 recipes/devel/ocamlfind.yaml diff --git a/recipes/devel/ocamlfind.yaml b/recipes/devel/ocamlfind.yaml new file mode 100644 index 0000000..ac977d7 --- /dev/null +++ b/recipes/devel/ocamlfind.yaml @@ -0,0 +1,52 @@ +inherit: [autotools] + +metaEnvironment: + PKG_VERSION: "1.9.8" + +depends: + - libs::zstd-dev + - use: [] + depends: + - libs::zstd-tgt + +checkoutSCM: + scm: url + url: https://github.com/ocaml/ocamlfind/archive/refs/tags/findlib-${PKG_VERSION}.tar.gz + digestSHA256: d6899935ccabf67f067a9af3f3f88d94e310075d13c648fa03ff498769ce039d + stripComponents: 1 + +buildTools: [ocaml] +buildScript: | + export OCAMLLIB=${BOB_TOOL_PATHS['ocaml']}/../lib + export CAML_LD_LIBRARY_PATH=${BOB_TOOL_PATHS['ocaml']}/../lib + rsync -a --delete $1/ __src__ + + mkdir -p .bob/ocaml_wrappers + cat > .bob/ocaml_wrappers/ocamlc << EOF + #!/bin/bash + if [[ "\$@" =~ '-custom' ]]; then + exec ${BOB_TOOL_PATHS[ocaml]}/ocamlc \$@ + else + exec ${BOB_TOOL_PATHS[ocaml]}/ocamlc -use-runtime $(which ocamlrun) \$@ + fi + EOF + chmod +x .bob/ocaml_wrappers/* + + export PATH=$(pwd)/.bob/ocaml_wrappers:${PATH} + + pushd __src__ + ./configure \ + -bindir "/usr/bin/" \ + -sitelib "/usr/lib/" \ + -mandir "/usr/man/" \ + -with-relative-paths-at "/" \ + -no-topfind + makeParallel + make install DESTDIR=$(pwd)/../install + popd + +packageScript: | + rsync -a --delete $1/install/ . + +provideTools: + ocamlfind: "usr/bin" From 06710a151cb4e2fa554260bd2d9318b6e13d4958 Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 18:41:10 +0000 Subject: [PATCH 03/10] add ocaml helper class This class builds the OCAMLPATH wich is required by ocaml to find the dependencies. Also a helper to replace the fixed ocamlrun interpreter is provided. --- classes/ocaml.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 classes/ocaml.yaml diff --git a/classes/ocaml.yaml b/classes/ocaml.yaml new file mode 100644 index 0000000..6b45087 --- /dev/null +++ b/classes/ocaml.yaml @@ -0,0 +1,25 @@ +buildTools: [ocaml, ocamlfind] +buildSetup: | + export OCAMLLIB=${BOB_TOOL_PATHS['ocaml']}/../lib + export OCAMLFIND_CONF=${BOB_TOOL_PATHS['ocamlfind']}/../local/etc/findlib.conf + + OCAMLPATH=${OCAMLPATH:-""} + for i in "${@:2}" ; do + for j in $i/usr/lib/* ; do + if [[ -d "$j" ]] ; then + if [ -e "$j/META" ] ; then + OCAMLPATH+="" + OCAMLPATH+="${OCAMLPATH:+:}$i/usr/lib" + fi + fi + done + done + + [ -z "${OCAMLPATH:+true}" ] || export OCAMLPATH + +packageSetup: | + ocamlFixupInstall() { + find . -type f -exec \ + sed -i "s@#!${BOB_TOOL_PATHS[ocaml]}/ocamlrun@#!/usr/bin/env ocamlrun@g" \ + {} \; + } From 2ca83e017c558cf791f89fe2c9337b5f2e04784f Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 18:48:01 +0000 Subject: [PATCH 04/10] add csexp v1.5.2 --- recipes/libs/csexp.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 recipes/libs/csexp.yaml diff --git a/recipes/libs/csexp.yaml b/recipes/libs/csexp.yaml new file mode 100644 index 0000000..583c30b --- /dev/null +++ b/recipes/libs/csexp.yaml @@ -0,0 +1,27 @@ +inherit: [install] + +metaEnvironment: + PKG_VERSION: "1.5.2" + +checkoutSCM: + scm: url + url: https://github.com/ocaml-dune/csexp/archive/refs/tags/${PKG_VERSION}.tar.gz + digestSHA256: de3fda861ec8210a404fcb76afa162b08ed1cd11228645c78b53e1f82b24e236 + stripComponents: 1 + +buildTools: [dune, ocaml, target-toolchain] +buildSetup: | + export OCAMLLIB=${BOB_TOOL_PATHS['ocaml']}/../lib +buildScript: | + mkdir -p build && pushd build + rsync -aH $1/ . + dune build -p csexp + dune install --prefix "/usr" --dest $(pwd)/../install --relocatable + +multiPackage: + dev: + packageScript: | + rsync -a --delete $1/install/ . + tgt: + packageScript: | + installPackageTgt From 3854f154dae16a9956f1e1f3feabc8b5a4964bed Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 18:45:54 +0000 Subject: [PATCH 05/10] add dune v3.17.1 --- recipes/devel/dune.yaml | 78 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 recipes/devel/dune.yaml diff --git a/recipes/devel/dune.yaml b/recipes/devel/dune.yaml new file mode 100644 index 0000000..71a098a --- /dev/null +++ b/recipes/devel/dune.yaml @@ -0,0 +1,78 @@ +inherit: [cpackage, make] + +metaEnvironment: + PKG_VERSION: "3.17.2" + +depends: + - libs::zstd-dev + - use: [] + depends: + - libs::zstd-tgt + +checkoutSCM: + scm: url + url: https://github.com/ocaml/dune/archive/refs/tags/${PKG_VERSION}.tar.gz + digestSHA256: 1b45e34d1eacf40be569e4d7ad055508a3242637b098327c91f7ce67772a1889 + stripComponents: 1 + +multiPackage: + configurator: + depends: + - libs::csexp-dev + + buildTools: [ocaml, dune, ocamlfind] + buildSetup: | + export OCAMLLIB=${BOB_TOOL_PATHS['ocaml']}/../lib + buildScript: | + rsync -a --delete $1/ . + dune build dune-configurator.install + dune install dune-configurator \ + --prefix "/usr" \ + --dest $(pwd)/install + multiPackage: + dev: + provideDeps: ['*-dev'] + packageScript: | + rsync -a --delete $1/install/ . + tgt: + provideDeps: ['*-tgt'] + packageScript: + installPackageTgt $1/install + stdune: + buildTools: [ocaml, dune, ocamlfind] + buildSetup: | + export OCAMLLIB=${BOB_TOOL_PATHS['ocaml']}/../lib + buildScript: | + rsync -a --delete $1/ . + dune build stdune.install + dune install stdune \ + --prefix "/usr" \ + --dest $(pwd)/install + multiPackage: + dev: + provideDeps: ['*-dev'] + packageScript: | + rsync -a --delete $1/install/ . + tgt: + provideDeps: ['*-tgt'] + packageScript: + installPackageTgt $1/install + + "": + inherit: [strip] + buildTools: [ocaml] + buildSetup: | + export OCAMLLIB=${BOB_TOOL_PATHS['ocaml']}/../lib + buildScript: | + rsync -a --delete $1/ . + + ./configure \ + --toolchains enable + makeParallel release V=1 + make install DESTDIR=$(pwd)/install PREFIX="/usr" + + packageScript: | + rsync -a --delete $1/install/ . + stripAll . + provideTools: + dune: "usr/bin" From f25928f0a0ccf8bb61a9cb0b5a4c7a974da3bbad Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 19:59:24 +0000 Subject: [PATCH 06/10] add bigarray-compat v1.1.0 --- recipes/libs/bigarray-compat.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 recipes/libs/bigarray-compat.yaml diff --git a/recipes/libs/bigarray-compat.yaml b/recipes/libs/bigarray-compat.yaml new file mode 100644 index 0000000..c9217d0 --- /dev/null +++ b/recipes/libs/bigarray-compat.yaml @@ -0,0 +1,25 @@ +inherit: [ocaml, install] + +metaEnvironment: + PKG_VERSION: "1.1.0" + +checkoutSCM: + scm: url + url: https://github.com/mirage/bigarray-compat/archive/refs/tags/v${PKG_VERSION}.tar.gz + digestSHA256: cf09354986d1ab7d506949f58e73dd72be8aedb241c1593381c18e92a70c0bb1 + stripComponents: 1 + +buildTools: [dune, ocaml, target-toolchain] +buildScript: | + rsync -a --delete $1/ . + dune build + dune install --prefix "/usr" \ + --dest $(pwd)/install + +multiPackage: + dev: + packageScript: | + rsync -a --delete $1/install/ . + tgt: + packageScript: | + installPackageTgt $1/install From dabe226f1265704db6a874079597526a127cd58f Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 20:00:42 +0000 Subject: [PATCH 07/10] add stdlib-shims v0.3.0 --- recipes/libs/stdlib-shims.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 recipes/libs/stdlib-shims.yaml diff --git a/recipes/libs/stdlib-shims.yaml b/recipes/libs/stdlib-shims.yaml new file mode 100644 index 0000000..027bee1 --- /dev/null +++ b/recipes/libs/stdlib-shims.yaml @@ -0,0 +1,25 @@ +inherit: [ocaml, install] + +metaEnvironment: + PKG_VERSION: "0.3.0" + +checkoutSCM: + scm: url + url: https://github.com/ocaml/stdlib-shims/archive/refs/tags/${PKG_VERSION}.tar.gz + digestSHA256: 6d0386313a021146300011549180fcd4e94f7ac3c3bf021ff165f6558608f0c2 + stripComponents: 1 + +buildTools: [dune, ocaml, target-toolchain] +buildScript: | + rsync -a --delete $1/ . + dune build + dune install --prefix "/usr" \ + --dest $(pwd)/install + +multiPackage: + dev: + packageScript: | + rsync -a --delete $1/install/ . + tgt: + packageScript: | + installPackageTgt $1/install From b24064d95addd28f724d55d000a46371d71f782e Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 20:01:29 +0000 Subject: [PATCH 08/10] add ocaml-integers v0.7.0 --- recipes/libs/ocaml-integers.yaml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 recipes/libs/ocaml-integers.yaml diff --git a/recipes/libs/ocaml-integers.yaml b/recipes/libs/ocaml-integers.yaml new file mode 100644 index 0000000..3c4bf31 --- /dev/null +++ b/recipes/libs/ocaml-integers.yaml @@ -0,0 +1,33 @@ +inherit: [ocaml, install] + +metaEnvironment: + PKG_VERSION: "0.7.0" + +depends: + - libs::stdlib-shims-dev + - use: [] + depends: + - libs::stdlib-shims-tgt + +checkoutSCM: + scm: url + url: https://github.com/yallop/ocaml-integers/archive/refs/tags/${PKG_VERSION}.tar.gz + digestSHA256: 8bb517fa9a1818246eb8c4ce34ee1489fbebb4b92defa3a25d13cab8d23ec685 + stripComponents: 1 + +buildTools: [dune, ocaml, target-toolchain] +buildScript: | + rsync -a --delete $1/ . + dune build + dune install --prefix "/usr" \ + --dest $(pwd)/install + +multiPackage: + dev: + provideDeps: ['*-dev'] + packageScript: | + rsync -a --delete $1/install/ . + tgt: + provideDeps: ['*-tgt'] + packageScript: | + installPackageTgt $1/install From 9f2673e655786042002307780f2ed266bb5bcbdb Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 20:03:03 +0000 Subject: [PATCH 09/10] add ocaml-ctypes v0.23.0 --- recipes/libs/ocaml-ctypes.yaml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 recipes/libs/ocaml-ctypes.yaml diff --git a/recipes/libs/ocaml-ctypes.yaml b/recipes/libs/ocaml-ctypes.yaml new file mode 100644 index 0000000..eb382ef --- /dev/null +++ b/recipes/libs/ocaml-ctypes.yaml @@ -0,0 +1,41 @@ +inherit: [make, cpackage, ocaml] + +metaEnvironment: + PKG_VERSION: "0.23.0" + +depends: + - name: devel::dune + tools: + target-toolchain: host-compat-toolchain + use: [tools] + forward: True + - devel::dune-configurator-dev + - devel::dune-stdune-dev + - libs::bigarray-compat-dev + - libs::ocaml-integers-dev + +checkoutSCM: + scm: url + url: https://github.com/yallop/ocaml-ctypes/archive/refs/tags/${PKG_VERSION}.tar.gz + digestSHA256: cae47d815b27dd4c824a007f1145856044542fe2588d23a443ef4eefec360bf1 + stripComponents: 1 + +buildTools: [dune, ocaml, target-toolchain] +buildSetup: | + export OCAMLLIB=${BOB_TOOL_PATHS['ocaml']}/../lib +buildScript: | + rsync -a --delete $1/ . + dune build ctypes.install + dune install ctypes \ + --prefix "/usr" \ + --dest $(pwd)/install + +multiPackage: + dev: + provideDeps: ['*-dev'] + packageScript: | + rsync -a --delete $1/install/ . + tgt: + provideDeps: ['*-tgt'] + packageScript: | + installPackageTgt $1/install From f2cdb92d18bdbb6f06530c87fe02ddfd000cc2e9 Mon Sep 17 00:00:00 2001 From: Ralf Hubert Date: Tue, 21 Jan 2025 20:07:07 +0000 Subject: [PATCH 10/10] add opam v2.3.0 --- recipes/devel/opam.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 recipes/devel/opam.yaml diff --git a/recipes/devel/opam.yaml b/recipes/devel/opam.yaml new file mode 100644 index 0000000..befecc6 --- /dev/null +++ b/recipes/devel/opam.yaml @@ -0,0 +1,33 @@ +inherit: [autotools] + +metaEnvironment: + PKG_VERSION: "2.3.0" + +checkoutSCM: + scm: git + url: git@gitlab.lab.dd.secunet.de:hubert/opam.git + tag: ${PKG_VERSION} + commit: e13109411952d4f723a165c2a24b8c03c4945041 + +buildTools: [ocaml] +buildScript: | + rsync -a --delete $1/ . + ./configure \ + ${AUTOCONF_BUILD:+--build=${AUTOCONF_BUILD}} \ + ${AUTOCONF_HOST:+--host=${AUTOCONF_HOST}} \ + ${AUTOCONF_TARGET:+--target=${AUTOCONF_TARGET}} \ + --prefix="/usr" \ + --sysconfdir="/etc" \ + --localstatedir="/var" \ + --libdir=/usr/lib \ + --without-mccs \ + --without-dune \ + --disable-checks \ + makeParallel + make install DESTDIR=$(pwd)/install + +packageScript: + autotoolsPackageBin + +provideTools: + opam: "usr/bin"