git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #36258 from ThomasMader/dlang-update

Dlang update

commitbb284c56ce1833639725b650afe49268fd6c06b9 authorJörg Thalheim <Mic92@users.noreply.github.com> dateSun 4 Mar 2018, 05:38 (9 years ago) parentd9a2dfe659e641
3 files changed+35−39
pkgs/development/compilers/dmd/default.nix+30−24 pkgs/development/tools/build-managers/dub/default.nix+2−12 pkgs/development/tools/dtools/default.nix+3−3
pkgs/development/compilers/dmd/default.nix+30−24
@@ -3,10 +3,10 @@
33, curl, tzdata, gdb, darwin
44, callPackage
55, bootstrapVersion ? false
6−, version ? "2.078.2"
7−, dmdSha256 ? "0x9q4aw4jl36dz7m5111y2sm8jdaj3zg36zhj6vqg1lqpdn3bhls"
8−, druntimeSha256 ? "0nfqjcmwqc490bzi3582x1c3zigkf306g4nyd1cyd3vs8lfm6x66"
9−, phobosSha256 ? "08ircpf4ilznz638kra272hz8fi5ccvw2cswj5hqckssl1lyqzs8"
6+, version ? "2.079.0"
7+, dmdSha256 ? "1k6cky71pqnss6h6391p1ich2mjs598f5fda018aygnxg87qgh4y"
8+, druntimeSha256 ? "183pqygj5w4105czs5kswyjn9mrcybx3wmkynz3in0m3ylzzjmvl"
9+, phobosSha256 ? "0y9i86ggmf41ww2xk2bsrlsv9b1blj5dbyan6q6r6xp8dmgrd79w"
1010}:
1111
1212let
@@ -80,17 +80,6 @@ let
8080 "phobos/std/datetime/timezone.d";
8181
8282 phobosPatches = ''
83− substituteInPlace ${datetimePath} \
84− --replace "import core.time;" "import core.time;import std.path;"
85−
86− substituteInPlace ${datetimePath} \
87− --replace "tzName == \"leapseconds\"" "baseName(tzName) == \"leapseconds\""
88−
89− # Ugly hack to fix the hardcoded path to zoneinfo in the source file.
90− # https://issues.dlang.org/show_bug.cgi?id=15391
91− substituteInPlace ${datetimePath} \
92− --replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
93−
9483 # Ugly hack so the dlopen call has a chance to succeed.
9584 # https://issues.dlang.org/show_bug.cgi?id=15391
9685 substituteInPlace phobos/std/net/curl.d \
@@ -102,15 +91,29 @@ let
10291
10392 ''
10493
94+ + stdenv.lib.optionalString (!bootstrapVersion) ''
95+ # Can be removed when https://github.com/dlang/phobos/pull/6224 is included.
96+ substituteInPlace ${datetimePath} \
97+ --replace "foreach (DirEntry de; dirEntries(tzDatabaseDir, SpanMode.depth))" "import std.path : baseName; foreach (DirEntry de; dirEntries(tzDatabaseDir, SpanMode.depth))"
98+
99+ substituteInPlace ${datetimePath} \
100+ --replace "tzName == \"leapseconds\"" "baseName(tzName) == \"leapseconds\""
101+ ''
102+
105103 + stdenv.lib.optionalString (bootstrapVersion) ''
106104 substituteInPlace ${datetimePath} \
107105 --replace "import std.traits;" "import std.traits;import std.path;"
108106
109107 substituteInPlace ${datetimePath} \
110108 --replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
109+
110+ # Ugly hack to fix the hardcoded path to zoneinfo in the source file.
111+ # https://issues.dlang.org/show_bug.cgi?id=15391
112+ substituteInPlace ${datetimePath} \
113+ --replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
111114 ''
112115
113− + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
116+ + stdenv.lib.optionalString (bootstrapVersion && stdenv.hostPlatform.isLinux) ''
114117 # See https://github.com/dlang/phobos/pull/5960
115118 substituteInPlace phobos/std/path.d \
116119 --replace "\"/root" "\"${ROOT_HOME_DIR}"
@@ -122,9 +125,6 @@ let
122125 "dmd";
123126
124127 postPatch = ''
125− # Use proper C++ compiler
126− substituteInPlace ${dmdPath}/posix.mak \
127− --replace g++ $CXX
128128 ''
129129
130130 + stdenv.lib.optionalString (!bootstrapVersion) ''
@@ -132,6 +132,12 @@ let
132132 --replace "DFLAGS:=" "DFLAGS:=${usePIC} "
133133 ''
134134
135+ + stdenv.lib.optionalString (bootstrapVersion) ''
136+ # Use proper C++ compiler
137+ substituteInPlace ${dmdPath}/posix.mak \
138+ --replace g++ $CXX
139+ ''
140+
135141 + phobosPatches
136142
137143 + stdenv.lib.optionalString (stdenv.hostPlatform.isLinux && bootstrapVersion) ''
@@ -145,9 +151,9 @@ let
145151 ''
146152
147153 + stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin && bootstrapVersion) ''
148− # Was not able to compile on darwin due to "__inline_isnanl"
149− # being undefined.
150− substituteInPlace ${dmdPath}/root/port.c --replace __inline_isnanl __inline_isnan
154+ # Was not able to compile on darwin due to "__inline_isnanl"
155+ # being undefined.
156+ substituteInPlace ${dmdPath}/root/port.c --replace __inline_isnanl __inline_isnan
151157 '';
152158
153159 nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ]
@@ -176,7 +182,7 @@ let
176182 cd ../druntime
177183 make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
178184 cd ../phobos
179− make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
185+ make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd} TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/
180186 cd ..
181187 '';
182188
@@ -260,7 +266,7 @@ let
260266
261267 buildPhase = ''
262268 cd phobos
263− make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${dmdBuild}/bin/dmd BUILD=release
269+ make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${dmdBuild}/bin/dmd BUILD=release TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/
264270 '';
265271
266272 installPhase = ''
pkgs/development/tools/build-managers/dub/default.nix+2−12
@@ -4,7 +4,7 @@ let
44
55 dubBuild = stdenv.mkDerivation rec {
66 name = "dubBuild-${version}";
7− version = "1.7.2";
7+ version = "1.8.0";
88
99 enableParallelBuilding = true;
1010
@@ -12,21 +12,13 @@ let
1212 owner = "dlang";
1313 repo = "dub";
1414 rev = "v${version}";
15− sha256 = "073ibvgm1gphcqs1yjrav9ryp677nh3b194nxmvicwgvdc0sb6w9";
15+ sha256 = "0788d375sc6xdak9x6xclkkz243lb7di68yxfvl4v0n178mi22bk";
1616 };
1717
1818 postUnpack = ''
1919 patchShebangs .
2020 '';
2121
22− patches = [
23− # TODO Remove with next release which contains https://github.com/dlang/dub/pull/1354
24− (fetchpatch {
25− url = "https://patch-diff.githubusercontent.com/raw/dlang/dub/pull/1354.patch";
26− sha256 = "01alky8a91qwjmlnfjbrn8kiivwr69f3j4c84cjlxrzfp1ph20ah";
27− })
28− ];
29−
3022 # Can be removed with https://github.com/dlang/dub/pull/1368
3123 dubvar = "\\$DUB";
3224 postPatch = ''
@@ -71,8 +63,6 @@ let
7163
7264 src = dubBuild.src;
7365
74− patches = dubBuild.patches;
75−
7666 postUnpack = dubBuild.postUnpack;
7767 postPatch = dubBuild.postPatch;
7868
pkgs/development/tools/dtools/default.nix+3−3
@@ -2,21 +2,21 @@
22
33stdenv.mkDerivation rec {
44 name = "dtools-${version}";
5− version = "2.078.2";
5+ version = "2.079.0";
66
77 srcs = [
88 (fetchFromGitHub {
99 owner = "dlang";
1010 repo = "dmd";
1111 rev = "v${version}";
12− sha256 = "0x9q4aw4jl36dz7m5111y2sm8jdaj3zg36zhj6vqg1lqpdn3bhls";
12+ sha256 = "1k6cky71pqnss6h6391p1ich2mjs598f5fda018aygnxg87qgh4y";
1313 name = "dmd";
1414 })
1515 (fetchFromGitHub {
1616 owner = "dlang";
1717 repo = "tools";
1818 rev = "v${version}";
19− sha256 = "1cydhn8g0h9i9mygzi80fb5fz3z1f6m8b9gypdvmyhkkzg63kf12";
19+ sha256 = "0fvpfwh3bh3fymrmis3n39x9hkfklmv81lrlqcyl8fmmk694yvad";
2020 name = "dtools";
2121 })
2222 ];