ldc: wrap ldc2 binary with C compiler because it's needed for linking
This commit is contained in:
parent
fe2deeb458
commit
893ba5d1b8
@ -1,6 +1,6 @@
|
|||||||
{ stdenv, fetchgit, fetchurl, cmake, llvm, curl, tzdata
|
{ stdenv, fetchgit, fetchurl, cmake, llvm, curl, tzdata
|
||||||
, python, libconfig, lit, gdb, unzip, darwin, bash
|
, python, libconfig, lit, gdb, unzip, darwin, bash
|
||||||
, callPackage
|
, callPackage, makeWrapper, targetPackages
|
||||||
, bootstrapVersion ? false
|
, bootstrapVersion ? false
|
||||||
, version ? "1.8.0"
|
, version ? "1.8.0"
|
||||||
, ldcSha256 ? "0zswjlibj8zcdj06nn09jjhbd99chsa5f4kps8xifzgrpgsa28g4"
|
, ldcSha256 ? "0zswjlibj8zcdj06nn09jjhbd99chsa5f4kps8xifzgrpgsa28g4"
|
||||||
@ -124,7 +124,7 @@ let
|
|||||||
--replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
|
--replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake llvm bootstrapLdc python lit gdb unzip ]
|
nativeBuildInputs = [ cmake makeWrapper llvm bootstrapLdc python lit gdb unzip ]
|
||||||
|
|
||||||
++ stdenv.lib.optional (bootstrapVersion) [
|
++ stdenv.lib.optional (bootstrapVersion) [
|
||||||
libconfig
|
libconfig
|
||||||
@ -135,7 +135,7 @@ let
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
buildInputs = [ curl tzdata stdenv.cc ];
|
buildInputs = [ curl tzdata ];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
cmakeFlagsArray=("-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc"
|
cmakeFlagsArray=("-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc"
|
||||||
@ -158,14 +158,20 @@ let
|
|||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
# Build and run LDC D unittests.
|
# Build and run LDC D unittests.
|
||||||
ctest --output-on-failure -R "ldc2-unittest"
|
ctest --output-on-failure -R "ldc2-unittest"
|
||||||
# Run LIT testsuite.
|
# Run LIT testsuite.
|
||||||
ctest -V -R "lit-tests"
|
ctest -V -R "lit-tests"
|
||||||
# Run DMD testsuite.
|
# Run DMD testsuite.
|
||||||
DMD_TESTSUITE_MAKE_ARGS=-j$NIX_BUILD_CORES ctest -V -R "dmd-testsuite"
|
DMD_TESTSUITE_MAKE_ARGS=-j$NIX_BUILD_CORES ctest -V -R "dmd-testsuite"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
wrapProgram $out/bin/ldc2 \
|
||||||
|
--prefix PATH ":" "${targetPackages.stdenv.cc}/bin" \
|
||||||
|
--set-default CC "${targetPackages.stdenv.cc}/bin/cc"
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "The LLVM-based D compiler";
|
description = "The LLVM-based D compiler";
|
||||||
homepage = https://github.com/ldc-developers/ldc;
|
homepage = https://github.com/ldc-developers/ldc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user