@@ -1,11 +1,11 @@
11{ stdenv, fetchFromGitHub
22, makeWrapper, unzip, which
3−, curl, tzdata, gdb, darwin
3+, curl, tzdata, gdb, darwin, git
44, callPackage, targetPackages, ldc
5−, version ? "2.083.1"
6−, dmdSha256 ? "0b52yq7slgbrawb22kib9bk2x9xjiy6axwz1317fck5axl093d90"
7−, druntimeSha256 ? "1hm9p59ih21yv8x7cqjhkyy94677q4f8wk9fs9i1rybx8x19njyn"
8−, phobosSha256 ? "1zmz0f1wj0dgxy2cy63ljjc1sl2sgb7ij8bamlxw9nxrchwi3l43"
5+, version ? "2.084.0"
6+, dmdSha256 ? "1v61spdamncl8c1bzjc19b03p4jl0ih5zq9b7cqsy9ix7qaxmikf"
7+, druntimeSha256 ? "0vp414j6s11l9s54v81np49mv60ywmd7nnk41idkbwrq0nz4sfrq"
8+, phobosSha256 ? "1wp7z1x299b0w9ny1ah2wrfhrs05vc4bk51csgw9774l3dqcnv53"
99}:
1010
1111let
@@ -42,50 +42,22 @@ let
4242
4343 sourceRoot = ".";
4444
45+ # https://issues.dlang.org/show_bug.cgi?id=19553
46+ hardeningDisable = [ "fortify" ];
47+
4548 postUnpack = ''
4649 patchShebangs .
47−
48− # Remove cppa test for now because it doesn't work.
49− rm dmd/test/runnable/cppa.d
50− rm dmd/test/runnable/extra-files/cppb.cpp
51− ''
52−
53− + stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin) ''
54− rm dmd/test/runnable/test16096.sh
55− '';
56−
57− # Compile with PIC to prevent colliding modules with binutils 2.28.
58− # https://issues.dlang.org/show_bug.cgi?id=17375
59− usePIC = "-fPIC";
60−
61− phobosPatches = ''
62− # Ugly hack so the dlopen call has a chance to succeed.
63− # https://issues.dlang.org/show_bug.cgi?id=15391
64− substituteInPlace phobos/std/net/curl.d \
65− --replace libcurl.so ${curl.out}/lib/libcurl.so
66−
67− # phobos uses curl, so we need to patch the path to the lib.
68− substituteInPlace phobos/posix.mak \
69− --replace "-soname=libcurl.so.4" "-soname=${curl.out}/lib/libcurl.so.4"
70−
7150 '';
7251
7352 postPatch = ''
74− substituteInPlace druntime/test/common.mak \
75− --replace "DFLAGS:=" "DFLAGS:=${usePIC} "
76−
77− substituteInPlace dmd/src/posix.mak \
78− --replace "DFLAGS :=" "DFLAGS += -link-defaultlib-shared=false"
79− ''
53+ substituteInPlace dmd/test/compilable/extra-files/ddocYear.html \
54+ --replace "2018" "__YEAR__"
8055
81− + phobosPatches
82−
83− + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
84− substituteInPlace dmd/posix.mak \
85− --replace MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET_
56+ substituteInPlace dmd/test/runnable/test16096.sh \
57+ --replace "{EXT}" "{EXE}"
8658 '';
8759
88− nativeBuildInputs = [ ldc makeWrapper unzip which gdb ]
60+ nativeBuildInputs = [ ldc makeWrapper unzip which gdb git ]
8961
9062 ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
9163 Foundation
@@ -109,7 +81,8 @@ let
10981 make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
11082 cd ../phobos
11183 echo ${tzdata}/share/zoneinfo/ > TZDatabaseDirFile
112− make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd} DFLAGS="-version=TZDatabaseDir -J$(pwd)"
84+ echo ${curl.out}/lib/libcurl.so > LibcurlPathFile
85+ make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd} DFLAGS="-version=TZDatabaseDir -version=LibcurlPath -J$(pwd)"
11386 cd ..
11487 '';
11588
@@ -119,7 +92,7 @@ let
11992
12093 checkPhase = ''
12194 cd dmd
122− make -j$NIX_BUILD_CORES -C test -f Makefile PIC=1 DMD=${pathToDmd} BUILD=release SHARED=0 SHELL=$SHELL
95+ make -j$NIX_BUILD_CORES -C test -f Makefile PIC=1 CC=$CXX DMD=${pathToDmd} BUILD=release SHARED=0 SHELL=$SHELL
12396 cd ../druntime
12497 make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${pathToDmd} BUILD=release
12598 cd ..
@@ -194,15 +167,14 @@ let
194167
195168 sourceRoot = ".";
196169
197− postPatch = dmdBuild.phobosPatches;
198−
199170 nativeBuildInputs = dmdBuild.nativeBuildInputs;
200171 buildInputs = dmdBuild.buildInputs;
201172
202173 buildPhase = ''
203174 cd phobos
204175 echo ${tzdata}/share/zoneinfo/ > TZDatabaseDirFile
205− make -j$NIX_BUILD_CORES -f posix.mak unittest BUILD=release ENABLE_RELEASE=1 PIC=1 DMD=${dmdBuild}/bin/dmd DFLAGS="-version=TZDatabaseDir -J$(pwd)"
176+ echo ${curl.out}/lib/libcurl.so > LibcurlPathFile
177+ make -j$NIX_BUILD_CORES -f posix.mak unittest BUILD=release ENABLE_RELEASE=1 PIC=1 DMD=${dmdBuild}/bin/dmd DFLAGS="-version=TZDatabaseDir -version=LibcurlPath -J$(pwd)"
206178 '';
207179
208180 installPhase = ''