From ee7305febb4486e40bae6d2e791dc9fbe51ee5d2 Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Mon, 26 Mar 2018 16:07:45 +0200 Subject: [PATCH 1/3] pack+package: workaround ocamlbuild#272 ocamlbuild should pass -package(...) flags to ocamlfind when building a -pack-ed file, see https://github.com/ocaml/opam-repository/pull/11628#issuecomment-375697444 --- myocamlbuild.ml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/myocamlbuild.ml b/myocamlbuild.ml index 8fcbe33..a0964eb 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -1,5 +1,13 @@ open Ocamlbuild_plugin +let ocamlfind_and_pack = function + | After_rules -> + if !Options.use_ocamlfind then + pflag ["ocaml"; "pack"] "package" + (fun pkg -> S [A "-package"; A pkg]); + | _ -> () + let () = dispatch Ocb_stubblr.( init & ccopt ~tags:["accelerate"] "-DACCELERATE -mssse3 -maes -mpclmul" + & ocamlfind_and_pack ) From a9da8a8883e05460dc98ad8dd616aad46bb82741 Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Mon, 26 Mar 2018 16:09:16 +0200 Subject: [PATCH 2/3] add missing runtime dependencies in _tags Binaries in , depend on the runtime libraries within ppx_sexp_conv and ocplib-endian. The packed modules also depend on the package ppx_sexp_conv: its presence at pack-creation time influences the generated .cmi interface, see https://github.com/ocaml/opam-repository/pull/11628#issuecomment-375697444 Note: the package ppx_sexp_conv.runtime-lib would suffice, but it is only available as such under recent ppx_sexp_conv versions, so its explicit use would make the build description (needlessly) incompatible with older ppx_sexp_conv versions. --- _tags | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_tags b/_tags index f3092d9..50dbad0 100644 --- a/_tags +++ b/_tags @@ -4,9 +4,10 @@ true: warn(A-4-29-33-40-41-42-43-34-44-48) true: package(bytes cstruct) : include -: package(zarith sexplib ppx_sexp_conv) +: package(zarith sexplib ppx_sexp_conv ocplib-endian) and not : for-pack(Nocrypto) : link_stubs(src/libnocrypto_stubs) +: package(ppx_sexp_conv) : include : package(unix bytes) @@ -20,7 +21,7 @@ true: package(bytes cstruct) <**/*.c>: ccopt(-D_DEFAULT_SOURCE --std=c99 -Wall -Wextra -O3) <**/aes_aesni.c>: ccopt(-Wno-implicit-fallthrough) -: use_nocrypto, package(zarith) -: use_nocrypto, package(zarith oUnit) +: use_nocrypto, package(zarith ppx_sexp_conv ocplib-endian) +: use_nocrypto, package(zarith ppx_sexp_conv ocplib-endian oUnit) : -traverse From c62c315bad988ca6d02cde549db5da1f20951ddf Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Tue, 27 Mar 2018 12:00:23 +0200 Subject: [PATCH 3/3] add ppx_sexp_conv as a runtime dependency in the packaging metadata --- opam | 2 +- pkg/META | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opam b/opam index df74393..c65c703 100644 --- a/opam +++ b/opam @@ -26,7 +26,7 @@ depends: [ "cpuid" {build} "ocb-stubblr" {build} "ppx_deriving" {build} - "ppx_sexp_conv" {build} + "ppx_sexp_conv" "ounit" {test} "cstruct" {>="3.0.0" & <"3.2.0"} "zarith" diff --git a/pkg/META b/pkg/META index 64a1dbf..ee83faa 100644 --- a/pkg/META +++ b/pkg/META @@ -1,6 +1,6 @@ version = "%%VERSION_NUM%%" description = "Simple crypto for the modern age" -requires = "cstruct zarith sexplib" +requires = "cstruct zarith sexplib ppx_sexp_conv" archive(byte) = "nocrypto.cma" archive(native) = "nocrypto.cmxa" plugin(byte) = "nocrypto.cma"