diff options
Diffstat (limited to 'pkgs/development/compilers/ocaml/generic.nix')
-rw-r--r-- | pkgs/development/compilers/ocaml/generic.nix | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index af07074eba1b..38795426bea2 100644 --- a/pkgs/development/compilers/ocaml/generic.nix +++ b/pkgs/development/compilers/ocaml/generic.nix @@ -3,7 +3,7 @@ let versionNoPatch = "${toString major_version}.${toString minor_version}"; version = "${versionNoPatch}.${toString patch_version}"; - safeX11 = stdenv: !(stdenv.isAarch32 || stdenv.isMips || stdenv.hostPlatform.isStatic); + safeX11 = stdenv: !(stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isMips || stdenv.hostPlatform.isStatic); in { lib, stdenv, fetchurl, ncurses, buildEnv, libunwind, fetchpatch @@ -30,7 +30,7 @@ let in let - useNativeCompilers = !stdenv.isMips; + useNativeCompilers = !stdenv.hostPlatform.isMips; inherit (lib) optional optionals optionalString strings concatStrings; pname = concatStrings [ "ocaml" (optionalString aflSupport "+afl") @@ -84,7 +84,7 @@ stdenv.mkDerivation (args // { # `aarch64-apple-darwin-clang` while using assembler. However, such binary # does not exist. So, disable these configure flags on `aarch64-darwin`. # See #144785 for details. - configurePlatforms = lib.optionals (lib.versionAtLeast version "4.08" && !(stdenv.isDarwin && stdenv.isAarch64)) [ "host" "target" ]; + configurePlatforms = lib.optionals (lib.versionAtLeast version "4.08" && !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) [ "host" "target" ]; # x86_64-unknown-linux-musl-ld: -r and -pie may not be used together hardeningDisable = lib.optional (lib.versionAtLeast version "4.09" && stdenv.hostPlatform.isMusl) "pie" ++ lib.optional (lib.versionAtLeast version "5.0" && stdenv.cc.isClang) "strictoverflow" @@ -105,7 +105,9 @@ stdenv.mkDerivation (args // { # sequential order among them as a single rule. makefile = ./Makefile.nixpkgs; buildFlags = if useNativeCompilers - then ["nixpkgs_world_bootstrap_world_opt"] + then [(if lib.versionOlder version "5.2" + then "nixpkgs_world_bootstrap_world_opt" + else "defaultentry")] else ["nixpkgs_world"]; buildInputs = optional (lib.versionOlder version "4.07") ncurses ++ optionals useX11 [ libX11 xorgproto ]; @@ -114,7 +116,7 @@ stdenv.mkDerivation (args // { preConfigure = optionalString (lib.versionOlder version "4.04") '' CAT=$(type -tp cat) sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang - '' + optionalString (stdenv.isDarwin) '' + '' + optionalString (stdenv.hostPlatform.isDarwin) '' # Do what upstream does by default now: https://github.com/ocaml/ocaml/pull/10176 # This is required for aarch64-darwin, everything else works as is. AS="${stdenv.cc}/bin/cc -c" ASPP="${stdenv.cc}/bin/cc -c" @@ -157,7 +159,7 @@ stdenv.mkDerivation (args // { ''; platforms = with platforms; linux ++ darwin; - broken = stdenv.isAarch64 && lib.versionOlder version (if stdenv.isDarwin then "4.10" else "4.02"); + broken = stdenv.hostPlatform.isAarch64 && lib.versionOlder version (if stdenv.hostPlatform.isDarwin then "4.10" else "4.02"); }; }) |