Remove top-level ldcBootstrap

This commit is contained in:
Lionello Lunesu 2020-04-19 20:52:41 +08:00
parent 4c538d022d
commit 0b23e4e5b7
2 changed files with 26 additions and 48 deletions

View file

@ -1,10 +1,8 @@
{ bootstrapVersion ? false
, version
, ldcSha256
}:
{ version, ldcSha256 }:
{ stdenv, fetchurl, cmake, ninja, llvm_5, llvm_8, curl, tzdata
, libconfig, lit, gdb, unzip, darwin, bash, ldcBootstrap
, libconfig, lit, gdb, unzip, darwin, bash
, callPackage, makeWrapper, runCommand, targetPackages
, ldcBootstrap ? callPackage ./bootstrap.nix { }
}:
let
@ -14,8 +12,6 @@ let
echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile
'';
bootstrapLdc = if bootstrapVersion then null else ldcBootstrap;
in
stdenv.mkDerivation rec {
@ -35,8 +31,7 @@ stdenv.mkDerivation rec {
postUnpack = ''
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
@ -44,54 +39,40 @@ stdenv.mkDerivation rec {
# test depends on current year
rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/ddocYear.d
''
+ stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
# https://github.com/NixOS/nixpkgs/issues/34817
rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall
'';
postPatch = ''
# Setting SHELL=$SHELL when dmd testsuite is run doesn't work on Linux somehow
substituteInPlace tests/d2/dmd-testsuite/Makefile --replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash"
''
+ stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isLinux) ''
# Setting SHELL=$SHELL when dmd testsuite is run doesn't work on Linux somehow
substituteInPlace tests/d2/dmd-testsuite/Makefile --replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash"
''
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace runtime/phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
''
+ stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace runtime/phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)"
''
+ stdenv.lib.optionalString (bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
# Was not able to compile on darwin due to "__inline_isnanl"
# being undefined.
# TODO Remove with version > 0.17.6
substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan
'';
nativeBuildInputs = [ cmake ninja makeWrapper unzip ]
++ stdenv.lib.optionals (!bootstrapVersion) [
bootstrapLdc lit lit.python
]
++ stdenv.lib.optional (!bootstrapVersion && stdenv.hostPlatform.isDarwin)
# https://github.com/NixOS/nixpkgs/issues/57120
# https://github.com/NixOS/nixpkgs/pull/59197#issuecomment-481972515
llvm_5
++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin)
llvm_8
++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin)
# https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
gdb
++ stdenv.lib.optionals (bootstrapVersion) [
libconfig llvm_5
]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin
darwin.apple_sdk.frameworks.Foundation;
nativeBuildInputs = [
cmake ninja makeWrapper unzip ldcBootstrap lit lit.python
]
++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Foundation
# https://github.com/NixOS/nixpkgs/issues/57120
# https://github.com/NixOS/nixpkgs/pull/59197#issuecomment-481972515
llvm_5
]
++ stdenv.lib.optionals (!stdenv.hostPlatform.isDarwin) [
llvm_8
# https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
gdb
];
buildInputs = [ curl tzdata ];
cmakeFlags = stdenv.lib.optionals (!bootstrapVersion) [
cmakeFlags = [
"-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J${pathConfig}"
"-DCMAKE_BUILD_TYPE=Release"
];
@ -125,9 +106,7 @@ stdenv.mkDerivation rec {
additionalExceptions = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin
"|druntime-test-shared";
doCheck = !bootstrapVersion;
checkPhase = stdenv.lib.optionalString doCheck ''
checkPhase = ''
# Build default lib test runners
ninja -j$NIX_BUILD_CORES all-test-runners

View file

@ -4554,7 +4554,6 @@ in
lalezar-fonts = callPackage ../data/fonts/lalezar-fonts { };
ldcBootstrap = callPackage ../development/compilers/ldc/bootstrap.nix { };
ldc = callPackage ../development/compilers/ldc { };
lbreakout2 = callPackage ../games/lbreakout2 { };