summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Bantyev <balsoft75@gmail.com>2019-11-14 23:29:12 +0300
committerAlexander Bantyev <balsoft75@gmail.com>2019-11-26 18:03:55 +0300
commit484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2 (patch)
tree2ebdf7e51ba8832ea9b51c5a435d7789e05bc6f6
parent07b838f13b5c73373718e935cd168f6649bdd38b (diff)
downloadnixpkgs-484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2.tar
nixpkgs-484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2.tar.gz
nixpkgs-484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2.tar.bz2
nixpkgs-484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2.tar.lz
nixpkgs-484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2.tar.xz
nixpkgs-484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2.tar.zst
nixpkgs-484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2.zip
ocaml: opam-file-format: Allow to disable dynamic linking
-rw-r--r--pkgs/development/ocaml-modules/opam-file-format/default.nix2
-rw-r--r--pkgs/development/ocaml-modules/opam-file-format/optional-static.patch13
2 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/opam-file-format/default.nix b/pkgs/development/ocaml-modules/opam-file-format/default.nix
index 4d308dc78b5..0ca332a2a06 100644
--- a/pkgs/development/ocaml-modules/opam-file-format/default.nix
+++ b/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/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch b/pkgs/development/ocaml-modules/opam-file-format/optional-static.patch
new file mode 100644
index 00000000000..5501fdd0c6c
--- /dev/null
+++ b/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)
+