diff options
author | Robin Gloster <mail@glob.in> | 2019-11-09 22:18:05 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2019-12-31 00:55:49 +0100 |
commit | a012d5eebba466d778945573295b22b2a0a1f3fd (patch) | |
tree | 974bb6c6c18cdd1aa284937dd9c040a5de26d02e /pkgs/development/compilers/ldc | |
parent | cbbba87b98efb6e3924965ebb6629d13efa6f671 (diff) |
ldc: fix for structured attrs
Diffstat (limited to 'pkgs/development/compilers/ldc')
-rw-r--r-- | pkgs/development/compilers/ldc/default.nix | 68 |
1 files changed, 24 insertions, 44 deletions
diff --git a/pkgs/development/compilers/ldc/default.nix b/pkgs/development/compilers/ldc/default.nix index 03e6fa82b9d0a..fff6435b29eac 100644 --- a/pkgs/development/compilers/ldc/default.nix +++ b/pkgs/development/compilers/ldc/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "fortify" ]; postUnpack = '' - patchShebangs . + patchShebangs . '' + stdenv.lib.optionalString (!bootstrapVersion) '' @@ -76,47 +76,31 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ cmake ninja makeWrapper unzip ] - - ++ stdenv.lib.optional (!bootstrapVersion) [ - 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_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.optional (bootstrapVersion) [ - libconfig llvm_5 - ] - - ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ - Foundation - ]); + ++ stdenv.lib.optionals (!bootstrapVersion) [ + 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_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; buildInputs = [ curl tzdata ]; - cmakeFlagsString = stdenv.lib.optionalString (!bootstrapVersion) '' + cmakeFlags = stdenv.lib.optionals (!bootstrapVersion) [ "-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J$PWD" "-DCMAKE_BUILD_TYPE=Release" - ''; - - preConfigure = stdenv.lib.optionalString (!bootstrapVersion) '' - cmakeFlagsArray=( - ${cmakeFlagsString} - ) - ''; + ]; postConfigure = '' export DMD=$PWD/bin/ldmd2 @@ -124,7 +108,7 @@ stdenv.mkDerivation rec { makeFlags = [ "DMD=$DMD" ]; - fixNames = if stdenv.hostPlatform.isDarwin then '' + fixNames = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' fixDarwinDylibNames() { local flags=() @@ -141,15 +125,11 @@ stdenv.mkDerivation rec { fixDarwinDylibNames $(find "$(pwd)/lib" -name "*.dylib") export DYLD_LIBRARY_PATH=$(pwd)/lib - '' - else - ""; + ''; # https://github.com/ldc-developers/ldc/issues/2497#issuecomment-459633746 - additionalExceptions = if stdenv.hostPlatform.isDarwin then - "|druntime-test-shared" - else - ""; + additionalExceptions = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin + "|druntime-test-shared"; doCheck = !bootstrapVersion; |