summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorThomas Mader <thomas.mader@gmail.com>2017-09-16 14:09:50 +0200
committerThomas Mader <thomas.mader@gmail.com>2017-09-16 14:27:49 +0200
commit8fa1b392798858f0521aadf1704d9b52701d6f29 (patch)
treebfd177fb08f780c9209cd7a666fbc7c756b85934 /pkgs/development/compilers
parentd2fdc9cb1f301a11bc5e45e4cbd8581e74e1cd69 (diff)
downloadnixpkgs-8fa1b392798858f0521aadf1704d9b52701d6f29.tar
nixpkgs-8fa1b392798858f0521aadf1704d9b52701d6f29.tar.gz
nixpkgs-8fa1b392798858f0521aadf1704d9b52701d6f29.tar.bz2
nixpkgs-8fa1b392798858f0521aadf1704d9b52701d6f29.tar.lz
nixpkgs-8fa1b392798858f0521aadf1704d9b52701d6f29.tar.xz
nixpkgs-8fa1b392798858f0521aadf1704d9b52701d6f29.tar.zst
nixpkgs-8fa1b392798858f0521aadf1704d9b52701d6f29.zip
dmd: Fix bootstrap dmd to build with sandboxing of nixUnstable
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/dmd/2.067.1.nix27
1 files changed, 16 insertions, 11 deletions
diff --git a/pkgs/development/compilers/dmd/2.067.1.nix b/pkgs/development/compilers/dmd/2.067.1.nix
index 3cf530e9e5e..e2bd9c708dc 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 ];