about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2019-10-31 17:16:15 +0700
committerAlexander Bantyev <balsoft75@gmail.com>2019-11-11 11:10:14 +0300
commit4550405ac974878bf2cfa7bb4137d414b5cec2f3 (patch)
tree7d78788d023a4009454026c705202fabfe0dd370 /pkgs/development
parent173bf3473cceef1f56b116f8ad43fb1262d8d4b6 (diff)
ocaml-modules: replace buildInputs with nativeBuildInputs where appropriate
The default has been to use buildInputs for build dependencies.
This doesn't work when cross-compiling.
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/ocaml-modules/alcotest/default.nix8
-rw-r--r--pkgs/development/ocaml-modules/asn1-combinators/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/bos/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/cmdliner/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/fmt/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/jsonm/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/logs/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/magic-mime/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/mtime/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/nocrypto/default.nix17
-rw-r--r--pkgs/development/ocaml-modules/num/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/ounit/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/ppx_tools/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/ptime/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/tls/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/topkg/default.nix2
-rw-r--r--pkgs/development/ocaml-modules/uchar/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/uuidm/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/uutf/default.nix3
-rw-r--r--pkgs/development/ocaml-modules/yojson/default.nix9
-rw-r--r--pkgs/development/tools/ocaml/js_of_ocaml/3.0.nix3
-rw-r--r--pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix4
22 files changed, 65 insertions, 31 deletions
diff --git a/pkgs/development/ocaml-modules/alcotest/default.nix b/pkgs/development/ocaml-modules/alcotest/default.nix
index c43ad10d7d82e..8415dc751d563 100644
--- a/pkgs/development/ocaml-modules/alcotest/default.nix
+++ b/pkgs/development/ocaml-modules/alcotest/default.nix
@@ -6,14 +6,15 @@ let param =
   if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
     version = "0.8.5";
     sha256 = "1mhckvdcxkikbzgvy24kjz4265l15b86a6swz7m3ynbgvqdcfzqn";
-    buildInputs = [ dune ];
+    nativeBuildInputs = [ dune ];
     propagatedBuildInputs = [ uuidm ];
     buildPhase = "dune build -p alcotest";
     inherit (dune) installPhase;
   } else {
     version = "0.7.2";
     sha256 = "1qgsz2zz5ky6s5pf3j3shc4fjc36rqnjflk8x0wl1fcpvvkr52md";
-    buildInputs = [ ocamlbuild topkg ];
+    buildInputs = [ topkg ];
+    nativeBuildInputs = [ ocamlbuild ];
     inherit (topkg) buildPhase installPhase;
   };
 in
@@ -27,7 +28,8 @@ stdenv.mkDerivation rec {
     inherit (param) sha256;
   };
 
-  buildInputs = [ ocaml findlib ] ++ param.buildInputs;
+  nativeBuildInputs = [ ocaml findlib ] ++ (param.nativeBuildInputs or []);
+  buildInputs = [ findlib ] ++ (param.buildInputs or []);
 
   propagatedBuildInputs = [ cmdliner astring fmt result ]
   ++ (param.propagatedBuildInputs or []);
diff --git a/pkgs/development/ocaml-modules/asn1-combinators/default.nix b/pkgs/development/ocaml-modules/asn1-combinators/default.nix
index c6d99fa33e71b..49fcdbd261a33 100644
--- a/pkgs/development/ocaml-modules/asn1-combinators/default.nix
+++ b/pkgs/development/ocaml-modules/asn1-combinators/default.nix
@@ -25,7 +25,8 @@ stdenv.mkDerivation rec {
     inherit (param) sha256;
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild ounit topkg ];
+  buildInputs = [ findlib ounit topkg ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
   propagatedBuildInputs = [ result cstruct zarith ] ++ param.propagatedBuildInputs;
 
   buildPhase = "${topkg.run} build --tests true";
diff --git a/pkgs/development/ocaml-modules/bos/default.nix b/pkgs/development/ocaml-modules/bos/default.nix
index 0f168daac8c1a..6b37cf1aed3a8 100644
--- a/pkgs/development/ocaml-modules/bos/default.nix
+++ b/pkgs/development/ocaml-modules/bos/default.nix
@@ -10,7 +10,8 @@ stdenv.mkDerivation rec {
 		sha256 = "1s10iqx8rgnxr5n93lf4blwirjf8nlm272yg5sipr7lsr35v49wc";
 	};
 
-	buildInputs = [ ocaml findlib ocamlbuild topkg ];
+	nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+	buildInputs = [ findlib topkg ];
 	propagatedBuildInputs = [ astring fmt fpath logs rresult ];
 
 	inherit (topkg) buildPhase installPhase;
diff --git a/pkgs/development/ocaml-modules/cmdliner/default.nix b/pkgs/development/ocaml-modules/cmdliner/default.nix
index 271ec1f2af918..34d57b403b014 100644
--- a/pkgs/development/ocaml-modules/cmdliner/default.nix
+++ b/pkgs/development/ocaml-modules/cmdliner/default.nix
@@ -25,8 +25,8 @@ stdenv.mkDerivation rec {
     inherit (param) sha256;
   };
 
-  nativeBuildInputs = [ ocamlbuild topkg ];
-  buildInputs = [ ocaml findlib ];
+  nativeBuildInputs = [ ocaml ocamlbuild findlib ];
+  buildInputs = [ topkg ];
   propagatedBuildInputs = [ result ];
 
   inherit (topkg) buildPhase installPhase;
diff --git a/pkgs/development/ocaml-modules/fmt/default.nix b/pkgs/development/ocaml-modules/fmt/default.nix
index c7fff722399ce..d136ec092c2bc 100644
--- a/pkgs/development/ocaml-modules/fmt/default.nix
+++ b/pkgs/development/ocaml-modules/fmt/default.nix
@@ -8,7 +8,8 @@ stdenv.mkDerivation {
     sha256 = "1zj9azcxcn6skmb69ykgmi9z8c50yskwg03wqgh87lypgjdcz060";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild topkg cmdliner ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib topkg cmdliner ];
   propagatedBuildInputs = [ result uchar ];
 
   inherit (topkg) buildPhase installPhase;
diff --git a/pkgs/development/ocaml-modules/jsonm/default.nix b/pkgs/development/ocaml-modules/jsonm/default.nix
index c4a7fa0f7a761..d1f5cabb32d29 100644
--- a/pkgs/development/ocaml-modules/jsonm/default.nix
+++ b/pkgs/development/ocaml-modules/jsonm/default.nix
@@ -10,7 +10,8 @@ stdenv.mkDerivation {
     sha256 = "1176dcmxb11fnw49b7yysvkjh0kpzx4s48lmdn5psq9vshp5c29w";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild topkg ];
+  buildInputs = [ findlib topkg ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
   propagatedBuildInputs = [ uutf ];
 
   inherit (topkg) buildPhase installPhase;
diff --git a/pkgs/development/ocaml-modules/logs/default.nix b/pkgs/development/ocaml-modules/logs/default.nix
index 15d2bde0ec6f2..a89f66477fac4 100644
--- a/pkgs/development/ocaml-modules/logs/default.nix
+++ b/pkgs/development/ocaml-modules/logs/default.nix
@@ -18,7 +18,8 @@ stdenv.mkDerivation rec {
     sha256 = "1lkhr7i44xw4kpfbhgj3rbqy3dv5bfm4kyrbl8a9rfafddcxlwss";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild topkg fmt cmdliner lwt ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib topkg fmt cmdliner lwt ];
   propagatedBuildInputs = [ result ];
 
   buildPhase = "${topkg.run} build --with-js_of_ocaml false";
diff --git a/pkgs/development/ocaml-modules/magic-mime/default.nix b/pkgs/development/ocaml-modules/magic-mime/default.nix
index 65acbd6cc4288..16e37addd45f7 100644
--- a/pkgs/development/ocaml-modules/magic-mime/default.nix
+++ b/pkgs/development/ocaml-modules/magic-mime/default.nix
@@ -11,7 +11,9 @@ stdenv.mkDerivation {
     sha256 = "058d83hmxd5mjccxdm3ydchmhk2lca5jdg82jg0klsigmf4ida6v";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib ];
+  configurePlatforms = [];
 
   createFindlibDestdir = true;
 
diff --git a/pkgs/development/ocaml-modules/mtime/default.nix b/pkgs/development/ocaml-modules/mtime/default.nix
index f86909cc10b5d..02d6380715b37 100644
--- a/pkgs/development/ocaml-modules/mtime/default.nix
+++ b/pkgs/development/ocaml-modules/mtime/default.nix
@@ -23,7 +23,8 @@ stdenv.mkDerivation {
     inherit (param) sha256;
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild topkg ]
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib topkg ]
   ++ stdenv.lib.optional jsooSupport js_of_ocaml;
 
   buildPhase = "${topkg.buildPhase} --with-js_of_ocaml ${boolToString jsooSupport}";
diff --git a/pkgs/development/ocaml-modules/nocrypto/default.nix b/pkgs/development/ocaml-modules/nocrypto/default.nix
index 06a87c072b4a5..79d503820765e 100644
--- a/pkgs/development/ocaml-modules/nocrypto/default.nix
+++ b/pkgs/development/ocaml-modules/nocrypto/default.nix
@@ -1,11 +1,19 @@
 { stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, topkg
 , cpuid, ocb-stubblr, sexplib
-, cstruct, zarith, ppx_sexp_conv, ppx_deriving
+, cstruct, zarith, ppx_sexp_conv, writeScriptBin
 , cstruct-lwt ? null
 }:
 
 with stdenv.lib;
-let withLwt = cstruct-lwt != null; in
+let
+  withLwt = cstruct-lwt != null;
+  # the build system will call 'cc' with no way to override
+  # this is wrong when we're cross-compiling, so insert a wrapper
+  cc-wrapper = writeScriptBin "cc" ''
+    set -e
+    $CC "$@"
+  '';
+in
 
 stdenv.mkDerivation rec {
   name = "ocaml${ocaml.version}-nocrypto-${version}";
@@ -43,8 +51,9 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  buildInputs = [ ocaml findlib ocamlbuild topkg cpuid ocb-stubblr ];
-  propagatedBuildInputs = [ cstruct ppx_deriving ppx_sexp_conv sexplib zarith ] ++ optional withLwt cstruct-lwt;
+  nativeBuildInputs = [ ocaml findlib ocamlbuild cc-wrapper ];
+  buildInputs = [ ocamlbuild findlib topkg cpuid ocb-stubblr ];
+  propagatedBuildInputs = [ cstruct ppx_sexp_conv sexplib zarith ] ++ optional withLwt cstruct-lwt;
 
   buildPhase = "${topkg.buildPhase} --with-lwt ${boolToString withLwt}";
   inherit (topkg) installPhase;
diff --git a/pkgs/development/ocaml-modules/num/default.nix b/pkgs/development/ocaml-modules/num/default.nix
index d46bff5b3d59a..730c81087dabe 100644
--- a/pkgs/development/ocaml-modules/num/default.nix
+++ b/pkgs/development/ocaml-modules/num/default.nix
@@ -16,7 +16,8 @@ stdenv.mkDerivation rec {
 		})
 	];
 
-	buildInputs = [ ocaml findlib ];
+	nativeBuildInputs = [ ocaml findlib ];
+  buildInputs = [ findlib ];
 
 	createFindlibDestdir = true;
 
diff --git a/pkgs/development/ocaml-modules/ounit/default.nix b/pkgs/development/ocaml-modules/ounit/default.nix
index 758bb0720907f..6f4536f2e8bdf 100644
--- a/pkgs/development/ocaml-modules/ounit/default.nix
+++ b/pkgs/development/ocaml-modules/ounit/default.nix
@@ -14,7 +14,9 @@ stdenv.mkDerivation {
     sha256 = "0hbd2sqdz75lv5ax82yhsfdk1dlcvq12xpys6n85ysmrl0c3d3lk";
   });
 
-  buildInputs = [ ocaml findlib ocamlbuild ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib ];
+  configurePlatforms = [];
 
   dontAddPrefix = true;
 
diff --git a/pkgs/development/ocaml-modules/ppx_tools/default.nix b/pkgs/development/ocaml-modules/ppx_tools/default.nix
index fd2b67225e67b..dab8149ccfa4e 100644
--- a/pkgs/development/ocaml-modules/ppx_tools/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_tools/default.nix
@@ -37,7 +37,8 @@ in
       inherit (param) sha256;
     };
 
-    buildInputs = [ ocaml findlib ];
+    nativeBuildInputs = [ ocaml findlib ];
+    buildInputs = [ findlib ];
 
     createFindlibDestdir = true;
 
diff --git a/pkgs/development/ocaml-modules/ptime/default.nix b/pkgs/development/ocaml-modules/ptime/default.nix
index f21f05eeae5ff..de3d940b3bb90 100644
--- a/pkgs/development/ocaml-modules/ptime/default.nix
+++ b/pkgs/development/ocaml-modules/ptime/default.nix
@@ -9,7 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "1fxq57xy1ajzfdnvv5zfm7ap2nf49znw5f9gbi4kb9vds942ij27";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild topkg js_of_ocaml ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  buildInputs = [ findlib topkg js_of_ocaml ];
 
   propagatedBuildInputs = [ result ];
 
diff --git a/pkgs/development/ocaml-modules/tls/default.nix b/pkgs/development/ocaml-modules/tls/default.nix
index b1a178128adb3..80d9933f8b681 100644
--- a/pkgs/development/ocaml-modules/tls/default.nix
+++ b/pkgs/development/ocaml-modules/tls/default.nix
@@ -21,7 +21,8 @@ stdenv.mkDerivation rec {
     sha256 = "02wv4lia583imn3sfci4nqv6ac5nzig5j3yfdnlqa0q8bp9rfc6g";
   };
 
-  buildInputs = [ ocaml ocamlbuild findlib topkg ppx_sexp_conv ppx_cstruct ]
+  nativeBuildInputs = [ ocaml ocamlbuild findlib ];
+  buildInputs = [ findlib topkg ppx_sexp_conv ppx_cstruct ]
   ++ optionals doCheck [ ounit cstruct-unix ];
   propagatedBuildInputs = [ cstruct-sexp nocrypto result x509 ] ++
                           optional withLwt lwt;
diff --git a/pkgs/development/ocaml-modules/topkg/default.nix b/pkgs/development/ocaml-modules/topkg/default.nix
index a3e718d532964..edbbec3dcb3a6 100644
--- a/pkgs/development/ocaml-modules/topkg/default.nix
+++ b/pkgs/development/ocaml-modules/topkg/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     sha256 = "1df61vw6v5bg2mys045682ggv058yqkqb67w7r2gz85crs04d5fw";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
   propagatedBuildInputs = [ result ];
 
   buildPhase = "${run} build";
diff --git a/pkgs/development/ocaml-modules/uchar/default.nix b/pkgs/development/ocaml-modules/uchar/default.nix
index c943d3ce35a8d..09e9dac090205 100644
--- a/pkgs/development/ocaml-modules/uchar/default.nix
+++ b/pkgs/development/ocaml-modules/uchar/default.nix
@@ -8,9 +8,11 @@ stdenv.mkDerivation {
     sha256 = "1w2saw7zanf9m9ffvz2lvcxvlm118pws2x1wym526xmydhqpyfa7";
   };
 
-  buildInputs = [ ocaml ocamlbuild findlib opaline ];
+  nativeBuildInputs = [ ocaml ocamlbuild findlib opaline ];
+  buildInputs = [ findlib ];
   buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
   installPhase = "opaline -libdir $OCAMLFIND_DESTDIR";
+  configurePlatforms = [];
 
   meta = {
     description = "Compatibility library for OCaml’s Uchar module";
diff --git a/pkgs/development/ocaml-modules/uuidm/default.nix b/pkgs/development/ocaml-modules/uuidm/default.nix
index 079e810bfdc63..497b2df88b195 100644
--- a/pkgs/development/ocaml-modules/uuidm/default.nix
+++ b/pkgs/development/ocaml-modules/uuidm/default.nix
@@ -8,7 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "1ivxb3hxn9bk62rmixx6px4fvn52s4yr1bpla7rgkcn8981v45r8";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild topkg cmdliner ];
+  nativeBuildInputs = [ ocaml findlib ocamlbuild ];
+  configurePlatforms = [];
+  buildInputs = [ topkg cmdliner ];
 
   inherit (topkg) buildPhase installPhase;
 
diff --git a/pkgs/development/ocaml-modules/uutf/default.nix b/pkgs/development/ocaml-modules/uutf/default.nix
index 863a4cbb8409f..f289781b422c9 100644
--- a/pkgs/development/ocaml-modules/uutf/default.nix
+++ b/pkgs/development/ocaml-modules/uutf/default.nix
@@ -13,7 +13,8 @@ stdenv.mkDerivation rec {
     sha256 = "1nx1rly3qj23jzn9yk3x6fwqimcxjd84kv5859vvhdg56psq26p6";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild topkg cmdliner ];
+  nativeBuildInputs = [ ocaml ocamlbuild findlib ];
+  buildInputs = [ findlib topkg cmdliner ];
   propagatedBuildInputs = [ uchar ];
 
   inherit (topkg) buildPhase installPhase;
diff --git a/pkgs/development/ocaml-modules/yojson/default.nix b/pkgs/development/ocaml-modules/yojson/default.nix
index c660ca6485665..3307b665b6147 100644
--- a/pkgs/development/ocaml-modules/yojson/default.nix
+++ b/pkgs/development/ocaml-modules/yojson/default.nix
@@ -6,7 +6,7 @@ let
     version = "1.7.0";
     url = "https://github.com/ocaml-community/yojson/releases/download/${version}/yojson-${version}.tbz";
     sha256 = "08llz96if8bcgnaishf18si76cv11zbkni0aldb54k3cn7ipiqvd";
-    buildInputs = [ dune ];
+    nativeBuildInputs = [ dune ];
     extra = { inherit (dune) installPhase; };
   } else rec {
     version = "1.2.3";
@@ -29,9 +29,10 @@ stdenv.mkDerivation ({
     inherit (param) url sha256;
   };
 
-  buildInputs = [ ocaml findlib ] ++ (param.buildInputs or []);
-
-  propagatedBuildInputs = [ cppo easy-format biniou ];
+  nativeBuildInputs = [ ocaml findlib ] ++ (param.nativeBuildInputs or []);
+  propagatedNativeBuildInputs = [ cppo ];
+  propagatedBuildInputs = [ easy-format biniou ];
+  configurePlatforms = [];
 
   meta = with stdenv.lib; {
     description = "An optimized parsing and printing library for the JSON format";
diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/3.0.nix b/pkgs/development/tools/ocaml/js_of_ocaml/3.0.nix
index d1ff9eee81797..71029525f351e 100644
--- a/pkgs/development/tools/ocaml/js_of_ocaml/3.0.nix
+++ b/pkgs/development/tools/ocaml/js_of_ocaml/3.0.nix
@@ -7,7 +7,8 @@ stdenv.mkDerivation {
 
 	inherit (js_of_ocaml-compiler) version src installPhase meta;
 
-	buildInputs = [ ocaml findlib dune ocaml-migrate-parsetree ppx_tools_versioned ];
+	buildInputs = [ findlib ocaml-migrate-parsetree ppx_tools_versioned ];
+  nativeBuildInputs = [ ocaml findlib dune ];
 
   postPatch = "patchShebangs lib/generate_stubs.sh";
 
diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix b/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix
index c449c0f900241..a17b06ec6c6e4 100644
--- a/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix
+++ b/pkgs/development/tools/ocaml/js_of_ocaml/compiler.nix
@@ -13,8 +13,10 @@ buildDunePackage rec {
 		sha256 = "0c537say0f3197zn8d83nrihabrxyn28xc6d7c9c3l0vvrv6qvfj";
 	};
 
-	buildInputs = [ cmdliner cppo ];
+	nativeBuildInputs = [ ocaml findlib dune cppo ];
+  buildInputs = [ cmdliner ];
 
+  configurePlatforms = [];
 	propagatedBuildInputs = [ yojson ];
 
 	meta = {