about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Bantyev <balsoft75@gmail.com>2019-11-14 23:28:51 +0300
committerAlexander Bantyev <balsoft75@gmail.com>2019-11-26 18:03:55 +0300
commit07b838f13b5c73373718e935cd168f6649bdd38b (patch)
tree2140fcb7c7ebda7b0a93dabe2159a4ec395a98c6
parent81ca7cc0a79c94feff0b95147e0c491c0f584564 (diff)
ocaml: num: Allow to disable dynamic linking
-rw-r--r--pkgs/development/ocaml-modules/num/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/num/enable-static.patch12
2 files changed, 15 insertions, 1 deletions
diff --git a/pkgs/development/ocaml-modules/num/default.nix b/pkgs/development/ocaml-modules/num/default.nix
index 730c81087dabe..d278a17f8d542 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 0000000000000..be3ca197f4ec5
--- /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)