From 484e0a89f9aa49ebb097ce7b531f3b1cad13eaa2 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 14 Nov 2019 23:29:12 +0300 Subject: [PATCH] ocaml: opam-file-format: Allow to disable dynamic linking --- .../ocaml-modules/opam-file-format/default.nix | 2 ++ .../opam-file-format/optional-static.patch | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/development/ocaml-modules/opam-file-format/optional-static.patch diff --git a/pkgs/development/ocaml-modules/opam-file-format/default.nix b/pkgs/development/ocaml-modules/opam-file-format/default.nix index 4d308dc78b5f..0ca332a2a06e 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 000000000000..5501fdd0c6c3 --- /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) +