Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cad7cfe15ae8eca95c4e284f3a679c35842659f2 Mon Sep 17 00:00:00 2001
From 6f97531287a3e3ee749f2277248af28bdc85b8e4 Mon Sep 17 00:00:00 2001
From: Gabriel Scherer <[email protected]>
Date: Mon, 26 Mar 2018 16:09:16 +0200
Subject: [PATCH 2/6] add missing runtime dependencies in _tags
Subject: [PATCH 1/4] add missing runtime dependencies in _tags

Binaries in <bench/*>, <tests/*> depend on ppx_sexp_conv's runtime
library within ppx_sexp_conv.
Expand Down Expand Up @@ -43,5 +43,5 @@ index 6d4e7de..c2a6610 100644

<rondom>: -traverse
--
2.17.0
2.18.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 55fbc3531afde59ba34cde1c14d99704439756e6 Mon Sep 17 00:00:00 2001
From dc799fd2a66c41ca7729201a5d038cd403ca1de6 Mon Sep 17 00:00:00 2001
From: Gabriel Scherer <[email protected]>
Date: Tue, 27 Mar 2018 12:00:23 +0200
Subject: [PATCH 4/6] add ppx_sexp_conv as a runtime dependency in the
Subject: [PATCH 2/4] add ppx_sexp_conv as a runtime dependency in the
packaging metadata

---
Expand All @@ -27,13 +27,13 @@ index 242b2bb..a7929c7 100644
--- a/pkg/META
+++ b/pkg/META
@@ -1,6 +1,6 @@
version = "%%VERSION_NUM%%"
version = "0.5.4"
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"
--
2.17.0
2.18.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
From ad9278021a65d423e30765e58110848adda4b13e Mon Sep 17 00:00:00 2001
From: Jeremie Dimino <[email protected]>
Date: Fri, 11 May 2018 15:44:47 +0200
Subject: [PATCH 3/4] Auto-detect ppx_sexp_conv runtime library

---
myocamlbuild.ml | 25 ++++++++++++++++++++++---
pkg/META | 43 -------------------------------------------
pkg/META.in | 43 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 65 insertions(+), 46 deletions(-)
delete mode 100644 pkg/META
create mode 100644 pkg/META.in

diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index 2752315..7b29635 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -1,5 +1,24 @@
open Ocamlbuild_plugin

-let () = dispatch Ocb_stubblr.(
- init & ccopt ~tags:["accelerate"] "-DACCELERATE -msse2 -maes"
-)
+let runtime_deps_of_ppx ppx =
+ (Findlib.query "ppx_sexp_conv").dependencies
+ |> List.filter_opt (fun { Findlib.name; _ } ->
+ if name = ppx || name = "ppx_deriving" then
+ None
+ else
+ Some name)
+
+let () = dispatch (fun hook ->
+ Ocb_stubblr.(
+ init & ccopt ~tags:["accelerate"] "-DACCELERATE -msse2 -maes"
+ ) hook;
+ match hook with
+ | After_rules ->
+ let meta = "pkg/META" in
+ let meta_in = meta ^ ".in" in
+ rule meta ~dep:meta_in ~prod:meta (fun _ _ ->
+ let deps = String.concat " " (runtime_deps_of_ppx "ppx_sexp_conv") in
+ Echo([String.subst "PPX_SEXP_CONV_RUNTIME" deps
+ (Pathname.read meta_in)],
+ meta))
+ | _ -> ())
diff --git a/pkg/META b/pkg/META
deleted file mode 100644
index a7929c7..0000000
--- a/pkg/META
+++ /dev/null
@@ -1,43 +0,0 @@
-version = "0.5.4"
-description = "Simple crypto for the modern age"
-requires = "cstruct zarith sexplib ppx_sexp_conv"
-archive(byte) = "nocrypto.cma"
-archive(native) = "nocrypto.cmxa"
-plugin(byte) = "nocrypto.cma"
-plugin(native) = "nocrypto.cmxs"
-xen_linkopts = "-lnocrypto_stubs+mirage-xen"
-freestanding_linkopts = "-lnocrypto_stubs+mirage-freestanding"
-exists_if = "nocrypto.cma"
-
-package "unix" (
- version = "0.5.4"
- description = "Simple crypto for the modern age"
- requires = "nocrypto unix bytes"
- archive(byte) = "nocrypto_unix.cma"
- archive(native) = "nocrypto_unix.cmxa"
- plugin(byte) = "nocrypto_unix.cma"
- plugin(native) = "nocrypto_unix.cmxs"
- exists_if = "nocrypto_unix.cma"
-)
-
-package "lwt" (
- version = "0.5.4"
- description = "Simple crypto for the modern age"
- requires = "nocrypto nocrypto.unix lwt.unix cstruct.lwt"
- archive(byte) = "nocrypto_lwt.cma"
- archive(native) = "nocrypto_lwt.cmxa"
- plugin(byte) = "nocrypto_lwt.cma"
- plugin(native) = "nocrypto_lwt.cmxs"
- exists_if = "nocrypto_lwt.cma"
-)
-
-package "mirage" (
- version = "0.5.4"
- description = "Simple crypto for the modern age"
- requires = "nocrypto lwt mirage-entropy"
- archive(byte) = "nocrypto_mirage.cma"
- archive(native) = "nocrypto_mirage.cmxa"
- plugin(byte) = "nocrypto_mirage.cma"
- plugin(native) = "nocrypto_mirage.cmxs"
- exists_if = "nocrypto_mirage.cma"
-)
diff --git a/pkg/META.in b/pkg/META.in
new file mode 100644
index 0000000..0b263d7
--- /dev/null
+++ b/pkg/META.in
@@ -0,0 +1,43 @@
+version = "0.5.4"
+description = "Simple crypto for the modern age"
+requires = "cstruct zarith sexplib PPX_SEXP_CONV_RUNTIME"
+archive(byte) = "nocrypto.cma"
+archive(native) = "nocrypto.cmxa"
+plugin(byte) = "nocrypto.cma"
+plugin(native) = "nocrypto.cmxs"
+xen_linkopts = "-lnocrypto_stubs+mirage-xen"
+freestanding_linkopts = "-lnocrypto_stubs+mirage-freestanding"
+exists_if = "nocrypto.cma"
+
+package "unix" (
+ version = "0.5.4"
+ description = "Simple crypto for the modern age"
+ requires = "nocrypto unix bytes"
+ archive(byte) = "nocrypto_unix.cma"
+ archive(native) = "nocrypto_unix.cmxa"
+ plugin(byte) = "nocrypto_unix.cma"
+ plugin(native) = "nocrypto_unix.cmxs"
+ exists_if = "nocrypto_unix.cma"
+)
+
+package "lwt" (
+ version = "0.5.4"
+ description = "Simple crypto for the modern age"
+ requires = "nocrypto nocrypto.unix lwt.unix cstruct.lwt"
+ archive(byte) = "nocrypto_lwt.cma"
+ archive(native) = "nocrypto_lwt.cmxa"
+ plugin(byte) = "nocrypto_lwt.cma"
+ plugin(native) = "nocrypto_lwt.cmxs"
+ exists_if = "nocrypto_lwt.cma"
+)
+
+package "mirage" (
+ version = "0.5.4"
+ description = "Simple crypto for the modern age"
+ requires = "nocrypto lwt mirage-entropy"
+ archive(byte) = "nocrypto_mirage.cma"
+ archive(native) = "nocrypto_mirage.cmxa"
+ plugin(byte) = "nocrypto_mirage.cma"
+ plugin(native) = "nocrypto_mirage.cmxs"
+ exists_if = "nocrypto_mirage.cma"
+)
--
2.18.0

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1befe5d2ab60653d1d44fa734d2b8057cf3410db Mon Sep 17 00:00:00 2001
From 063b3496340fe4c3544b532ec0d27797b7917bb4 Mon Sep 17 00:00:00 2001
From: Gabriel Scherer <[email protected]>
Date: Mon, 26 Mar 2018 16:07:45 +0200
Subject: [PATCH 6/6] pack+package: workaround ocamlbuild#272
Subject: [PATCH 4/4] pack+package: workaround ocamlbuild#272

ocamlbuild should pass -package(...) flags to ocamlfind when building
a -pack-ed file, see
Expand Down Expand Up @@ -34,5 +34,5 @@ index 7b29635..7a5cdb6 100644
match hook with
| After_rules ->
--
2.17.0
2.18.0

This file was deleted.

10 changes: 5 additions & 5 deletions packages/nocrypto/nocrypto.0.5.4-1/opam
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors: ["David Kaloper <[email protected]>"]
maintainer: "David Kaloper <[email protected]>"
license: "ISC"
tags: [ "org:mirage" ]
available: [ ocaml-version >= "4.02.0" & os != "freebsd" & os != "openbsd" ]
available: [ ocaml-version >= "4.02.0" ]

build: ["ocaml" "pkg/pkg.ml" "build" "--pinned" "%{pinned}%" "--tests" "false"
"--jobs" "1"
Expand Down Expand Up @@ -41,8 +41,8 @@ conflicts: [
]

patches: [
"0002-add-missing-runtime-dependencies-in-_tags.patch"
"0004-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch"
"0005-Auto-detect-ppx_sexp_conv-runtime-library.patch"
"0006-pack-package-workaround-ocamlbuild-272.patch"
"0001-add-missing-runtime-dependencies-in-_tags.patch"
"0002-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch"
"0003-Auto-detect-ppx_sexp_conv-runtime-library.patch"
"0004-pack-package-workaround-ocamlbuild-272.patch"
]