summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJoachim F <joachifm@users.noreply.github.com>2017-09-21 22:19:30 +0000
committerGitHub <noreply@github.com>2017-09-21 22:19:30 +0000
commitae4f2fbb41b2824869000eb1f10d8c27315d4537 (patch)
tree0d853b52d7c482b6aa81dc20b52a85de2de38511 /pkgs
parent44d2eaab809f3d6bf4c019de57bb6f5989bdf6ef (diff)
parent59cdc2564cec4b5f681a5c625aa951350244315b (diff)
downloadnixlib-ae4f2fbb41b2824869000eb1f10d8c27315d4537.tar
nixlib-ae4f2fbb41b2824869000eb1f10d8c27315d4537.tar.gz
nixlib-ae4f2fbb41b2824869000eb1f10d8c27315d4537.tar.bz2
nixlib-ae4f2fbb41b2824869000eb1f10d8c27315d4537.tar.lz
nixlib-ae4f2fbb41b2824869000eb1f10d8c27315d4537.tar.xz
nixlib-ae4f2fbb41b2824869000eb1f10d8c27315d4537.tar.zst
nixlib-ae4f2fbb41b2824869000eb1f10d8c27315d4537.zip
Merge pull request #29469 from ThomasMader/fix-dmd
dmd & ldc: Fix bootstrap dmd to build with sandboxing of nixUnstable and fix dmd to build on Darwin; Disable check phases of dmd and ldc because of sandboxing problem
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/dmd/2.067.1.nix30
-rw-r--r--pkgs/development/compilers/dmd/default.nix12
-rw-r--r--pkgs/development/compilers/ldc/default.nix3
3 files changed, 29 insertions, 16 deletions
diff --git a/pkgs/development/compilers/dmd/2.067.1.nix b/pkgs/development/compilers/dmd/2.067.1.nix
index 3cf530e9e5e8..6fab56e4e7da 100644
--- a/pkgs/development/compilers/dmd/2.067.1.nix
+++ b/pkgs/development/compilers/dmd/2.067.1.nix
@@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
   # Compile with PIC to prevent colliding modules with binutils 2.28.
   # https://issues.dlang.org/show_bug.cgi?id=17375
   usePIC = "-fPIC";
+  ROOT_HOME_DIR = "$(echo ~root)";
 
   postPatch = ''
       # Ugly hack so the dlopen call has a chance to succeed.
@@ -67,19 +68,23 @@ stdenv.mkDerivation rec {
           --replace g++ $CXX
   ''
 
-    + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
-        substituteInPlace dmd/src/root/port.c \
-          --replace "#include <bits/mathdef.h>" "#include <complex.h>"
-    ''
+  + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
+      substituteInPlace dmd/src/root/port.c \
+        --replace "#include <bits/mathdef.h>" "#include <complex.h>"
 
-    + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
-        substituteInPlace dmd/src/posix.mak \
-            --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
+      # See https://github.com/NixOS/nixpkgs/issues/29443
+      substituteInPlace phobos/std/path.d \
+          --replace "\"/root" "\"${ROOT_HOME_DIR}"
+  ''
+
+  + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+      substituteInPlace dmd/src/posix.mak \
+          --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
 
-        # Was not able to compile on darwin due to "__inline_isnanl"
-        # being undefined.
-        substituteInPlace dmd/src/root/port.c --replace __inline_isnanl __inline_isnan
-    '';
+      # Was not able to compile on darwin due to "__inline_isnanl"
+      # being undefined.
+      substituteInPlace dmd/src/root/port.c --replace __inline_isnanl __inline_isnan
+  '';
 
   nativeBuildInputs = [ makeWrapper unzip which ];
   buildInputs = [ curl tzdata ];
@@ -96,7 +101,8 @@ stdenv.mkDerivation rec {
       cd ..
   '';
 
-  doCheck = true;
+  # disable check phase because some tests are not working with sandboxing
+  doCheck = false;
 
   checkPhase = ''
       cd dmd
diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix
index 2b29ba9aa3e8..27f70b8d6c71 100644
--- a/pkgs/development/compilers/dmd/default.nix
+++ b/pkgs/development/compilers/dmd/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchFromGitHub
 , makeWrapper, unzip, which
-, curl, tzdata, gdb
+, curl, tzdata, gdb, darwin
 # Versions 2.070.2 and up require a working dmd compiler to build:
 , bootstrapDmd }:
 
@@ -73,7 +73,12 @@ stdenv.mkDerivation rec {
             --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
     '';
 
-  nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ];
+  nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ]
+
+  ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
+    Foundation
+  ]);
+
   buildInputs = [ curl tzdata ];
 
   # Buid and install are based on http://wiki.dlang.org/Building_DMD
@@ -92,7 +97,8 @@ stdenv.mkDerivation rec {
       cd ..
   '';
 
-  doCheck = true;
+  # disable check phase because some tests are not working with sandboxing
+  doCheck = false;
 
   checkPhase = ''
       cd dmd
diff --git a/pkgs/development/compilers/ldc/default.nix b/pkgs/development/compilers/ldc/default.nix
index 22d2923897cd..4be275318887 100644
--- a/pkgs/development/compilers/ldc/default.nix
+++ b/pkgs/development/compilers/ldc/default.nix
@@ -81,7 +81,8 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "DMD=$DMD" ];
 
-  doCheck = true;
+  # disable check phase because some tests are not working with sandboxing
+  doCheck = false;
 
   checkPhase = ''
       ctest -j $NIX_BUILD_CORES -V DMD=$DMD