dmd: Fix bootstrap dmd to build with sandboxing of nixUnstable

This commit is contained in:
Thomas Mader 2017-09-16 14:09:50 +02:00
parent d2fdc9cb1f
commit 8fa1b39279

View file

@ -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.
@ -70,6 +71,10 @@ stdenv.mkDerivation rec {
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace dmd/src/root/port.c \
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
# See https://github.com/NixOS/nixpkgs/issues/29443
substituteInPlace phobos/std/path.d \
--replace "\"/root" "\"${ROOT_HOME_DIR}"
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''