mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-08 14:40:07 +03:00
dmd: Fix bootstrap dmd to build with sandboxing of nixUnstable
This commit is contained in:
parent
d2fdc9cb1f
commit
8fa1b39279
@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
|
|||||||
# Compile with PIC to prevent colliding modules with binutils 2.28.
|
# Compile with PIC to prevent colliding modules with binutils 2.28.
|
||||||
# https://issues.dlang.org/show_bug.cgi?id=17375
|
# https://issues.dlang.org/show_bug.cgi?id=17375
|
||||||
usePIC = "-fPIC";
|
usePIC = "-fPIC";
|
||||||
|
ROOT_HOME_DIR = "$(echo ~root)";
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# Ugly hack so the dlopen call has a chance to succeed.
|
# Ugly hack so the dlopen call has a chance to succeed.
|
||||||
@ -67,19 +68,23 @@ stdenv.mkDerivation rec {
|
|||||||
--replace g++ $CXX
|
--replace g++ $CXX
|
||||||
''
|
''
|
||||||
|
|
||||||
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
|
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||||
substituteInPlace dmd/src/root/port.c \
|
substituteInPlace dmd/src/root/port.c \
|
||||||
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
|
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
|
||||||
''
|
|
||||||
|
|
||||||
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
|
# See https://github.com/NixOS/nixpkgs/issues/29443
|
||||||
substituteInPlace dmd/src/posix.mak \
|
substituteInPlace phobos/std/path.d \
|
||||||
--replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
|
--replace "\"/root" "\"${ROOT_HOME_DIR}"
|
||||||
|
''
|
||||||
|
|
||||||
# Was not able to compile on darwin due to "__inline_isnanl"
|
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||||
# being undefined.
|
substituteInPlace dmd/src/posix.mak \
|
||||||
substituteInPlace dmd/src/root/port.c --replace __inline_isnanl __inline_isnan
|
--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
|
||||||
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper unzip which ];
|
nativeBuildInputs = [ makeWrapper unzip which ];
|
||||||
buildInputs = [ curl tzdata ];
|
buildInputs = [ curl tzdata ];
|
||||||
|
Loading…
Reference in New Issue
Block a user