From 07b838f13b5c73373718e935cd168f6649bdd38b Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 14 Nov 2019 23:28:51 +0300 Subject: [PATCH] ocaml: num: Allow to disable dynamic linking --- pkgs/development/ocaml-modules/num/default.nix | 4 +++- .../ocaml-modules/num/enable-static.patch | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/ocaml-modules/num/enable-static.patch diff --git a/pkgs/development/ocaml-modules/num/default.nix b/pkgs/development/ocaml-modules/num/default.nix index 730c81087dab..d278a17f8d54 100644 --- a/pkgs/development/ocaml-modules/num/default.nix +++ b/pkgs/development/ocaml-modules/num/default.nix @@ -14,13 +14,15 @@ stdenv.mkDerivation rec { url = "https://github.com/ocaml/num/commit/6d4c6d476c061298e6385e8a0864f083194b9307.patch"; sha256 = "18zlvb5n327q8y3c52js5dvyy29ssld1l53jqng8m9w1k24ypi0b"; }) + ./enable-static.patch ]; nativeBuildInputs = [ ocaml findlib ]; - buildInputs = [ findlib ]; + buildInputs = [ ocaml findlib ]; createFindlibDestdir = true; + meta = { description = "Legacy Num library for arbitrary-precision integer and rational arithmetic"; license = stdenv.lib.licenses.lgpl21; diff --git a/pkgs/development/ocaml-modules/num/enable-static.patch b/pkgs/development/ocaml-modules/num/enable-static.patch new file mode 100644 index 000000000000..be3ca197f4ec --- /dev/null +++ b/pkgs/development/ocaml-modules/num/enable-static.patch @@ -0,0 +1,12 @@ +diff -u a/src/Makefile b/src/Makefile +--- a/src/Makefile ++++ b/src/Makefile +@@ -45,7 +45,7 @@ + endif + + libnums.$(A): $(COBJS) +- $(OCAMLMKLIB) -oc nums $(COBJS) ++ $(OCAMLMKLIB) -custom -oc nums $(COBJS) + + nums.cma: $(CMOS) + $(OCAMLMKLIB) -o nums -oc nums -linkall $(CMOS)