Merge pull request #59197 from ThomasMader/dlang-update

Dlang update (ldc: 1.14.0 -> 1.15.0, dmd: 2.084.1 -> 2.085.1, dtools: 2.084.1 -> 2.085.1, dub: 1.13.0 -> 1.14.0)
This commit is contained in:
Dmitry Kalinkin 2019-04-13 19:51:16 -04:00 committed by GitHub
commit aa111a2b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 23 deletions

View File

@ -2,10 +2,10 @@
, makeWrapper, unzip, which, writeTextFile , makeWrapper, unzip, which, writeTextFile
, curl, tzdata, gdb, darwin, git , curl, tzdata, gdb, darwin, git
, callPackage, targetPackages, ldc , callPackage, targetPackages, ldc
, version ? "2.084.1" , version ? "2.085.1"
, dmdSha256 ? "10ll5072rkv3ln7i5l88h2f9mzda567kw2jwh6466vm6ylzl4jms" , dmdSha256 ? "0ccidfcawrcwdpfjwjiln5xwr4ffp8i2hwx52p8zn3xmc5yxm660"
, druntimeSha256 ? "0i0g2cnzh097pmvb86gvyj79canaxppw33hp7ylqnd11q4kqc8pb" , druntimeSha256 ? "109f2glsqrlshk06761xlw4r5v22mivp873cq9g5gcax3g00k617"
, phobosSha256 ? "1hxpismj9gy5n1bc9kl9ykgd4lfmkq9i8xgrq09j0fybfwn9j1gc" , phobosSha256 ? "0giispqqx8j8xg6c0hm7nx77bcahiwic8rvf12sws3sv5pizv8pr"
}: }:
let let
@ -51,14 +51,6 @@ stdenv.mkDerivation rec {
}) })
]; ];
patches = [
(fetchpatch {
name = "fix-loader-import.patch";
url = "https://github.com/dlang/dmd/commit/e7790436c4af1910b8c079dac9bb69627d7dea4b.patch";
sha256 = "0w69hajx8agywc7m2hph5m27g2yclz8ml0gjjyjk9k6ii3jv45kx";
})
];
patchFlags = [ "--directory=dmd" "-p1" ]; patchFlags = [ "--directory=dmd" "-p1" ];
sourceRoot = "."; sourceRoot = ".";

View File

@ -1,9 +1,9 @@
{ stdenv, fetchurl, cmake, llvm, curl, tzdata { stdenv, fetchurl, cmake, ninja, llvm, llvm_8, curl, tzdata
, python, libconfig, lit, gdb, unzip, darwin, bash , python, libconfig, lit, gdb, unzip, darwin, bash
, callPackage, makeWrapper, targetPackages , callPackage, makeWrapper, targetPackages
, bootstrapVersion ? false , bootstrapVersion ? false
, version ? "1.14.0" , version ? "1.15.0"
, ldcSha256 ? "147vlzzzjx2n6zyz9wj54gj046i1mw5p5wixwzi5wkllgxghyy9c" , ldcSha256 ? "1qnfy2q8zkywvby7wa8jm20mlpghn28x6w357cpc8hi56g7y1q6p"
}: }:
let let
@ -37,6 +37,12 @@ stdenv.mkDerivation rec {
patchShebangs . patchShebangs .
'' ''
+ stdenv.lib.optionalString (!bootstrapVersion) ''
rm ldc-${version}-src/tests/d2/dmd-testsuite/fail_compilation/mixin_gc.d
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/xtest46_gc.d
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/testptrref_gc.d
''
+ stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) '' + stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
# https://github.com/NixOS/nixpkgs/issues/34817 # https://github.com/NixOS/nixpkgs/issues/34817
rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall
@ -68,19 +74,29 @@ stdenv.mkDerivation rec {
substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan
''; '';
nativeBuildInputs = [ cmake makeWrapper llvm unzip ] nativeBuildInputs = [ cmake ninja makeWrapper unzip ]
++ stdenv.lib.optional (!bootstrapVersion) [ ++ stdenv.lib.optional (!bootstrapVersion) [
bootstrapLdc python lit bootstrapLdc python lit
] ]
++ stdenv.lib.optional (!bootstrapVersion && stdenv.hostPlatform.isDarwin) [
# https://github.com/NixOS/nixpkgs/issues/57120
# https://github.com/NixOS/nixpkgs/pull/59197#issuecomment-481972515
llvm
]
++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin) [
llvm_8
]
++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin) [ ++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin) [
# https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818 # https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
gdb gdb
] ]
++ stdenv.lib.optional (bootstrapVersion) [ ++ stdenv.lib.optional (bootstrapVersion) [
libconfig libconfig llvm
] ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
@ -123,6 +139,7 @@ stdenv.mkDerivation rec {
} }
fixDarwinDylibNames $(find "$(pwd)/lib" -name "*.dylib") fixDarwinDylibNames $(find "$(pwd)/lib" -name "*.dylib")
export DYLD_LIBRARY_PATH=$(pwd)/lib
'' ''
else else
""; "";
@ -137,7 +154,7 @@ stdenv.mkDerivation rec {
checkPhase = stdenv.lib.optionalString doCheck '' checkPhase = stdenv.lib.optionalString doCheck ''
# Build default lib test runners # Build default lib test runners
make -j$NIX_BUILD_CORES all-test-runners ninja -j$NIX_BUILD_CORES all-test-runners
${fixNames} ${fixNames}

View File

@ -2,7 +2,7 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "dub-${version}"; name = "dub-${version}";
version = "1.13.0"; version = "1.14.0";
enableParallelBuilding = true; enableParallelBuilding = true;
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
owner = "dlang"; owner = "dlang";
repo = "dub"; repo = "dub";
rev = "v${version}"; rev = "v${version}";
sha256 = "1wd5pdnbaafj33bbg188w0iz28ps4cyjangb12g2s9dyic29zjqv"; sha256 = "070kfkyrkr98y1hbhcf85842c0x7l95w1ambrkdgajpb6kcmpf84";
}; };
postUnpack = '' postUnpack = ''

View File

@ -2,21 +2,21 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "dtools-${version}"; name = "dtools-${version}";
version = "2.084.1"; version = "2.085.1";
srcs = [ srcs = [
(fetchFromGitHub { (fetchFromGitHub {
owner = "dlang"; owner = "dlang";
repo = "dmd"; repo = "dmd";
rev = "v${version}"; rev = "v${version}";
sha256 = "10ll5072rkv3ln7i5l88h2f9mzda567kw2jwh6466vm6ylzl4jms"; sha256 = "0ccidfcawrcwdpfjwjiln5xwr4ffp8i2hwx52p8zn3xmc5yxm660";
name = "dmd"; name = "dmd";
}) })
(fetchFromGitHub { (fetchFromGitHub {
owner = "dlang"; owner = "dlang";
repo = "tools"; repo = "tools";
rev = "v${version}"; rev = "v${version}";
sha256 = "0z3xkv9s1pdx8zdhsb92mwax2q5xhwjgh6g3iv53xip1nsxygn48"; sha256 = "1x85w4k2zqgv2bjbvhschxdc6kq8ygp89h499cy8rfqm6q23g0ws";
name = "dtools"; name = "dtools";
}) })
]; ];