about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/opam-file-format
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/ocaml-modules/opam-file-format')
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix2
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch13
2 files changed, 15 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix b/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix
index 4d308dc78b5f..0ca332a2a06e 100644
--- a/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/default.nix
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
 
   installFlags = [ "LIBDIR=$(OCAMLFIND_DESTDIR)" ];
 
+  patches = [ ./optional-static.patch ];
+
   meta = {
     description = "Parser and printer for the opam file syntax";
     license = stdenv.lib.licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch b/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch
new file mode 100644
index 000000000000..5501fdd0c6c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch
@@ -0,0 +1,13 @@
+diff -u a/Makefile b/Makefile
+--- a/Makefile
++++ b/Makefile
+@@ -1,1 +1,5 @@
+-TARGETS = opam-file-format.cma opam-file-format.cmxa opam-file-format.cmxs
++TARGETS = opam-file-format.cma opam-file-format.cmxa
++
++ifeq "$(NATDYNLINK)" "true"
++TARGETS = $(TARGETS) opam-file-format.cmxs
++endif
+
+all: $(TARGETS)
+