Merge pull request #82694 from lionello/dmd-bootstrap

dmd: 2.085.1 -> 2.091.1

authored by

worldofpeace and committed by
GitHub
3b00e78e 02218dd9

+284 -184
+52
pkgs/development/compilers/dmd/binary.nix
··· 1 + { stdenv, fetchurl, curl, tzdata, autoPatchelfHook, fixDarwinDylibNames, glibc 2 + , version, hashes }: 3 + with stdenv; 4 + let 5 + OS = if hostPlatform.isDarwin then "osx" else hostPlatform.parsed.kernel.name; 6 + MODEL = toString hostPlatform.parsed.cpu.bits; 7 + in mkDerivation { 8 + pname = "dmd-bootstrap"; 9 + inherit version; 10 + 11 + src = fetchurl rec { 12 + name = "dmd.${version}.${OS}.tar.xz"; 13 + url = "http://downloads.dlang.org/releases/2.x/${version}/${name}"; 14 + sha256 = hashes.${OS} or (throw "missing bootstrap sha256 for OS ${OS}"); 15 + }; 16 + 17 + dontConfigure = true; 18 + dontBuild = true; 19 + 20 + nativeBuildInputs = [ fixDarwinDylibNames autoPatchelfHook ]; 21 + propagatedBuildInputs = [ curl tzdata ] ++ lib.optional hostPlatform.isLinux glibc; 22 + 23 + installPhase = '' 24 + mkdir -p $out 25 + 26 + # try to copy model-specific binaries into bin first 27 + mv ${OS}/bin${MODEL} $out/bin || true 28 + 29 + mv src license.txt ${OS}/* $out/ 30 + 31 + # move man into place 32 + mkdir -p $out/share 33 + mv man $out/share/ 34 + 35 + # move docs into place 36 + mkdir -p $out/share/doc 37 + mv html/d $out/share/doc/ 38 + 39 + # fix paths in dmd.conf (one level less) 40 + substituteInPlace $out/bin/dmd.conf --replace "/../../" "/../" 41 + ''; 42 + 43 + meta = with lib; { 44 + inherit version; 45 + description = "Digital Mars D Compiler Package"; 46 + # As of 2.075 all sources and binaries use the boost license 47 + license = licenses.boost; 48 + maintainers = [ maintainers.lionello ]; 49 + homepage = "https://dlang.org/"; 50 + platforms = [ "x86_64-darwin" "i686-linux" "x86_64-linux" ]; 51 + }; 52 + }
+9
pkgs/development/compilers/dmd/bootstrap.nix
··· 1 + { callPackage }: 2 + callPackage ./binary.nix { 3 + version = "2.090.1"; 4 + hashes = { 5 + # Get these from `nix-prefetch-url http://downloads.dlang.org/releases/2.x/2.090.1/dmd.2.090.1.linux.tar.xz` etc.. 6 + osx = "0rbn7j4dr3q0y09fblpj999bi063pi4230rqd5xgd3gwxxa0cz7l"; 7 + linux = "1vk6lsvd6y7ccvffd23yial4ig90azaxf2rxc6yvidqd1qhan807"; 8 + }; 9 + }
+26 -13
pkgs/development/compilers/dmd/default.nix
··· 1 1 { stdenv, lib, fetchFromGitHub 2 2 , makeWrapper, unzip, which, writeTextFile 3 - , curl, tzdata, gdb, darwin, git 4 - , targetPackages, ldc 5 - , version ? "2.085.1" 6 - , dmdSha256 ? "0ccidfcawrcwdpfjwjiln5xwr4ffp8i2hwx52p8zn3xmc5yxm660" 7 - , druntimeSha256 ? "109f2glsqrlshk06761xlw4r5v22mivp873cq9g5gcax3g00k617" 8 - , phobosSha256 ? "0giispqqx8j8xg6c0hm7nx77bcahiwic8rvf12sws3sv5pizv8pr" 3 + , curl, tzdata, gdb, darwin, git, callPackage 4 + , targetPackages, fetchpatch, bash 5 + , dmdBootstrap ? callPackage ./bootstrap.nix { } 6 + , HOST_DMD ? "${dmdBootstrap}/bin/dmd" 7 + , version ? "2.091.1" 8 + , dmdSha256 ? "0brz0n84jdkhr4sq4k91w48p739psbhbb1jk2pi9q60psmx353yr" 9 + , druntimeSha256 ? "0smgpmfriffh110ksski1s5j921kmxbc2zjy0dyj9ksyrxbzklbl" 10 + , phobosSha256 ? "1n00anajgibrfs1xzvrmag28hvbvkc0w1fwlimqbznvhf28rhrxs" 9 11 }: 10 12 11 13 let ··· 51 53 }) 52 54 ]; 53 55 54 - patchFlags = [ "--directory=dmd" "-p1" ]; 56 + patchFlags = [ "--directory=dmd" "-p1" "-F3" ]; 57 + patches = [ 58 + (fetchpatch { 59 + url = "https://github.com/dlang/dmd/commit/4157298cf04f7aae9f701432afd1de7b7e05c30f.patch"; 60 + sha256 = "0v4xgqmrx5r8vbx5a4v88s0xnm23mam9nm99yfga7s2sxr0hi5p2"; 61 + }) 62 + (fetchpatch { 63 + url = "https://github.com/dlang/dmd/commit/1b8a4c90b040bf2f0b68a2739de4991315580b13.patch"; 64 + sha256 = "1iih6aalv4fsw9mbrlrybhngkkchzzrzg7q8zl047w36c0x397cs"; 65 + }) 66 + ]; 55 67 56 68 sourceRoot = "."; 57 69 ··· 62 74 patchShebangs . 63 75 ''; 64 76 65 - postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' 77 + postPatch = '' 78 + substituteInPlace dmd/test/dshell/test6952.d --replace "/usr/bin/env bash" "${bash}/bin/bash" 79 + '' 80 + + stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' 66 81 substituteInPlace phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" "" 67 82 '' 68 - 69 83 + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' 70 84 substituteInPlace phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)" 71 85 ''; 72 86 73 - nativeBuildInputs = [ ldc makeWrapper unzip which gdb git ] 87 + nativeBuildInputs = [ makeWrapper unzip which gdb git ] 74 88 75 89 ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ 76 90 Foundation ··· 89 103 # Buid and install are based on http://wiki.dlang.org/Building_DMD 90 104 buildPhase = '' 91 105 cd dmd 92 - make -j$NIX_BUILD_CORES -f posix.mak INSTALL_DIR=$out BUILD=release ENABLE_RELEASE=1 PIC=1 HOST_DMD=ldmd2 106 + make -j$NIX_BUILD_CORES -f posix.mak INSTALL_DIR=$out BUILD=release ENABLE_RELEASE=1 PIC=1 HOST_DMD=${HOST_DMD} 93 107 cd ../druntime 94 108 make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd} 95 109 cd ../phobos ··· 147 161 # Everything is now Boost licensed, even the backend. 148 162 # https://github.com/dlang/dmd/pull/6680 149 163 license = licenses.boost; 150 - maintainers = with maintainers; [ ThomasMader ]; 164 + maintainers = with maintainers; [ ThomasMader lionello ]; 151 165 platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]; 152 166 }; 153 167 } 154 -
+41
pkgs/development/compilers/ldc/binary.nix
··· 1 + { stdenv, fetchurl, curl, tzdata, autoPatchelfHook, fixDarwinDylibNames, libxml2 2 + , version, hashes }: 3 + with stdenv; 4 + let 5 + OS = if hostPlatform.isDarwin then "osx" else hostPlatform.parsed.kernel.name; 6 + ARCH = toString hostPlatform.parsed.cpu.name; 7 + in mkDerivation { 8 + pname = "ldc-bootstrap"; 9 + inherit version; 10 + 11 + src = fetchurl rec { 12 + name = "ldc2-${version}-${OS}-${ARCH}.tar.xz"; 13 + url = "https://github.com/ldc-developers/ldc/releases/download/v${version}/${name}"; 14 + sha256 = hashes."${OS}-${ARCH}" or (throw "missing bootstrap sha256 for ${OS}-${ARCH}"); 15 + }; 16 + 17 + dontConfigure = true; 18 + dontBuild = true; 19 + 20 + nativeBuildInputs = [ fixDarwinDylibNames autoPatchelfHook ]; 21 + 22 + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libxml2 stdenv.cc.cc ]; 23 + 24 + propagatedBuildInputs = [ curl tzdata ]; 25 + 26 + installPhase = '' 27 + mkdir -p $out 28 + 29 + mv bin etc import lib LICENSE README $out/ 30 + ''; 31 + 32 + meta = with lib; { 33 + inherit version; 34 + description = "The LLVM-based D Compiler"; 35 + homepage = "https://github.com/ldc-developers/ldc"; 36 + # from https://github.com/ldc-developers/ldc/blob/master/LICENSE 37 + license = with licenses; [ bsd3 boost mit ncsa gpl2Plus ]; 38 + maintainers = with maintainers; [ ThomasMader lionello ]; 39 + platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ]; 40 + }; 41 + }
+10
pkgs/development/compilers/ldc/bootstrap.nix
··· 1 + { callPackage }: 2 + callPackage ./binary.nix { 3 + version = "1.19.0"; 4 + hashes = { 5 + # Get these from `nix-prefetch-url https://github.com/ldc-developers/ldc/releases/download/v1.19.0/ldc2-1.19.0-osx-x86_64.tar.xz` etc.. 6 + osx-x86_64 = "1bp3xkh9zp64dzq8isanib1gacb3nfbl70qv15qygwk1zan6zgy7"; 7 + linux-x86_64 = "146grr2lwarfk13wgkpyb77xb6b3as1is2rf4s2hipqjmc8biy1h"; 8 + linux-aarch64 = "1fv6jshfvi15m7masgxq1hgp216qjd5amizrqdf26vhrq3a08li3"; 9 + }; 10 + }
+3 -171
pkgs/development/compilers/ldc/default.nix
··· 1 - { stdenv, fetchurl, cmake, ninja, llvm_5, llvm_8, curl, tzdata 2 - , libconfig, lit, gdb, unzip, darwin, bash 3 - , callPackage, makeWrapper, runCommand, targetPackages 4 - , bootstrapVersion ? false 5 - , version ? "1.17.0" 6 - , ldcSha256 ? "1aag5jfrng6p4ms0fs90hjbv9bcj3hj8h52r68c3cm6racdajbva" 7 - }: 8 - 9 - let 10 - bootstrapLdc = if !bootstrapVersion then 11 - # LDC 0.17.x is the last version which doesn't need a working D compiler to 12 - # build so we use that version to bootstrap the actual build. 13 - callPackage ./default.nix { 14 - bootstrapVersion = true; 15 - version = "0.17.6"; 16 - ldcSha256 = "0qf5kbxddgmg3kqzi0kf4bgv8vdrnv16y07hcpm0cwv9mc3qr2w6"; 17 - } 18 - else 19 - ""; 20 - 21 - pathConfig = runCommand "ldc-lib-paths" {} '' 22 - mkdir $out 23 - echo ${tzdata}/share/zoneinfo/ > $out/TZDatabaseDirFile 24 - echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile 25 - ''; 26 - in 27 - 28 - stdenv.mkDerivation rec { 29 - pname = "ldc"; 30 - inherit version; 31 - 32 - enableParallelBuilding = true; 33 - 34 - src = fetchurl { 35 - url = "https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"; 36 - sha256 = ldcSha256; 37 - }; 38 - 39 - # https://issues.dlang.org/show_bug.cgi?id=19553 40 - hardeningDisable = [ "fortify" ]; 41 - 42 - postUnpack = '' 43 - patchShebangs . 44 - '' 45 - 46 - + stdenv.lib.optionalString (!bootstrapVersion) '' 47 - rm ldc-${version}-src/tests/d2/dmd-testsuite/fail_compilation/mixin_gc.d 48 - rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/xtest46_gc.d 49 - rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/testptrref_gc.d 50 - 51 - # test depends on current year 52 - rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/ddocYear.d 53 - '' 54 - 55 - + stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) '' 56 - # https://github.com/NixOS/nixpkgs/issues/34817 57 - rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall 58 - ''; 59 - 60 - postPatch = '' 61 - # Setting SHELL=$SHELL when dmd testsuite is run doesn't work on Linux somehow 62 - substituteInPlace tests/d2/dmd-testsuite/Makefile --replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash" 63 - '' 64 - 65 - + stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isLinux) '' 66 - substituteInPlace runtime/phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" "" 67 - '' 68 - 69 - + stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) '' 70 - substituteInPlace runtime/phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)" 71 - '' 72 - 73 - + stdenv.lib.optionalString (bootstrapVersion && stdenv.hostPlatform.isDarwin) '' 74 - # Was not able to compile on darwin due to "__inline_isnanl" 75 - # being undefined. 76 - # TODO Remove with version > 0.17.6 77 - substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan 78 - ''; 79 - 80 - nativeBuildInputs = [ cmake ninja makeWrapper unzip ] 81 - ++ stdenv.lib.optionals (!bootstrapVersion) [ 82 - bootstrapLdc lit lit.python 83 - ] 84 - ++ stdenv.lib.optional (!bootstrapVersion && stdenv.hostPlatform.isDarwin) 85 - # https://github.com/NixOS/nixpkgs/issues/57120 86 - # https://github.com/NixOS/nixpkgs/pull/59197#issuecomment-481972515 87 - llvm_5 88 - ++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin) 89 - llvm_8 90 - ++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin) 91 - # https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818 92 - gdb 93 - ++ stdenv.lib.optionals (bootstrapVersion) [ 94 - libconfig llvm_5 95 - ] 96 - ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin 97 - darwin.apple_sdk.frameworks.Foundation; 98 - 99 - 100 - buildInputs = [ curl tzdata ]; 101 - 102 - cmakeFlags = stdenv.lib.optionals (!bootstrapVersion) [ 103 - "-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J${pathConfig}" 104 - "-DCMAKE_BUILD_TYPE=Release" 105 - ]; 106 - 107 - postConfigure = '' 108 - export DMD=$PWD/bin/ldmd2 109 - ''; 110 - 111 - makeFlags = [ "DMD=$DMD" ]; 112 - 113 - fixNames = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' 114 - fixDarwinDylibNames() { 115 - local flags=() 116 - 117 - for fn in "$@"; do 118 - flags+=(-change "$(basename "$fn")" "$fn") 119 - done 120 - 121 - for fn in "$@"; do 122 - if [ -L "$fn" ]; then continue; fi 123 - echo "$fn: fixing dylib" 124 - install_name_tool -id "$fn" "''${flags[@]}" "$fn" 125 - done 126 - } 127 - 128 - fixDarwinDylibNames $(find "$(pwd)/lib" -name "*.dylib") 129 - export DYLD_LIBRARY_PATH=$(pwd)/lib 130 - ''; 131 - 132 - # https://github.com/ldc-developers/ldc/issues/2497#issuecomment-459633746 133 - additionalExceptions = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin 134 - "|druntime-test-shared"; 135 - 136 - doCheck = !bootstrapVersion; 137 - 138 - checkPhase = stdenv.lib.optionalString doCheck '' 139 - # Build default lib test runners 140 - ninja -j$NIX_BUILD_CORES all-test-runners 141 - 142 - ${fixNames} 143 - 144 - # Run dmd testsuite 145 - export DMD_TESTSUITE_MAKE_ARGS="-j$NIX_BUILD_CORES DMD=$DMD CC=$CXX" 146 - ctest -V -R "dmd-testsuite" 147 - 148 - # Build and run LDC D unittests. 149 - ctest --output-on-failure -R "ldc2-unittest" 150 - 151 - # Run LIT testsuite. 152 - ctest -V -R "lit-tests" 153 - 154 - # Run default lib unittests 155 - ctest -j$NIX_BUILD_CORES --output-on-failure -E "ldc2-unittest|lit-tests|dmd-testsuite${additionalExceptions}" 156 - ''; 157 - 158 - postInstall = '' 159 - wrapProgram $out/bin/ldc2 \ 160 - --prefix PATH ":" "${targetPackages.stdenv.cc}/bin" \ 161 - --set-default CC "${targetPackages.stdenv.cc}/bin/cc" 162 - ''; 163 - 164 - meta = with stdenv.lib; { 165 - description = "The LLVM-based D compiler"; 166 - homepage = "https://github.com/ldc-developers/ldc"; 167 - # from https://github.com/ldc-developers/ldc/blob/master/LICENSE 168 - license = with licenses; [ bsd3 boost mit ncsa gpl2Plus ]; 169 - maintainers = with maintainers; [ ThomasMader ]; 170 - platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]; 171 - }; 1 + import ./generic.nix { 2 + version = "1.20.1"; 3 + ldcSha256 = "1bqsgab22v02pc3c9gcyf15y7aimadv24d68icaw5lpgnvzxy89b"; 172 4 } 173 5
+143
pkgs/development/compilers/ldc/generic.nix
··· 1 + { version, ldcSha256 }: 2 + { stdenv, fetchurl, cmake, ninja, llvm_5, llvm_8, curl, tzdata 3 + , libconfig, lit, gdb, unzip, darwin, bash 4 + , callPackage, makeWrapper, runCommand, targetPackages 5 + , ldcBootstrap ? callPackage ./bootstrap.nix { } 6 + }: 7 + 8 + let 9 + pathConfig = runCommand "ldc-lib-paths" {} '' 10 + mkdir $out 11 + echo ${tzdata}/share/zoneinfo/ > $out/TZDatabaseDirFile 12 + echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile 13 + ''; 14 + 15 + in 16 + 17 + stdenv.mkDerivation rec { 18 + pname = "ldc"; 19 + inherit version; 20 + 21 + enableParallelBuilding = true; 22 + 23 + src = fetchurl { 24 + url = "https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"; 25 + sha256 = ldcSha256; 26 + }; 27 + 28 + # https://issues.dlang.org/show_bug.cgi?id=19553 29 + hardeningDisable = [ "fortify" ]; 30 + 31 + postUnpack = '' 32 + patchShebangs . 33 + '' 34 + + '' 35 + rm ldc-${version}-src/tests/d2/dmd-testsuite/fail_compilation/mixin_gc.d 36 + rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/xtest46_gc.d 37 + rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/testptrref_gc.d 38 + 39 + # test depends on current year 40 + rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/ddocYear.d 41 + '' 42 + + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' 43 + # https://github.com/NixOS/nixpkgs/issues/34817 44 + rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall 45 + ''; 46 + 47 + postPatch = '' 48 + # Setting SHELL=$SHELL when dmd testsuite is run doesn't work on Linux somehow 49 + substituteInPlace tests/d2/dmd-testsuite/Makefile --replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash" 50 + '' 51 + + stdenv.lib.optionalString stdenv.hostPlatform.isLinux '' 52 + substituteInPlace runtime/phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" "" 53 + '' 54 + + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' 55 + substituteInPlace runtime/phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)" 56 + ''; 57 + 58 + nativeBuildInputs = [ 59 + cmake ninja makeWrapper unzip ldcBootstrap lit lit.python 60 + ] 61 + ++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ 62 + darwin.apple_sdk.frameworks.Foundation 63 + # https://github.com/NixOS/nixpkgs/issues/57120 64 + # https://github.com/NixOS/nixpkgs/pull/59197#issuecomment-481972515 65 + llvm_5 66 + ] 67 + ++ stdenv.lib.optionals (!stdenv.hostPlatform.isDarwin) [ 68 + llvm_8 69 + # https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818 70 + gdb 71 + ]; 72 + 73 + buildInputs = [ curl tzdata ]; 74 + 75 + cmakeFlags = [ 76 + "-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J${pathConfig}" 77 + "-DCMAKE_BUILD_TYPE=Release" 78 + ]; 79 + 80 + postConfigure = '' 81 + export DMD=$PWD/bin/ldmd2 82 + ''; 83 + 84 + makeFlags = [ "DMD=$DMD" ]; 85 + 86 + fixNames = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin '' 87 + fixDarwinDylibNames() { 88 + local flags=() 89 + 90 + for fn in "$@"; do 91 + flags+=(-change "$(basename "$fn")" "$fn") 92 + done 93 + 94 + for fn in "$@"; do 95 + if [ -L "$fn" ]; then continue; fi 96 + echo "$fn: fixing dylib" 97 + install_name_tool -id "$fn" "''${flags[@]}" "$fn" 98 + done 99 + } 100 + 101 + fixDarwinDylibNames $(find "$(pwd)/lib" -name "*.dylib") 102 + export DYLD_LIBRARY_PATH=$(pwd)/lib 103 + ''; 104 + 105 + # https://github.com/ldc-developers/ldc/issues/2497#issuecomment-459633746 106 + additionalExceptions = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin 107 + "|druntime-test-shared"; 108 + 109 + checkPhase = '' 110 + # Build default lib test runners 111 + ninja -j$NIX_BUILD_CORES all-test-runners 112 + 113 + ${fixNames} 114 + 115 + # Run dmd testsuite 116 + export DMD_TESTSUITE_MAKE_ARGS="-j$NIX_BUILD_CORES DMD=$DMD" 117 + ctest -V -R "dmd-testsuite" 118 + 119 + # Build and run LDC D unittests. 120 + ctest --output-on-failure -R "ldc2-unittest" 121 + 122 + # Run LIT testsuite. 123 + ctest -V -R "lit-tests" 124 + 125 + # Run default lib unittests 126 + ctest -j$NIX_BUILD_CORES --output-on-failure -E "ldc2-unittest|lit-tests|dmd-testsuite${additionalExceptions}" 127 + ''; 128 + 129 + postInstall = '' 130 + wrapProgram $out/bin/ldc2 \ 131 + --prefix PATH ":" "${targetPackages.stdenv.cc}/bin" \ 132 + --set-default CC "${targetPackages.stdenv.cc}/bin/cc" 133 + ''; 134 + 135 + meta = with stdenv.lib; { 136 + description = "The LLVM-based D compiler"; 137 + homepage = "https://github.com/ldc-developers/ldc"; 138 + # from https://github.com/ldc-developers/ldc/blob/master/LICENSE 139 + license = with licenses; [ bsd3 boost mit ncsa gpl2Plus ]; 140 + maintainers = with maintainers; [ ThomasMader lionello ]; 141 + platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ]; 142 + }; 143 + }