about summary refs log tree commit diff
path: root/pkgs/development/compilers/ldc
diff options
context:
space:
mode:
authorLionello Lunesu <lio+git@lunesu.com>2020-04-19 20:52:41 +0800
committerLionello Lunesu <lio+git@lunesu.com>2020-04-19 20:52:41 +0800
commit0b23e4e5b7a066e3a34775e2a22057c1d1ec461e (patch)
tree3299cae43baff9c836835bb6845adb0146eeb8f0 /pkgs/development/compilers/ldc
parent4c538d022d7a573f9d155842327e5751109bec34 (diff)
Remove top-level ldcBootstrap
Diffstat (limited to 'pkgs/development/compilers/ldc')
-rw-r--r--pkgs/development/compilers/ldc/generic.nix73
1 files changed, 26 insertions, 47 deletions
diff --git a/pkgs/development/compilers/ldc/generic.nix b/pkgs/development/compilers/ldc/generic.nix
index 93ffe37785d70..c93d423945cbd 100644
--- a/pkgs/development/compilers/ldc/generic.nix
+++ b/pkgs/development/compilers/ldc/generic.nix
@@ -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