From 4ee754b440328e22bc5a8ba3a79aa9b3295b2b32 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 20 Jun 2023 19:25:31 +0200 Subject: [PATCH] basic opam support --- interpreter/.gitignore | 1 + interpreter/Makefile | 3 +++ interpreter/dune | 4 ++-- interpreter/dune-project | 7 +++++++ interpreter/wasm.opam | 22 ++++++++++++++++++++++ 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 interpreter/wasm.opam diff --git a/interpreter/.gitignore b/interpreter/.gitignore index 8de9ec68d3..0a955945de 100644 --- a/interpreter/.gitignore +++ b/interpreter/.gitignore @@ -1,2 +1,3 @@ _build wasm +*.install diff --git a/interpreter/Makefile b/interpreter/Makefile index 02f5a8315b..d5509e036d 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -81,6 +81,9 @@ smallinttest: smallint dunetest: dune test +install: + dune build -p $(NAME) @install + dune install # Miscellaneous targets diff --git a/interpreter/dune b/interpreter/dune index f58f650710..6d56ae79d2 100644 --- a/interpreter/dune +++ b/interpreter/dune @@ -1,7 +1,7 @@ (include_subdirs unqualified) (library - (name wasm) + (public_name wasm) ; The 'wasm' module shall not be part of the library, as it would start the ; Wasm REPL every time in all the dependencies. ; We exclude the 'wast' module as it is only used for the JS build. @@ -9,7 +9,7 @@ (modules :standard \ wasm smallint wast)) (executable - (name wasm) + (public_name wasm) (modules wasm) (libraries wasm) (flags diff --git a/interpreter/dune-project b/interpreter/dune-project index c994249ac2..f579f3ce88 100644 --- a/interpreter/dune-project +++ b/interpreter/dune-project @@ -1 +1,8 @@ (lang dune 2.9) + +(name "wasm") + +(generate_opam_files true) + +(package + (name "wasm")) diff --git a/interpreter/wasm.opam b/interpreter/wasm.opam new file mode 100644 index 0000000000..09ef829e48 --- /dev/null +++ b/interpreter/wasm.opam @@ -0,0 +1,22 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +depends: [ + "dune" {>= "2.9"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "--promote-install-files=false" + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] + ["dune" "install" "-p" name "--create-install-files" name] +]