better pin-depends

This commit is contained in:
swrup 2026-04-14 20:16:45 +02:00 committed by Swrup
parent b1a8a2da5f
commit 3124ffb4ad
4 changed files with 97 additions and 78 deletions

View file

@ -1,46 +1,14 @@
storage=secmod.fat
service=tap0
vendors_list := \
mkernel zarith bstr mnet mirage-crypto-rng-mkernel gmp digestif \
kdf utcp flux h1 httpcats mhttp multipart_form-miou prettym tls \
x509 vifu cachet mfat caqti \
base32 cohttp mirage-mtime mirage-ptime
setup-switch:
opam switch create mte ocaml.5.4.1
opam update
opam install --yes . --deps-only
check-kvm:
$(if $(wildcard /dev/kvm),,$(error KVM support not enabled))
pin-deps:
#opam pin --no-action --yes "git+https://github.com/robur-coop/mcrunch.git#682ed63c03e3be5664f96c469a260e1d9e9df011"
opam pin --no-action --yes "git+https://github.com/mirage/Zarith.git#zarith-1.14"
opam pin --no-action --yes add mhttp "git+https://github.com/robur-coop/mhttp.git#b2e55ae693b07ad3ef87c26c37c8f5d14c2e205c"
opam pin --no-action --yes add vif "git+https://github.com/swrup/vif.git#1b16040ba06c6af82019f02811e781e81084d269"
opam pin --no-action --yes add vifu "git+https://github.com/swrup/vif.git#1b16040ba06c6af82019f02811e781e81084d269"
opam pin --no-action --yes add mfat "git+https://github.com/robur-coop/mfat.git#5b1204d914e853f0139c6d2776511f530b753550"
opam pin --no-action --yes add mirage-mtime "git+https://github.com/swrup/mirage-mtime.git#6a6bb4dd25624a3c43e6417dcdf73f3c689946a7"
opam pin --no-action --yes add caqti "git+https://github.com/swrup/ocaml-caqti.git#186650581efd9d247ced982cdefd74256905e3b0"
opam pin --no-action --yes add caqti-miou "git+https://github.com/swrup/ocaml-caqti.git#186650581efd9d247ced982cdefd74256905e3b0"
opam pin --no-action --yes add caqti-mnet "git+https://github.com/swrup/ocaml-caqti.git#186650581efd9d247ced982cdefd74256905e3b0"
opam pin --no-action --yes add caqti-driver-pgx "git+https://github.com/swrup/ocaml-caqti.git#186650581efd9d247ced982cdefd74256905e3b0"
opam pin --no-action --yes "git+https://github.com/robur-coop/mnet.git#7e07437cda26f8efd3da0c4d14d76293d8fcbc78"
install-deps:
# opam install --yes mcrunch
opam install --yes dune utop merlin ocp-browser ocamlformat
opam install --yes solo5 ocaml-solo5
opam install --yes crunch
opam install --yes mirage-mtime
opam install --yes sqlite3 # needed for caqti even if not used
opam install --yes caqti-driver-pgx
opam install --yes caqti-mnet
opam install --yes $(vendors_list)
.PHONY: vendors
vendors:
vendors: source.sh
@mkdir -p vendors
@for v in $(vendors_list); do \
[ -d vendors/$$v ] || opam source $$v --dir vendors/$$v ; \
done
@./source.sh
.PHONY: clean
clean:
@ -53,12 +21,10 @@ assets:
secmod.fat:
mfat make --sectors=2048 $(storage)
init: clean pin-deps install-deps vendors assets fat-image
manifest:
src/manifest.json:
@dune exec src/mte.exe > src/manifest.json
build: manifest
build: vendors
@dune build @all
@dune build --workspace dune-workspace.solo5 src/mte.exe

View file

@ -1,49 +1,72 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "MTE - the MirageOS Taler Exchange"
authors: ["Olivier Pierre <swrup@protonmail.com>"]
maintainer: ["Olivier Pierre <swrup@protonmail.com>"]
license: "AGPL-3.0-only"
description:
"A GNU Taler exchange implementation with the unikernel framework MirageOS"
maintainer: ["Olivier Pierre <swrup@protonmail.com>"]
authors: ["Olivier Pierre <swrup@protonmail.com>"]
license: "AGPL-3.0-only"
tags: ["GNU Taler" "MirageOS" "unikernel" "OCaml" "crypto"]
homepage: "https://forge.kumikode.org/swrup/mte"
dev-repo: "git+https://forge.kumikode.org/swrup/mte.git"
bug-reports: "https://forge.kumikode.org/swrup/mte/issues"
depends: [
"dune" {>= "3.20"}
"ocaml" {>= "5.3"}
"ocaml" {>= "5.4.1"}
"solo5"
"ocaml-solo5"
"crunch"
"base32"
"angstrom"
"fmt"
"logs"
"fpath"
"cohttp"
"bin"
"bytesrw"
"jsont"
"digestif"
"kdf"
"zarith"
"eqaf"
"mirage-crypto-ec"
"mirage-crypto-pk"
"ptime"
"uri"
"vifu"
"vif"
"mnet"
"mnet-tls"
"mnet-happy-eyeballs"
"mnet-dns"
"mirage-mtime"
"mhttp-server"
"mhttp-client"
"mhttp"
"mfat"
"caqti"
"caqti-miou"
"caqti-mnet"
"caqti-driver-pgx"
"crunch"
"vif"
"jsont"
"cohttp"
"fmt"
"bin"
"angstrom"
"mirage-crypto"
"kdf"
"digestif"
"duration"
"jsont"
"cohttp"
"ptime"
"logs"
"ocamlformat" {with-dev-setup}
"odoc" {with-doc}
"pgx"
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
[make "build"]
]
pin-depends: [
[ "zarith.dev" "git+https://github.com/mirage/Zarith.git#df8969d9bb95cffca13e31a615189ab27ada0684" ]
[ "mnet.dev" "git+https://github.com/robur-coop/mnet.git#7e07437cda26f8efd3da0c4d14d76293d8fcbc78" ]
[ "mnet-tls.dev" "git+https://github.com/robur-coop/mnet.git#7e07437cda26f8efd3da0c4d14d76293d8fcbc78" ]
[ "mnet-happy-eyeballs.dev" "git+https://github.com/robur-coop/mnet.git#7e07437cda26f8efd3da0c4d14d76293d8fcbc78" ]
[ "mnet-dns.dev" "git+https://github.com/robur-coop/mnet.git#7e07437cda26f8efd3da0c4d14d76293d8fcbc78" ]
[ "mhttp.dev" "git+https://github.com/robur-coop/mhttp.git#57df8883ad0b4dfd81812d297f26259f9efa2880" ]
[ "mhttp-client.dev" "git+https://github.com/robur-coop/mhttp.git#57df8883ad0b4dfd81812d297f26259f9efa2880" ]
[ "mhttp-server.dev" "git+https://github.com/robur-coop/mhttp.git#57df8883ad0b4dfd81812d297f26259f9efa2880" ]
[ "vif.dev" "git+https://github.com/robur-coop/vif.git#0be5b5b90a41e1b974be3793fda96b408bd0e945" ]
[ "vifu.dev" "git+https://github.com/robur-coop/vif.git#0be5b5b90a41e1b974be3793fda96b408bd0e945" ]
[ "mirage-mtime.dev" "git+https://github.com/swrup/mirage-mtime.git#6a6bb4dd25624a3c43e6417dcdf73f3c689946a7" ]
[ "caqti.dev" "git+https://github.com/swrup/ocaml-caqti.git#34defd3dd86797eb1e2cdb2de3c6ac27ac87f2b7" ]
[ "caqti-miou.dev" "git+https://github.com/swrup/ocaml-caqti.git#34defd3dd86797eb1e2cdb2de3c6ac27ac87f2b7" ]
[ "caqti-mnet.dev" "git+https://github.com/swrup/ocaml-caqti.git#34defd3dd86797eb1e2cdb2de3c6ac27ac87f2b7" ]
[ "caqti-driver-pgx.dev" "git+https://github.com/swrup/ocaml-caqti.git#34defd3dd86797eb1e2cdb2de3c6ac27ac87f2b7" ]
[ "mfat.dev" "git+https://github.com/swrup/mfat.git#ab53147fbbc1ec661ed33263eea7313b0ae96433" ]
]
x-maintenance-intent: ["(latest)"]

30
source.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
[ ! -d vendors ] && mkdir vendors
[ -d vendors/zarith ] || opam source zarith --dir vendors/zarith
[ -d vendors/gmp ] || opam source gmp --dir vendors/gmp
[ -d vendors/bstr ] || opam source bstr --dir vendors/bstr
[ -d vendors/kdf ] || opam source kdf --dir vendors/kdf
[ -d vendors/digestif ] || opam source digestif --dir vendors/digestif
[ -d vendors/mirage-crypto-rng-mkernel ] || opam source mirage-crypto-rng-mkernel --dir vendors/mirage-crypto-rng-mkernel
[ -d vendors/mkernel ] || opam source mkernel --dir vendors/mkernel
[ -d vendors/mnet ] || opam source mnet --dir vendors/mnet
[ -d vendors/utcp ] || opam source utcp --dir vendors/utcp
[ -d vendors/flux ] || opam source flux --dir vendors/flux
[ -d vendors/h1 ] || opam source h1 --dir vendors/h1
[ -d vendors/httpcats ] || opam source httpcats --dir vendors/httpcats
[ -d vendors/mhttp ] || opam source mhttp --dir vendors/mhttp
[ -d vendors/multipart_form-miou ] || opam source multipart_form-miou --dir vendors/multipart_form-miou
[ -d vendors/prettym ] || opam source prettym --dir vendors/prettym
[ -d vendors/tls ] || opam source tls --dir vendors/tls
[ -d vendors/x509 ] || opam source x509 --dir vendors/x509
[ -d vendors/vifu ] || opam source vifu --dir vendors/vifu
[ -d vendors/cachet ] || opam source cachet --dir vendors/cachet
[ -d vendors/mfat ] || opam source mfat --dir vendors/mfat
[ -d vendors/base32 ] || opam source base32 --dir vendors/base32
[ -d vendors/cohttp ] || opam source cohttp --dir vendors/cohttp
[ -d vendors/mirage-mtime ] || opam source mirage-mtime --dir vendors/mirage-mtime
[ -d vendors/mirage-ptime ] || opam source mirage-ptime --dir vendors/mirage-ptime
[ -d vendors/caqti ] || opam source caqti --dir vendors/caqti
# avoid caqti-driver-sqlite3 dune rule error on "sqlite3" package not found
rm -r vendors/caqti/caqti-driver-sqlite3

View file

@ -121,5 +121,5 @@ mte-offline-tool upload --input $b --url $url"/management/drain"
echo "[OK] /management/drain"
mte-offline-tool download --output $a --url $url"/keys"
mte-validate keys $a
dune exec test/validate.exe -- keys $a
echo "[OK] /keys validation"