ldc: fix build and skip impure test
Fixes #76973 This moves the path configuration to a separate derivation and skips an impure test that depends on the current year.
This commit is contained in:
parent
2e765ef206
commit
4b102f0f07
@ -1,6 +1,6 @@
|
|||||||
{ stdenv, fetchurl, cmake, ninja, llvm_5, llvm_8, curl, tzdata
|
{ stdenv, fetchurl, cmake, ninja, llvm_5, llvm_8, curl, tzdata
|
||||||
, python, libconfig, lit, gdb, unzip, darwin, bash
|
, python, libconfig, lit, gdb, unzip, darwin, bash
|
||||||
, callPackage, makeWrapper, targetPackages
|
, callPackage, makeWrapper, runCommand, targetPackages
|
||||||
, bootstrapVersion ? false
|
, bootstrapVersion ? false
|
||||||
, version ? "1.17.0"
|
, version ? "1.17.0"
|
||||||
, ldcSha256 ? "1aag5jfrng6p4ms0fs90hjbv9bcj3hj8h52r68c3cm6racdajbva"
|
, ldcSha256 ? "1aag5jfrng6p4ms0fs90hjbv9bcj3hj8h52r68c3cm6racdajbva"
|
||||||
@ -18,6 +18,11 @@ let
|
|||||||
else
|
else
|
||||||
"";
|
"";
|
||||||
|
|
||||||
|
pathConfig = runCommand "ldc-lib-paths" {} ''
|
||||||
|
mkdir $out
|
||||||
|
echo ${tzdata}/share/zoneinfo/ > $out/TZDatabaseDirFile
|
||||||
|
echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -42,17 +47,14 @@ stdenv.mkDerivation rec {
|
|||||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/fail_compilation/mixin_gc.d
|
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/xtest46_gc.d
|
||||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/testptrref_gc.d
|
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/testptrref_gc.d
|
||||||
|
|
||||||
|
# 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 (!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
|
||||||
''
|
|
||||||
|
|
||||||
+ stdenv.lib.optionalString (!bootstrapVersion) ''
|
|
||||||
echo ${tzdata}/share/zoneinfo/ > ldc-${version}-src/TZDatabaseDirFile
|
|
||||||
|
|
||||||
echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > ldc-${version}-src/LibcurlPathFile
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
@ -98,7 +100,7 @@ stdenv.mkDerivation rec {
|
|||||||
buildInputs = [ curl tzdata ];
|
buildInputs = [ curl tzdata ];
|
||||||
|
|
||||||
cmakeFlags = stdenv.lib.optionals (!bootstrapVersion) [
|
cmakeFlags = stdenv.lib.optionals (!bootstrapVersion) [
|
||||||
"-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J$PWD"
|
"-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J${pathConfig}"
|
||||||
"-DCMAKE_BUILD_TYPE=Release"
|
"-DCMAKE_BUILD_TYPE=Release"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user