#!/bin/bash # Build script for OCaml alcotest library set -e # Find and enter the extracted source directory cd "$SRCDIR" # Ensure OCaml toolchain is in PATH export PATH="$PREFIX/bin:$PATH" # libatomic is at /usr/lib (hammerhead BSD layout) export LD_LIBRARY_PATH="/usr/lib:${LD_LIBRARY_PATH:-}" export LIBRARY_PATH="/usr/lib:${LIBRARY_PATH:-}" # Patch alcotest_stubs.c for illumos (add sys/termios.h for struct winsize) if [[ "$(uname -s)" == "SunOS" || "$(uname -s)" == "Hammerhead" ]]; then sed -i 's|#include |#include \n#include |' src/alcotest/alcotest_stubs.c fi # Build only the alcotest package (skip tests and optional deps) dune build -p alcotest # Install to package directory dune install alcotest --prefix=$PREFIX --destdir="$PKGDIR" # OCaml alcotest - Lightweight testing framework # https://github.com/mirage/alcotest [package] name = "ocaml-alcotest" version = "1.8.0" release = 1 description = "OCaml lightweight and colorful test framework" url = "https://github.com/mirage/alcotest" license = "ISC" maintainer = "Chris Tusa " arch = "x86_64" [dependencies] runtime = ["ocaml", "ocaml-fmt", "ocaml-astring", "ocaml-cmdliner", "ocaml-uutf", "ocaml-re", "ocaml-seq", "ocaml-stdlib-shims", "ocaml-syntax-shims"] build = ["ocaml", "dune", "ocaml-fmt", "ocaml-astring", "ocaml-cmdliner", "ocaml-uutf", "ocaml-re", "ocaml-seq", "ocaml-stdlib-shims", "ocaml-syntax-shims"] [[source]] file = "alcotest-1.8.0.tar.gz" urls = [ "https://github.com/mirage/alcotest/archive/refs/tags/1.8.0.tar.gz" ] checksum = "skip" extract = true [build] parallel = false