From 8f92410deab90d5a518d3edc899baead93441d4b Mon Sep 17 00:00:00 2001 From: Thomas Gazagnaire Date: Tue, 18 Jul 2017 15:10:08 +0200 Subject: [PATCH 1/2] Import opam file from opam-repository --- opam | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/opam b/opam index 35d15ba..200a3ca 100644 --- a/opam +++ b/opam @@ -20,20 +20,22 @@ depends: [ "topkg" {build} "cpuid" {build} "ocb-stubblr" {build} + "ppx_deriving" {build} "ppx_sexp_conv" {build} "ounit" {test} - "cstruct" + "cstruct" {>="2.4.0"} + "cstruct-lwt" "zarith" + "lwt" "sexplib" ("mirage-no-xen" | ("mirage-xen" & "mirage-entropy" & "zarith-xen")) ("mirage-no-solo5" | ("mirage-solo5" & "mirage-entropy" & "zarith-freestanding")) ] -depopts: [ "lwt" ] conflicts: [ "topkg" {<"0.8.0"} "ocb-stubblr" {<"0.1.0"} - "cstruct" {<"2.3.0"} "mirage-xen" {<"2.2.0"} + "sexplib" {="v0.9.0"} ] From 7165209ca2a1728f1298313a5cced4bd42831f44 Mon Sep 17 00:00:00 2001 From: Thomas Gazagnaire Date: Tue, 18 Jul 2017 15:05:41 +0200 Subject: [PATCH 2/2] compile nocrypto.mirage when mirage-entropy is installed --- opam | 8 +++++--- pkg/pkg.ml | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/opam b/opam index 200a3ca..c702c70 100644 --- a/opam +++ b/opam @@ -12,6 +12,7 @@ available: [ ocaml-version >= "4.02.0" ] build: ["ocaml" "pkg/pkg.ml" "build" "--pinned" "%{pinned}%" "--tests" "false" "--with-lwt" "%{lwt:installed}%" "--xen" "%{mirage-xen:installed}%" + "--mirage" "%{mirage-entropy:installed}%" "--freestanding" "%{mirage-solo5:installed}%"] depends: [ @@ -28,14 +29,15 @@ depends: [ "zarith" "lwt" "sexplib" - ("mirage-no-xen" | ("mirage-xen" & "mirage-entropy" & "zarith-xen")) - ("mirage-no-solo5" | ("mirage-solo5" & "mirage-entropy" & "zarith-freestanding")) + ("mirage-no-xen" | ("mirage-xen" & "zarith-xen")) + ("mirage-no-solo5" | ("mirage-solo5" & "zarith-freestanding")) ] +depopts: ["mirage-entropy"] + conflicts: [ "topkg" {<"0.8.0"} "ocb-stubblr" {<"0.1.0"} "mirage-xen" {<"2.2.0"} "sexplib" {="v0.9.0"} ] - diff --git a/pkg/pkg.ml b/pkg/pkg.ml index e0082f3..ff7654c 100755 --- a/pkg/pkg.ml +++ b/pkg/pkg.ml @@ -15,6 +15,8 @@ let xen = Conf.(key "xen" bool ~absent:false ~doc:"Build Mirage/Xen support.") let fs = Conf.(key "freestanding" bool ~absent:false ~doc:"Build Mirage/Solo5 support.") +let mir = Conf.(key "mirage" bool ~absent:false + ~doc:"Build Mirage support.") let accelerate = Conf.(discovered_key "accelerate" bool ~absent:cpudetect ~env:"NOCRYPTO_ACCELERATE" @@ -40,11 +42,12 @@ let () = let lwt = Conf.value c lwt && unix and xen = Conf.value c xen and fs = Conf.value c fs in + let mir = Conf.value c mir in Ok [ Pkg.clib "src/libnocrypto_stubs.clib"; Pkg.mllib "src/nocrypto.mllib"; Pkg.mllib ~cond:unix "unix/nocrypto_unix.mllib"; Pkg.mllib ~cond:lwt "lwt/nocrypto_lwt.mllib"; - Pkg.mllib ~cond:(xen||fs) "mirage/nocrypto_mirage.mllib"; + Pkg.mllib ~cond:mir "mirage/nocrypto_mirage.mllib"; Pkg.test "tests/testrunner"; Pkg.test ~run:false "bench/speed"; mirage ~xen ~fs "src/libnocrypto_stubs.clib"; ]