aboutsummaryrefslogtreecommitdiff
path: root/pkgs
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-08-22 16:38:54 +0200
committerGitHub <noreply@github.com>2020-08-22 16:38:54 +0200
commit1fe7fee5925e809788341af52af0f6fd231a86fe (patch)
treebfe91f2f28b0cdec6be0bc52de479d60b988865e /pkgs
parent419f791e1fb2ef38f9c52ab3a7c8b97eb1a9f55e (diff)
parent3ede6200428d534b5ec46a9a979e4dfdaa1fadd7 (diff)
Merge pull request #93347 from symphorien/spacetime
Ocaml spacetime support
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/ocaml/generic.nix8
-rw-r--r--pkgs/development/tools/ocaml/camlp4/default.nix5
2 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix
index f2b61ab700da..1558756e16b1 100644
--- a/pkgs/development/compilers/ocaml/generic.nix
+++ b/pkgs/development/compilers/ocaml/generic.nix
@@ -10,20 +10,22 @@ let
safeX11 = stdenv: !(stdenv.isAarch32 || stdenv.isMips);
in
-{ stdenv, fetchurl, ncurses, buildEnv
+{ stdenv, fetchurl, ncurses, buildEnv, libunwind
, libX11, xorgproto, useX11 ? safeX11 stdenv && !stdenv.lib.versionAtLeast version "4.09"
, aflSupport ? false
, flambdaSupport ? false
+, spaceTimeSupport ? false
}:
assert useX11 -> !stdenv.isAarch32 && !stdenv.isMips;
assert aflSupport -> stdenv.lib.versionAtLeast version "4.05";
assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
+assert spaceTimeSupport -> stdenv.lib.versionAtLeast version "4.04";
let
useNativeCompilers = !stdenv.isMips;
inherit (stdenv.lib) optional optionals optionalString;
- name = "ocaml${optionalString aflSupport "+afl"}${optionalString flambdaSupport "+flambda"}-${version}";
+ name = "ocaml${optionalString aflSupport "+afl"}${optionalString spaceTimeSupport "+spacetime"}${optionalString flambdaSupport "+flambda"}-${version}";
in
let
@@ -53,11 +55,13 @@ stdenv.mkDerivation (args // {
[ "-x11lib" x11lib "-x11include" x11inc ])
++ optional aflSupport (flags "--with-afl" "-afl-instrument")
++ optional flambdaSupport (flags "--enable-flambda" "-flambda")
+ ++ optional spaceTimeSupport (flags "--enable-spacetime" "-spacetime")
;
buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ];
buildInputs = optional (!stdenv.lib.versionAtLeast version "4.07") ncurses
++ optionals useX11 [ libX11 xorgproto ];
+ propagatedBuildInputs = optional spaceTimeSupport libunwind;
installTargets = [ "install" ] ++ optional useNativeCompilers "installopt";
preConfigure = optionalString (!stdenv.lib.versionAtLeast version "4.04") ''
CAT=$(type -tp cat)
diff --git a/pkgs/development/tools/ocaml/camlp4/default.nix b/pkgs/development/tools/ocaml/camlp4/default.nix
index ea1b39650980..73228655cca0 100644
--- a/pkgs/development/tools/ocaml/camlp4/default.nix
+++ b/pkgs/development/tools/ocaml/camlp4/default.nix
@@ -43,6 +43,11 @@ stdenv.mkDerivation rec {
dontAddPrefix = true;
preConfigure = ''
+ # increase stack space for spacetime variant of the compiler
+ # https://github.com/ocaml/ocaml/issues/7435
+ # but disallowed by darwin sandbox
+ ulimit -s unlimited || true
+
configureFlagsArray=(
--bindir=$out/bin
--libdir=$out/lib/ocaml/${ocaml.version}/site-lib