diff --git a/pkgs/development/ocaml-modules/alcotest/default.nix b/pkgs/development/ocaml-modules/alcotest/default.nix index c43ad10d7d8..8415dc751d5 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 c6d99fa33e7..49fcdbd261a 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 0f168daac8c..6b37cf1aed3 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 271ec1f2af9..34d57b403b0 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 c7fff722399..d136ec092c2 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 c4a7fa0f7a7..d1f5cabb32d 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 15d2bde0ec6..a89f66477fa 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 65acbd6cc42..16e37addd45 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 f86909cc10b..02d6380715b 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 06a87c072b4..79d50382076 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 d46bff5b3d5..730c81087da 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 758bb072090..6f4536f2e8b 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 fd2b67225e6..dab8149ccfa 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 f21f05eeae5..de3d940b3bb 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 b1a178128ad..80d9933f8b6 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 a3e718d5329..edbbec3dcb3 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 c943d3ce35a..09e9dac0902 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 079e810bfdc..497b2df88b1 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 863a4cbb840..f289781b422 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 c660ca64856..3307b665b61 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 d1ff9eee817..71029525f35 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 c449c0f9002..a17b06ec6c6 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 = {