@@ -3,10 +3,10 @@
|
|||||||
, curl, tzdata, gdb, darwin
|
, curl, tzdata, gdb, darwin
|
||||||
, callPackage
|
, callPackage
|
||||||
, bootstrapVersion ? false
|
, bootstrapVersion ? false
|
||||||
, version ? "2.078.2"
|
, version ? "2.079.0"
|
||||||
, dmdSha256 ? "0x9q4aw4jl36dz7m5111y2sm8jdaj3zg36zhj6vqg1lqpdn3bhls"
|
, dmdSha256 ? "1k6cky71pqnss6h6391p1ich2mjs598f5fda018aygnxg87qgh4y"
|
||||||
, druntimeSha256 ? "0nfqjcmwqc490bzi3582x1c3zigkf306g4nyd1cyd3vs8lfm6x66"
|
, druntimeSha256 ? "183pqygj5w4105czs5kswyjn9mrcybx3wmkynz3in0m3ylzzjmvl"
|
||||||
, phobosSha256 ? "08ircpf4ilznz638kra272hz8fi5ccvw2cswj5hqckssl1lyqzs8"
|
, phobosSha256 ? "0y9i86ggmf41ww2xk2bsrlsv9b1blj5dbyan6q6r6xp8dmgrd79w"
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -80,17 +80,6 @@ let
|
|||||||
"phobos/std/datetime/timezone.d";
|
"phobos/std/datetime/timezone.d";
|
||||||
|
|
||||||
phobosPatches = ''
|
phobosPatches = ''
|
||||||
substituteInPlace ${datetimePath} \
|
|
||||||
--replace "import core.time;" "import core.time;import std.path;"
|
|
||||||
|
|
||||||
substituteInPlace ${datetimePath} \
|
|
||||||
--replace "tzName == \"leapseconds\"" "baseName(tzName) == \"leapseconds\""
|
|
||||||
|
|
||||||
# Ugly hack to fix the hardcoded path to zoneinfo in the source file.
|
|
||||||
# https://issues.dlang.org/show_bug.cgi?id=15391
|
|
||||||
substituteInPlace ${datetimePath} \
|
|
||||||
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
|
|
||||||
|
|
||||||
# Ugly hack so the dlopen call has a chance to succeed.
|
# Ugly hack so the dlopen call has a chance to succeed.
|
||||||
# https://issues.dlang.org/show_bug.cgi?id=15391
|
# https://issues.dlang.org/show_bug.cgi?id=15391
|
||||||
substituteInPlace phobos/std/net/curl.d \
|
substituteInPlace phobos/std/net/curl.d \
|
||||||
@@ -102,15 +91,29 @@ let
|
|||||||
|
|
||||||
''
|
''
|
||||||
|
|
||||||
|
+ stdenv.lib.optionalString (!bootstrapVersion) ''
|
||||||
|
# Can be removed when https://github.com/dlang/phobos/pull/6224 is included.
|
||||||
|
substituteInPlace ${datetimePath} \
|
||||||
|
--replace "foreach (DirEntry de; dirEntries(tzDatabaseDir, SpanMode.depth))" "import std.path : baseName; foreach (DirEntry de; dirEntries(tzDatabaseDir, SpanMode.depth))"
|
||||||
|
|
||||||
|
substituteInPlace ${datetimePath} \
|
||||||
|
--replace "tzName == \"leapseconds\"" "baseName(tzName) == \"leapseconds\""
|
||||||
|
''
|
||||||
|
|
||||||
+ stdenv.lib.optionalString (bootstrapVersion) ''
|
+ stdenv.lib.optionalString (bootstrapVersion) ''
|
||||||
substituteInPlace ${datetimePath} \
|
substituteInPlace ${datetimePath} \
|
||||||
--replace "import std.traits;" "import std.traits;import std.path;"
|
--replace "import std.traits;" "import std.traits;import std.path;"
|
||||||
|
|
||||||
substituteInPlace ${datetimePath} \
|
substituteInPlace ${datetimePath} \
|
||||||
--replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
|
--replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
|
||||||
|
|
||||||
|
# Ugly hack to fix the hardcoded path to zoneinfo in the source file.
|
||||||
|
# https://issues.dlang.org/show_bug.cgi?id=15391
|
||||||
|
substituteInPlace ${datetimePath} \
|
||||||
|
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
|
||||||
''
|
''
|
||||||
|
|
||||||
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
|
+ stdenv.lib.optionalString (bootstrapVersion && stdenv.hostPlatform.isLinux) ''
|
||||||
# See https://github.com/dlang/phobos/pull/5960
|
# See https://github.com/dlang/phobos/pull/5960
|
||||||
substituteInPlace phobos/std/path.d \
|
substituteInPlace phobos/std/path.d \
|
||||||
--replace "\"/root" "\"${ROOT_HOME_DIR}"
|
--replace "\"/root" "\"${ROOT_HOME_DIR}"
|
||||||
@@ -122,9 +125,6 @@ let
|
|||||||
"dmd";
|
"dmd";
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# Use proper C++ compiler
|
|
||||||
substituteInPlace ${dmdPath}/posix.mak \
|
|
||||||
--replace g++ $CXX
|
|
||||||
''
|
''
|
||||||
|
|
||||||
+ stdenv.lib.optionalString (!bootstrapVersion) ''
|
+ stdenv.lib.optionalString (!bootstrapVersion) ''
|
||||||
@@ -132,6 +132,12 @@ let
|
|||||||
--replace "DFLAGS:=" "DFLAGS:=${usePIC} "
|
--replace "DFLAGS:=" "DFLAGS:=${usePIC} "
|
||||||
''
|
''
|
||||||
|
|
||||||
|
+ stdenv.lib.optionalString (bootstrapVersion) ''
|
||||||
|
# Use proper C++ compiler
|
||||||
|
substituteInPlace ${dmdPath}/posix.mak \
|
||||||
|
--replace g++ $CXX
|
||||||
|
''
|
||||||
|
|
||||||
+ phobosPatches
|
+ phobosPatches
|
||||||
|
|
||||||
+ stdenv.lib.optionalString (stdenv.hostPlatform.isLinux && bootstrapVersion) ''
|
+ stdenv.lib.optionalString (stdenv.hostPlatform.isLinux && bootstrapVersion) ''
|
||||||
@@ -145,9 +151,9 @@ let
|
|||||||
''
|
''
|
||||||
|
|
||||||
+ stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin && bootstrapVersion) ''
|
+ stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin && bootstrapVersion) ''
|
||||||
# Was not able to compile on darwin due to "__inline_isnanl"
|
# Was not able to compile on darwin due to "__inline_isnanl"
|
||||||
# being undefined.
|
# being undefined.
|
||||||
substituteInPlace ${dmdPath}/root/port.c --replace __inline_isnanl __inline_isnan
|
substituteInPlace ${dmdPath}/root/port.c --replace __inline_isnanl __inline_isnan
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ]
|
nativeBuildInputs = [ bootstrapDmd makeWrapper unzip which gdb ]
|
||||||
@@ -176,7 +182,7 @@ let
|
|||||||
cd ../druntime
|
cd ../druntime
|
||||||
make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
|
make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
|
||||||
cd ../phobos
|
cd ../phobos
|
||||||
make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
|
make -j$NIX_BUILD_CORES -f posix.mak PIC=1 INSTALL_DIR=$out DMD=${pathToDmd} TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/
|
||||||
cd ..
|
cd ..
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@@ -260,7 +266,7 @@ let
|
|||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
cd phobos
|
cd phobos
|
||||||
make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${dmdBuild}/bin/dmd BUILD=release
|
make -j$NIX_BUILD_CORES -f posix.mak unittest PIC=1 DMD=${dmdBuild}/bin/dmd BUILD=release TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ let
|
|||||||
|
|
||||||
dubBuild = stdenv.mkDerivation rec {
|
dubBuild = stdenv.mkDerivation rec {
|
||||||
name = "dubBuild-${version}";
|
name = "dubBuild-${version}";
|
||||||
version = "1.7.2";
|
version = "1.8.0";
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
@@ -12,21 +12,13 @@ let
|
|||||||
owner = "dlang";
|
owner = "dlang";
|
||||||
repo = "dub";
|
repo = "dub";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "073ibvgm1gphcqs1yjrav9ryp677nh3b194nxmvicwgvdc0sb6w9";
|
sha256 = "0788d375sc6xdak9x6xclkkz243lb7di68yxfvl4v0n178mi22bk";
|
||||||
};
|
};
|
||||||
|
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
patchShebangs .
|
patchShebangs .
|
||||||
'';
|
'';
|
||||||
|
|
||||||
patches = [
|
|
||||||
# TODO Remove with next release which contains https://github.com/dlang/dub/pull/1354
|
|
||||||
(fetchpatch {
|
|
||||||
url = "https://patch-diff.githubusercontent.com/raw/dlang/dub/pull/1354.patch";
|
|
||||||
sha256 = "01alky8a91qwjmlnfjbrn8kiivwr69f3j4c84cjlxrzfp1ph20ah";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
# Can be removed with https://github.com/dlang/dub/pull/1368
|
# Can be removed with https://github.com/dlang/dub/pull/1368
|
||||||
dubvar = "\\$DUB";
|
dubvar = "\\$DUB";
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
@@ -71,8 +63,6 @@ let
|
|||||||
|
|
||||||
src = dubBuild.src;
|
src = dubBuild.src;
|
||||||
|
|
||||||
patches = dubBuild.patches;
|
|
||||||
|
|
||||||
postUnpack = dubBuild.postUnpack;
|
postUnpack = dubBuild.postUnpack;
|
||||||
postPatch = dubBuild.postPatch;
|
postPatch = dubBuild.postPatch;
|
||||||
|
|
||||||
|
|||||||
@@ -2,21 +2,21 @@
|
|||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "dtools-${version}";
|
name = "dtools-${version}";
|
||||||
version = "2.078.2";
|
version = "2.079.0";
|
||||||
|
|
||||||
srcs = [
|
srcs = [
|
||||||
(fetchFromGitHub {
|
(fetchFromGitHub {
|
||||||
owner = "dlang";
|
owner = "dlang";
|
||||||
repo = "dmd";
|
repo = "dmd";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0x9q4aw4jl36dz7m5111y2sm8jdaj3zg36zhj6vqg1lqpdn3bhls";
|
sha256 = "1k6cky71pqnss6h6391p1ich2mjs598f5fda018aygnxg87qgh4y";
|
||||||
name = "dmd";
|
name = "dmd";
|
||||||
})
|
})
|
||||||
(fetchFromGitHub {
|
(fetchFromGitHub {
|
||||||
owner = "dlang";
|
owner = "dlang";
|
||||||
repo = "tools";
|
repo = "tools";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "1cydhn8g0h9i9mygzi80fb5fz3z1f6m8b9gypdvmyhkkzg63kf12";
|
sha256 = "0fvpfwh3bh3fymrmis3n39x9hkfklmv81lrlqcyl8fmmk694yvad";
|
||||||
name = "dtools";
|
name = "dtools";
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user