export XDG_CACHE_HOME="$PWD/.cache" # Set the default platform for the purposes of solving dependencies so that the # output of tests is platform-independent. export DUNE_CONFIG__OS=linux export DUNE_CONFIG__ARCH=x86_64 export DUNE_CONFIG__OS_FAMILY=debian export DUNE_CONFIG__OS_DISTRIBUTION=ubuntu export DUNE_CONFIG__OS_VERSION=24.11 export DUNE_CONFIG__SYS_OCAML_VERSION=5.4.0+fake dune="dune" pkg_root="_build/_private/default/.pkg" build_pkg() { $dune build $pkg_root/$1/target/ } show_pkg() { find $pkg_root/$1 | sort | sed "s#$pkg_root/$1##" } strip_sandbox() { sed -E 's#[^ ]*.sandbox/[^/]+#$SANDBOX#g' } show_pkg_targets() { find $pkg_root/$1/target | sort | sed "s#$pkg_root/$1/target##" } show_pkg_cookie() { $dune internal dump $pkg_root/$1/target/cookie } mock_packages="mock-opam-repository/packages" mkrepo() { mkdir -p $mock_packages } mkpkg() { name=$1 if [ "$#" -eq "1" ] then version="0.0.1" else version="$2" fi mkdir -p $mock_packages/$name/$name.$version echo 'opam-version: "2.0"' > $mock_packages/$name/$name.$version/opam cat >>$mock_packages/$name/$name.$version/opam } add_mock_repo_if_needed() { # default, but can be overridden, e.g. if git is required repo="${1:-file://$(pwd)/mock-opam-repository}" if [ ! -e dune-workspace ] then cat >dune-workspace < /dev/null dune-workspace then # add the repo definition cat >>dune-workspace <>dune-workspace <$f } solve_project() { cat >dune-project add_mock_repo_if_needed dune pkg lock $@ } make_lockdir() { mkdir -p dune.lock cat >dune.lock/lock.dune <