diff options
Diffstat (limited to 'pkgs/development/compilers/ocaml')
-rw-r--r-- | pkgs/development/compilers/ocaml/4.13.nix | 6 | ||||
-rw-r--r-- | pkgs/development/compilers/ocaml/generic.nix | 18 |
2 files changed, 18 insertions, 6 deletions
diff --git a/pkgs/development/compilers/ocaml/4.13.nix b/pkgs/development/compilers/ocaml/4.13.nix index 723b597b88d..6b0d379193e 100644 --- a/pkgs/development/compilers/ocaml/4.13.nix +++ b/pkgs/development/compilers/ocaml/4.13.nix @@ -1,9 +1,9 @@ import ./generic.nix { major_version = "4"; minor_version = "13"; - patch_version = "0-beta1"; + patch_version = "0-rc2"; src = fetchTarball { - url = "https://caml.inria.fr/pub/distrib/ocaml-4.13/ocaml-4.13.0~beta1.tar.xz"; - sha256 = "0dbz69p1kqabjvzaasy2malfdfn4b93s504x2xs0dl5l3fa3p6c3"; + url = "https://caml.inria.fr/pub/distrib/ocaml-4.13/ocaml-4.13.0~rc2.tar.xz"; + sha256 = "1w4sdrs5s1bhbisgz44ysi2j1n13qd3slgs34ppglpwmqqw6ply2"; }; } diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix index 2dd959600ea..e4cec4cf52e 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); + safeX11 = stdenv: !(stdenv.isAarch32 || stdenv.isMips || stdenv.hostPlatform.isStatic); in { lib, stdenv, fetchurl, ncurses, buildEnv, libunwind @@ -13,7 +13,7 @@ in , spaceTimeSupport ? false }: -assert useX11 -> !stdenv.isAarch32 && !stdenv.isMips; +assert useX11 -> safeX11 stdenv; assert aflSupport -> lib.versionAtLeast version "4.05"; assert flambdaSupport -> lib.versionAtLeast version "4.03"; assert spaceTimeSupport -> lib.versionAtLeast version "4.04"; @@ -44,6 +44,8 @@ stdenv.mkDerivation (args // { inherit src; + strictDeps = true; + prefixKey = "-prefix "; configureFlags = let flags = new: old: @@ -56,7 +58,15 @@ stdenv.mkDerivation (args // { ++ optional aflSupport (flags "--with-afl" "-afl-instrument") ++ optional flambdaSupport (flags "--enable-flambda" "-flambda") ++ optional spaceTimeSupport (flags "--enable-spacetime" "-spacetime") - ; + ++ optional (stdenv.hostPlatform.isStatic && (lib.versionOlder version "4.08")) "-no-shared-libs" + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && lib.versionOlder version "4.08") [ + "-host ${stdenv.hostPlatform.config}" + "-target ${stdenv.targetPlatform.config}" + ]; + dontAddStaticConfigureFlags = lib.versionOlder version "4.08"; + configurePlatforms = lib.optionals (lib.versionAtLeast version "4.08") [ "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"; buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ]; buildInputs = optional (!lib.versionAtLeast version "4.07") ncurses @@ -70,6 +80,8 @@ stdenv.mkDerivation (args // { # 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" + '' + optionalString (lib.versionOlder version "4.08" && stdenv.hostPlatform.isStatic) '' + configureFlagsArray+=("-cc" "$CC" "-as" "$AS" "-partialld" "$LD -r") ''; postBuild = '' mkdir -p $out/include |