diff options
author | Yorick van Pelt <yorick@yorickvanpelt.nl> | 2019-10-31 17:16:15 +0700 |
---|---|---|
committer | Alexander Bantyev <balsoft75@gmail.com> | 2019-11-11 11:10:14 +0300 |
commit | 4550405ac974878bf2cfa7bb4137d414b5cec2f3 (patch) | |
tree | 7d78788d023a4009454026c705202fabfe0dd370 /pkgs/development/ocaml-modules/nocrypto | |
parent | 173bf3473cceef1f56b116f8ad43fb1262d8d4b6 (diff) | |
download | nixpkgs-4550405ac974878bf2cfa7bb4137d414b5cec2f3.tar nixpkgs-4550405ac974878bf2cfa7bb4137d414b5cec2f3.tar.gz nixpkgs-4550405ac974878bf2cfa7bb4137d414b5cec2f3.tar.bz2 nixpkgs-4550405ac974878bf2cfa7bb4137d414b5cec2f3.tar.lz nixpkgs-4550405ac974878bf2cfa7bb4137d414b5cec2f3.tar.xz nixpkgs-4550405ac974878bf2cfa7bb4137d414b5cec2f3.tar.zst nixpkgs-4550405ac974878bf2cfa7bb4137d414b5cec2f3.zip |
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/ocaml-modules/nocrypto')
-rw-r--r-- | pkgs/development/ocaml-modules/nocrypto/default.nix | 17 |
1 files changed, 13 insertions, 4 deletions
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; |