diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-01-22 15:26:58 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-01-22 16:56:33 +0000 |
commit | 542f80867c380b0ac79250b6e5358dda8bc49e0d (patch) | |
tree | aa5903f228b2f32c524a9a6e4f6dd94f8c5b869e /nixpkgs/pkgs/development/compilers | |
parent | f69898c7d5b757342e6ab90d5fcc7c9aea9f5ff4 (diff) | |
parent | 90441b4b47fc7280de6a5bd1a228017caaa0f97f (diff) | |
download | nixlib-542f80867c380b0ac79250b6e5358dda8bc49e0d.tar nixlib-542f80867c380b0ac79250b6e5358dda8bc49e0d.tar.gz nixlib-542f80867c380b0ac79250b6e5358dda8bc49e0d.tar.bz2 nixlib-542f80867c380b0ac79250b6e5358dda8bc49e0d.tar.lz nixlib-542f80867c380b0ac79250b6e5358dda8bc49e0d.tar.xz nixlib-542f80867c380b0ac79250b6e5358dda8bc49e0d.tar.zst nixlib-542f80867c380b0ac79250b6e5358dda8bc49e0d.zip |
Merge commit '90441b4b47fc7280de6a5bd1a228017caaa0f97f'
Diffstat (limited to 'nixpkgs/pkgs/development/compilers')
28 files changed, 434 insertions, 292 deletions
diff --git a/nixpkgs/pkgs/development/compilers/bs-platform/bs-platform-62.nix b/nixpkgs/pkgs/development/compilers/bs-platform/bs-platform-62.nix deleted file mode 100644 index d2913caaee64..000000000000 --- a/nixpkgs/pkgs/development/compilers/bs-platform/bs-platform-62.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ stdenv, fetchFromGitHub, ninja, nodejs, python3 }: -let - version = "6.2.1"; - ocaml-version = "4.06.1"; - src = fetchFromGitHub { - owner = "BuckleScript"; - repo = "bucklescript"; - rev = "${version}"; - sha256 = "0zx9nq7cik0c60n3rndqfqy3vdbj5lcrx6zcqcz2d60jjxi1z32y"; - fetchSubmodules = true; - }; - ocaml = import ./ocaml.nix { - bs-version = version; - version = ocaml-version; - inherit stdenv; - src = "${src}/ocaml"; - }; -in -stdenv.mkDerivation { - inherit src version; - pname = "bs-platform"; - BS_RELEASE_BUILD = "true"; - buildInputs = [ nodejs python3 ]; - - patchPhase = '' - sed -i 's:./configure.py --bootstrap:python3 ./configure.py --bootstrap:' ./scripts/install.js - - mkdir -p ./native/${ocaml-version}/bin - ln -sf ${ocaml}/bin/* ./native/${ocaml-version}/bin - - rm -f vendor/ninja/snapshot/ninja.linux - cp ${ninja}/bin/ninja vendor/ninja/snapshot/ninja.linux - ''; - - configurePhase = '' - node scripts/ninja.js config - ''; - - buildPhase = '' - node scripts/ninja.js build - ''; - - installPhase = '' - node scripts/install.js - - mkdir -p $out/bin - - cp -rf jscomp lib vendor odoc_gen native $out - cp bsconfig.json package.json $out - - ln -s $out/lib/bsb $out/bin/bsb - ln -s $out/lib/bsc $out/bin/bsc - ln -s $out/lib/bsrefmt $out/bin/bsrefmt - ''; -} diff --git a/nixpkgs/pkgs/development/compilers/bs-platform/build-bs-platform.nix b/nixpkgs/pkgs/development/compilers/bs-platform/build-bs-platform.nix new file mode 100644 index 000000000000..830a0b647c42 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/bs-platform/build-bs-platform.nix @@ -0,0 +1,51 @@ +# This file is based on https://github.com/turboMaCk/bs-platform.nix/blob/master/build-bs-platform.nix +# to make potential future updates simpler + +{ stdenv, fetchFromGitHub, ninja, runCommand, nodejs, python3, + ocaml-version, version, src, + ocaml ? (import ./ocaml.nix { + version = ocaml-version; + inherit stdenv; + src = "${src}/ocaml"; + }), + custom-ninja ? (ninja.overrideAttrs (attrs: { + src = runCommand "ninja-patched-source" {} '' + mkdir -p $out + tar zxvf ${src}/vendor/ninja.tar.gz -C $out + ''; + patches = []; + })) +}: +stdenv.mkDerivation { + inherit src version; + pname = "bs-platform"; + BS_RELEASE_BUILD = "true"; + buildInputs = [ nodejs python3 custom-ninja ]; + + patchPhase = '' + sed -i 's:./configure.py --bootstrap:python3 ./configure.py --bootstrap:' ./scripts/install.js + mkdir -p ./native/${ocaml-version}/bin + ln -sf ${ocaml}/bin/* ./native/${ocaml-version}/bin + rm -f vendor/ninja/snapshot/ninja.linux + cp ${custom-ninja}/bin/ninja vendor/ninja/snapshot/ninja.linux + ''; + + configurePhase = '' + node scripts/ninja.js config + ''; + + buildPhase = '' + # This is an unfortunate name, but it's actually how to build a release + # binary for BuckleScript + node scripts/install.js + ''; + + installPhase = '' + mkdir -p $out/bin + cp -rf jscomp lib vendor odoc_gen native $out + cp bsconfig.json package.json $out + ln -s $out/lib/bsb $out/bin/bsb + ln -s $out/lib/bsc $out/bin/bsc + ln -s $out/lib/bsrefmt $out/bin/bsrefmt + ''; +} diff --git a/nixpkgs/pkgs/development/compilers/bs-platform/default.nix b/nixpkgs/pkgs/development/compilers/bs-platform/default.nix index 5eb11671ca90..7abf7b306a55 100644 --- a/nixpkgs/pkgs/development/compilers/bs-platform/default.nix +++ b/nixpkgs/pkgs/development/compilers/bs-platform/default.nix @@ -1,15 +1,28 @@ -{ stdenv, fetchFromGitHub, ninja, nodejs, python3, ... }: +{ stdenv, runCommand, fetchFromGitHub, ninja, nodejs, python3, ... }: let + build-bs-platform = import ./build-bs-platform.nix; +in +(build-bs-platform { + inherit stdenv runCommand fetchFromGitHub ninja nodejs python3; + version = "7.0.1"; + ocaml-version = "4.06.1"; + + src = fetchFromGitHub { + owner = "BuckleScript"; + repo = "bucklescript"; + rev = "52770839e293ade2bcf187f2639000ca0a9a1d46"; + sha256 = "0s7g2zfhshsilv9zyp0246bypg34d294z27alpwz03ws9608yr7k"; + fetchSubmodules = true; + }; +}).overrideAttrs (attrs: { meta = with stdenv.lib; { description = "A JavaScript backend for OCaml focused on smooth integration and clean generated code."; homepage = https://bucklescript.github.io; license = licenses.lgpl3; - maintainers = with maintainers; [ turbomack gamb ]; + maintainers = with maintainers; [ turbomack gamb anmonteiro ]; platforms = platforms.all; + # Currently there is an issue with aarch build in hydra + # https://github.com/BuckleScript/bucklescript/issues/4091 + badPlatforms = platforms.aarch64; }; -in -{ - bs-platform-621 = import ./bs-platform-62.nix { - inherit stdenv fetchFromGitHub ninja nodejs python3; - } // { inherit meta; }; -} +}) diff --git a/nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix b/nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix index 1f2fdd571f3d..9aa34d02b362 100644 --- a/nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix +++ b/nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix @@ -1,7 +1,7 @@ -{ stdenv, src, version, bs-version }: +{ stdenv, src, version }: stdenv.mkDerivation rec { inherit src version; - name = "ocaml-${version}+bs-${bs-version}"; + name = "ocaml-${version}+bs"; configurePhase = '' ./configure -prefix $out ''; diff --git a/nixpkgs/pkgs/development/compilers/computecpp/default.nix b/nixpkgs/pkgs/development/compilers/computecpp/default.nix new file mode 100644 index 000000000000..65cfcaa7ff63 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/computecpp/default.nix @@ -0,0 +1,52 @@ +{ stdenv +, fetchzip +, pkg-config +, autoPatchelfHook +, installShellFiles +, ncurses5 +, ocl-icd +, zlib +}: + +stdenv.mkDerivation rec { + pname = "computecpp"; + version = "1.2.0"; + + src = fetchzip { + url = "https://computecpp.codeplay.com/downloads/computecpp-ce/${version}/ubuntu-16.04-64bit.tar.gz"; + sha256 = "191kwvzxfg1sbaq6aw6f84chi7bhsibb2a63zsyz3gz8m0c0syr5"; + stripRoot = true; + }; + + dontStrip = true; + + buildInputs = [ stdenv.cc.cc.lib ncurses5 ocl-icd zlib ]; + nativeBuildInputs = [ autoPatchelfHook pkg-config installShellFiles ]; + + installPhase = '' + runHook preInstall + + find ./lib -type f -exec install -D -m 0755 {} -t $out/lib \; + find ./bin -type l -exec install -D -m 0755 {} -t $out/bin \; + find ./bin -type f -exec install -D -m 0755 {} -t $out/bin \; + find ./doc -type f -exec install -D -m 0644 {} -t $out/doc \; + find ./include -type f -exec install -D -m 0644 {} -t $out/include \; + + runHook postInstall + ''; + + passthru = { + isClang = true; + } // stdenv.lib.optionalAttrs (stdenv.targetPlatform.isLinux || (stdenv.cc.isGNU && stdenv.cc.cc ? gcc)) { + gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; + }; + + meta = with stdenv.lib; { + description = + "Accelerate Complex C++ Applications on Heterogeneous Compute Systems using Open Standards"; + homepage = https://www.codeplay.com/products/computesuite/computecpp; + license = licenses.unfree; + maintainers = with maintainers; [ davidtwco ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/nixpkgs/pkgs/development/compilers/dotnet/buildDotnet.nix b/nixpkgs/pkgs/development/compilers/dotnet/buildDotnet.nix new file mode 100644 index 000000000000..58e67ff008ae --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/dotnet/buildDotnet.nix @@ -0,0 +1,67 @@ +{ type +, version +, sha512 +}: +assert builtins.elem type [ "aspnetcore" "netcore" "sdk"]; +{ stdenv +, fetchurl +, libunwind +, openssl +, icu +, libuuid +, zlib +, curl +}: +let pname = if type == "aspnetcore" then "aspnetcore-runtime" else if type == "netcore" then "dotnet-runtime" else "dotnet-sdk"; + urls = { + aspnetcore = "https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/${version}/${pname}-${version}-linux-x64.tar.gz"; + netcore = "https://dotnetcli.azureedge.net/dotnet/Runtime/${version}/${pname}-${version}-linux-x64.tar.gz"; + sdk = "https://dotnetcli.azureedge.net/dotnet/Sdk/${version}/${pname}-${version}-linux-x64.tar.gz"; + }; + descriptions = { + aspnetcore = "ASP .NET Core runtime ${version}"; + netcore = ".NET Core runtime ${version}"; + sdk = ".NET SDK ${version}"; + }; +in stdenv.mkDerivation rec { + inherit pname version; + + rpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc libunwind libuuid icu openssl zlib curl ]; + + src = fetchurl { + url = builtins.getAttr type urls; + inherit sha512; + }; + + sourceRoot = "."; + + dontPatchELF = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + cp -r ./ $out + ln -s $out/dotnet $out/bin/dotnet + runHook postInstall + ''; + + postFixup = '' + patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $out/dotnet + patchelf --set-rpath "${rpath}" $out/dotnet + find $out -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \; + find $out -type f -name "apphost" -exec patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" --set-rpath '$ORIGIN:${rpath}' {} \; + ''; + + doInstallCheck = true; + installCheckPhase = '' + $out/bin/dotnet --info + ''; + + meta = with stdenv.lib; { + homepage = https://dotnet.github.io/; + description = builtins.getAttr type descriptions; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ kuznero ]; + license = licenses.mit; + }; +} diff --git a/nixpkgs/pkgs/development/compilers/dotnet/combinePackages.nix b/nixpkgs/pkgs/development/compilers/dotnet/combinePackages.nix new file mode 100644 index 000000000000..00fb7c6d9b41 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/dotnet/combinePackages.nix @@ -0,0 +1,20 @@ +packages: +{ buildEnv, lib }: +let cli = builtins.head packages; +in +assert lib.assertMsg ((builtins.length packages) != 0) + ''You must include at least one package, e.g + `with dotnetCorePackages; combinePackages { + packages = [ sdk_3_0 aspnetcore_2_1 ]; + };`'' ; + buildEnv { + name = "dotnet-core-combined"; + paths = packages; + pathsToLink = [ "/host" "/packs" "/sdk" "/shared" "/templates" ]; + ignoreCollisions = true; + postBuild = '' + cp ${cli}/dotnet $out/dotnet + mkdir $out/bin + ln -s $out/dotnet $out/bin/ + ''; + } diff --git a/nixpkgs/pkgs/development/compilers/dotnet/default.nix b/nixpkgs/pkgs/development/compilers/dotnet/default.nix new file mode 100644 index 000000000000..58d49a505156 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/dotnet/default.nix @@ -0,0 +1,68 @@ +/* +How to combine packages for use in development: +dotnetCombined = with dotnetCorePackages; combinePackages [ sdk_3_1 sdk_2_2 sdk_3_0 sdk aspnetcore_2_1 ]; +*/ +{ callPackage }: +let + buildDotnet = attrs: callPackage (import ./buildDotnet.nix attrs) {}; + buildAspNetCore = attrs: buildDotnet (attrs // { type = "aspnetcore"; } ); + buildNetCore = attrs: buildDotnet (attrs // { type = "netcore"; } ); + buildNetCoreSdk = attrs: buildDotnet (attrs // { type = "sdk"; } ); +in rec { + combinePackages = attrs: callPackage (import ./combinePackages.nix attrs) {}; + + # v2.1.15 (LTS) + + aspnetcore_2_1 = buildAspNetCore { + version = "2.1.15"; + sha512 = "a557f175cca92bb1dd66cf638ff84fe85750fab67028bd4472748b22ef0591f5f3812446a3dbe21c3d1be28c47d459d854d690dbace1b95bc7136b248af87334"; + }; + + netcore_2_1 = buildNetCore { + version = "2.1.15"; + sha512 = "cfd7f7caea7e896dd4d68a05c827c86f38595f24e854edb3f934715ee1268e2623f17ff768215e465fe596cd474497384be2b1381f04ddd6d555665a341f65f6"; + }; + + sdk_2_1 = buildNetCoreSdk { + version = "2.1.803"; + sha512 = "57d48d6ca1bd92ac348dc05220d984811c0cf005774d7afdfbbf125a842acb0a26572146ed25a7eb26f4e0404fe840b70d1e7ec1fb7c9a5c6cfe81fefc41b363"; + }; + + # v2.2 + + sdk_2_2 = throw "Dotnet SDK 2.2 is EOL, please use 3.1"; + + # v3.0.2 (Maintenance) + + aspnetcore_3_0 = buildAspNetCore { + version = "3.0.2"; + sha512 = "84dcc2a2a9e43afbc166771153d85b19cb09f964c85c787d77b362fd1d9e076345ae153305fa9040999846a56b69041eb89282804587478b926179d2613d259d"; + }; + + netcore_3_0 = buildNetCore { + version = "3.0.2"; + sha512 = "c8f0e4eb220fa896c4a803a8d9d0c704ae7b8383801a977036f3089b1d779159f5a2d9293dc11ff5f4f6c76febc6f70f6cfcdff0debd3243cad5eb635f853d45"; + }; + + sdk_3_0 = buildNetCoreSdk { + version = "3.0.102"; + sha512 = "77bc287d9c20630976ac4c0736192ba4899154c9e7cc5b87bc9d94d5d8abafdd832cfe8f385b6ba584c702d9261566109df15ab46b0d62bd218d950d3b47893e"; + }; + + # v3.1.1 (LTS) + + aspnetcore_3_1 = buildAspNetCore { + version = "3.1.1"; + sha512 = "cc27828cacbc783ef83cc1378078e14ac558aec30726b36c4f154fad0d08ff011e7e1dfc17bc851926ea3b0da9c7d71496af14ee13184bdf503856eca30a89ae"; + }; + + netcore_3_1 = buildNetCore { + version = "3.1.1"; + sha512 = "991a89ac7b52d3bf6c00359ce94c5a3f7488cd3d9e4663ba0575e1a5d8214c5fcc459e2cb923c369c2cdb789a96f0b1dfb5c5aae1a04df6e7f1f365122072611"; + }; + + sdk_3_1 = buildNetCoreSdk { + version = "3.1.101"; + sha512 = "eeee75323be762c329176d5856ec2ecfd16f06607965614df006730ed648a5b5d12ac7fd1942fe37cfc97e3013e796ef278e7c7bc4f32b8680585c4884a8a6a1"; + }; +} diff --git a/nixpkgs/pkgs/development/compilers/dotnet/sdk/default.nix b/nixpkgs/pkgs/development/compilers/dotnet/sdk/default.nix deleted file mode 100644 index 984ab39c91ad..000000000000 --- a/nixpkgs/pkgs/development/compilers/dotnet/sdk/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ stdenv -, fetchurl -, libunwind -, openssl -, icu -, libuuid -, zlib -, curl -}: - -let - rpath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc libunwind libuuid icu openssl zlib curl ]; -in - stdenv.mkDerivation rec { - version = "2.2.401"; - netCoreVersion = "2.2.6"; - pname = "dotnet-sdk"; - - src = fetchurl { - url = "https://dotnetcli.azureedge.net/dotnet/Sdk/${version}/${pname}-${version}-linux-x64.tar.gz"; - # use sha512 from the download page - sha512 = "05w3zk7bcd8sv3k4kplf20j906and2006g1fggq7y6kaxrlhdnpd6jhy6idm8v5bz48wfxga5b4yys9qx0fp3p8yl7wi67qljpzrq88"; - }; - - sourceRoot = "."; - - buildPhase = '' - runHook preBuild - patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" ./dotnet - patchelf --set-rpath "${rpath}" ./dotnet - find -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \; - echo -n "dotnet-sdk version: " - ./dotnet --version - runHook postBuild - ''; - - dontPatchELF = true; - - installPhase = '' - runHook preInstall - mkdir -p $out/bin - cp -r ./ $out - ln -s $out/dotnet $out/bin/dotnet - runHook postInstall - ''; - - meta = with stdenv.lib; { - homepage = https://dotnet.github.io/; - description = ".NET Core SDK ${version} with .NET Core ${netCoreVersion}"; - platforms = [ "x86_64-linux" ]; - maintainers = with maintainers; [ kuznero ]; - license = licenses.mit; - }; - } diff --git a/nixpkgs/pkgs/development/compilers/dtc/default.nix b/nixpkgs/pkgs/development/compilers/dtc/default.nix index eea75c5ace1f..78e5eccbf145 100644 --- a/nixpkgs/pkgs/development/compilers/dtc/default.nix +++ b/nixpkgs/pkgs/development/compilers/dtc/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchgit, flex, bison, pkgconfig, which -, pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform, python, swig +, pythonSupport ? false, python, swig }: stdenv.mkDerivation rec { diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix index 25226d4d0e6b..b68e48025512 100644 --- a/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix +++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix @@ -86,12 +86,12 @@ let in stdenv.mkDerivation (rec { - version = "8.10.0.20191210"; + version = "8.10.0.20200108"; name = "${targetPrefix}ghc-${version}"; src = fetchurl { - url = "https://downloads.haskell.org/ghc/8.10.1-alpha2/ghc-${version}-src.tar.xz"; - sha256 = "1mmv8s9cs41kp7wh1qqnzin5wv32cvs3lmzgda7njz0ssqb0mmvj"; + url = "https://downloads.haskell.org/ghc/8.10.1-rc1/ghc-${version}-src.tar.xz"; + sha256 = "1xm6cb3s2x3rycnyvkh12mp65xi3zbwrk5ima8sg7c245f3dl0ay"; }; enableParallelBuilding = true; diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.4.4.nix b/nixpkgs/pkgs/development/compilers/ghc/8.4.4.nix index f79200d1199b..075947a02a4b 100644 --- a/nixpkgs/pkgs/development/compilers/ghc/8.4.4.nix +++ b/nixpkgs/pkgs/development/compilers/ghc/8.4.4.nix @@ -7,7 +7,7 @@ , libiconv ? null, ncurses -, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) +, useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform) || stdenv.targetPlatform.isiOS , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a # build-time dependency too. diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix b/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix index 0b565d3705da..b31b3db7eb2e 100644 --- a/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix +++ b/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix @@ -10,7 +10,7 @@ , # GHC can be built with system libffi or a bundled one. libffi ? null -, useLLVM ? !stdenv.targetPlatform.isx86 +, useLLVM ? !stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isiOS , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a # build-time dependency too. diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.1.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.1.nix index 9197b80224e7..2b859de97997 100644 --- a/nixpkgs/pkgs/development/compilers/ghc/8.8.1.nix +++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.1.nix @@ -10,7 +10,7 @@ , # GHC can be built with system libffi or a bundled one. libffi ? null -, useLLVM ? !stdenv.targetPlatform.isx86 +, useLLVM ? !stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isiOS , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a # build-time dependency too. diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix index 4ed99a8402aa..b0eef9ef924d 100644 --- a/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix +++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix @@ -86,12 +86,12 @@ let in stdenv.mkDerivation (rec { - version = "8.8.1.20191211"; + version = "8.8.2"; name = "${targetPrefix}ghc-${version}"; src = fetchurl { - url = "https://downloads.haskell.org/ghc/8.8.2-rc1/ghc-${version}-src.tar.xz"; - sha256 = "1gl4fzakjbhd94v1saxmr9sfzgk22m1b95jq51rxm93b2g4cixl4"; + url = "https://downloads.haskell.org/ghc/8.8.2/ghc-${version}-src.tar.xz"; + sha256 = "02qa6wgjpxgakg7hv4zfdlrx9k7zxa5i02wnr6y9fsv8j16sbkh1"; }; enableParallelBuilding = true; diff --git a/nixpkgs/pkgs/development/compilers/ghc/head.nix b/nixpkgs/pkgs/development/compilers/ghc/head.nix index 415f6c74ad58..d6ba6dd0fad3 100644 --- a/nixpkgs/pkgs/development/compilers/ghc/head.nix +++ b/nixpkgs/pkgs/development/compilers/ghc/head.nix @@ -10,7 +10,7 @@ , enableDwarf ? !stdenv.targetPlatform.isDarwin && !stdenv.targetPlatform.isWindows, elfutils # for DWARF support -, useLLVM ? !stdenv.targetPlatform.isx86 +, useLLVM ? !stdenv.targetPlatform.isx86 || stdenv.targetPlatform.isiOS , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a # build-time dependency too. diff --git a/nixpkgs/pkgs/development/compilers/ocaml/4.10.nix b/nixpkgs/pkgs/development/compilers/ocaml/4.10.nix new file mode 100644 index 000000000000..6f78ae05e02e --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/ocaml/4.10.nix @@ -0,0 +1,6 @@ +import ./generic.nix { + major_version = "4"; + minor_version = "10"; + patch_version = "0+beta1"; + sha256 = "18jrgww98v1famb2x5jhbsnm4ngph2rvq0z4cxpqxfn06yb53jyf"; +} diff --git a/nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix b/nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix index f1126fdeddfd..d1797a448ad1 100644 --- a/nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix +++ b/nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix @@ -18,19 +18,19 @@ let in stdenv.mkDerivation rec { pname = "purescript"; - version = "0.13.5"; + version = "0.13.6"; src = if stdenv.isDarwin then fetchurl { url = "https://github.com/${pname}/${pname}/releases/download/v${version}/macos.tar.gz"; - sha256 = "19bb50m0cd738r353blgy21d842b3yj58xfbplk7bz59jawj9lym"; + sha256 = "04kwjjrriyizpvhs96jgyx21ppyd1ynblk24i5825ywxlw9hja25"; } else fetchurl { url = "https://github.com/${pname}/${pname}/releases/download/v${version}/linux64.tar.gz"; - sha256 = "016wvwypgb4859f0n1lqsqv9a8cca2y8g7d6ffvzx6rncd115gxi"; + sha256 = "012znrj32aq96qh1g2hscdvhl3flgihhimiz40agk0dykpksblns"; }; @@ -59,7 +59,7 @@ in stdenv.mkDerivation rec { description = "A strongly-typed functional programming language that compiles to JavaScript"; homepage = http://www.purescript.org/; license = licenses.bsd3; - maintainers = [ maintainers.justinwoo ]; + maintainers = [ maintainers.justinwoo maintainers.mbbx6spp ]; platforms = [ "x86_64-linux" "x86_64-darwin" ]; }; } diff --git a/nixpkgs/pkgs/development/compilers/swift/default.nix b/nixpkgs/pkgs/development/compilers/swift/default.nix index 817f81f9257b..77bc3cc5b73e 100644 --- a/nixpkgs/pkgs/development/compilers/swift/default.nix +++ b/nixpkgs/pkgs/development/compilers/swift/default.nix @@ -33,33 +33,40 @@ }: let - v_base = "5.0.2"; - version = "${v_base}-RELEASE"; - version_friendly = v_base; + version = "5.1.1"; - tag = "refs/tags/swift-${version}"; fetch = { repo, sha256, fetchSubmodules ? false }: fetchFromGitHub { owner = "apple"; inherit repo sha256 fetchSubmodules; - rev = tag; + rev = "swift-${version}-RELEASE"; name = "${repo}-${version}-src"; }; sources = { - # FYI: SourceKit probably would work but currently requires building everything twice - # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759 - clang = fetch { - repo = "swift-clang"; - sha256 = "046p7f4044ls8hhgklsz32md5jvxkaaim1d75n0fmnwap6di3n1q"; - }; llvm = fetch { repo = "swift-llvm"; - sha256 = "1bnscqsiljiclij60f44h2fyx5c84pzry0lz1jbwknphwmqd6f84"; + sha256 = "00ldd9dby6fl6nk3z17148fvb7g9x4jkn1afx26y51v8rwgm1i7f"; }; compilerrt = fetch { repo = "swift-compiler-rt"; - sha256 = "0bba54xa7z0wj6k7a24q74gc4yajc6s64g1m894i3yd6swdk7f6r"; + sha256 = "1431f74l0n2dxn728qp65nc6hivx88fax1wzfrnrv19y77br05wj"; + }; + clang = fetch { + repo = "swift-clang"; + sha256 = "0n7k6nvzgqp6h6bfqcmna484w90db3zv4sh5rdh89wxyhdz6rk4v"; + }; + clangtools = fetch { + repo = "swift-clang-tools-extra"; + sha256 = "0snp2rpd60z239pr7fxpkj332rkdjhg63adqvqdkjsbrxcqqcgqa"; + }; + indexstore = fetch { + repo = "indexstore-db"; + sha256 = "1gwkqkdmpd5hn7555dpdkys0z50yh00hjry2886h6rx7avh5p05n"; + }; + sourcekit = fetch { + repo = "sourcekit-lsp"; + sha256 = "0k84ssr1k7grbvpk81rr21ii8csnixn9dp0cga98h6i1gshn8ml4"; }; cmark = fetch { repo = "swift-cmark"; @@ -67,32 +74,32 @@ let }; lldb = fetch { repo = "swift-lldb"; - sha256 = "01yrhc1ggv89qii03fdjdvb2aq9v4hd1wk83n8ygrwwc75p44qmi"; + sha256 = "0j787475f0nlmvxqblkhn3yrvn9qhcb2jcijwijxwq95ar2jdygs"; }; llbuild = fetch { repo = "swift-llbuild"; - sha256 = "0ipwryzpqxpk3rzkxilfahlkz06k39j91q2lv7fprf0slqknrdms"; + sha256 = "1n2s5isxyl6b6ya617gdzjbw68shbvd52vsfqc1256rk4g448v8b"; }; pm = fetch { repo = "swift-package-manager"; - sha256 = "1mnywlm7i2mbp16q0rskskvnbx1ap8lchwr8q3gx0xs3b2fs6chh"; + sha256 = "1a49jmag5mpld9zr96g8a773334mrz1c4nyw38gf4p6sckf4jp29"; }; xctest = fetch { repo = "swift-corelibs-xctest"; - sha256 = "1vpljkxhfk3yd07ry0xsv3qwbn62pwd2mdn9cw22jhbhvqinc13z"; + sha256 = "0rxy9sq7i0s0kxfkz0hvdp8zyb40h31f7g4m0kry36qk82gzzh89"; }; foundation = fetch { repo = "swift-corelibs-foundation"; - sha256 = "1wys4xh7f6c7yjf210x41n2krmyi2qj1wpxbv0p48d230va1azj1"; + sha256 = "1iiiijsnys0r3hjcj1jlkn3yszzi7hwb2041cnm5z306nl9sybzp"; }; libdispatch = fetch { repo = "swift-corelibs-libdispatch"; - sha256 = "0chnb0d4xjyn9wnc8bgimd5ji5igfyq891flgnqpfwr4y26496c1"; + sha256 = "0laqsizsikyjhrzn0rghvxd8afg4yav7cbghvnf7ywk9wc6kpkmn"; fetchSubmodules = true; }; swift = fetch { repo = "swift"; - sha256 = "0fsq1y8dz4ssn90akvzj36cqyblalb09bjzy4ikqn67mb5x99wpb"; + sha256 = "0m4r1gzrnn0s1c7haqq9dlmvpqxbgbkbdfmq6qaph869wcmvdkvy"; }; }; @@ -116,23 +123,9 @@ let "-DGCC_INSTALL_PREFIX=${clang.cc.gcc}" ]; - builder = '' - # gcc-6.4.0/include/c++/6.4.0/cstdlib:75:15: fatal error: 'stdlib.h' file not found - NIX_CFLAGS_COMPILE="$( echo ${clang.default_cxx_stdlib_compile} ) $NIX_CFLAGS_COMPILE" - # During the Swift build, a full local LLVM build is performed and the resulting clang is invoked. - # This compiler is not using the Nix wrappers, so it needs some help to find things. - export NIX_LDFLAGS_BEFORE="-rpath ${clang.cc.gcc.lib}/lib -L${clang.cc.gcc.lib}/lib $NIX_LDFLAGS_BEFORE" - - $SWIFT_SOURCE_ROOT/swift/utils/build-script \ - --preset=buildbot_linux \ - installable_package=$INSTALLABLE_PACKAGE \ - install_prefix=$out \ - install_destdir=$SWIFT_INSTALL_DIR \ - extra_cmake_options="${stdenv.lib.concatStringsSep "," cmakeFlags}"''; - in stdenv.mkDerivation { - name = "swift-${version_friendly}"; + name = "swift-${version}"; nativeBuildInputs = [ autoconf @@ -164,32 +157,17 @@ stdenv.mkDerivation { hardeningDisable = [ "format" ]; # for LLDB - configurePhase = '' - cd .. - - export INSTALLABLE_PACKAGE=$PWD/swift.tar.gz - - mkdir build install - export SWIFT_BUILD_ROOT=$PWD/build - export SWIFT_INSTALL_DIR=$PWD/install - - cd $SWIFT_BUILD_ROOT - - unset CC - unset CXX - - export NIX_ENFORCE_PURITY= - ''; - unpackPhase = '' mkdir src cd src - export sourceRoot=$PWD export SWIFT_SOURCE_ROOT=$PWD - cp -r ${sources.clang} clang cp -r ${sources.llvm} llvm cp -r ${sources.compilerrt} compiler-rt + cp -r ${sources.clang} clang + cp -r ${sources.clangtools} clang-tools-extra + cp -r ${sources.indexstore} indexstore-db + cp -r ${sources.sourcekit} sourcekit-lsp cp -r ${sources.cmark} cmark cp -r ${sources.lldb} lldb cp -r ${sources.llbuild} llbuild @@ -234,33 +212,75 @@ stdenv.mkDerivation { \ -e 's/^swift-install-components=autolink.*$/\0;editor-integration/' - # https://bugs.swift.org/browse/SR-10559 - patch -p1 -d swift-corelibs-libdispatch -i ${./patches/libdispatch-fortify-fix.patch} - + substituteInPlace clang/lib/Driver/ToolChains/Linux.cpp \ + --replace 'SysRoot + "/lib' '"${glibc}/lib" "' substituteInPlace clang/lib/Driver/ToolChains/Linux.cpp \ --replace 'SysRoot + "/usr/lib' '"${glibc}/lib" "' - patch -p1 -d clang -i ${./patches/llvm-include-dirs.patch} + patch -p1 -d clang -i ${./patches/llvm-toolchain-dir.patch} patch -p1 -d clang -i ${./purity.patch} # Workaround hardcoded dep on "libcurses" (vs "libncurses"): - sed -i 's,curses,ncurses,' llbuild/*/*/CMakeLists.txt + sed -i 's/curses/ncurses/' llbuild/*/*/CMakeLists.txt + # uuid.h is not part of glibc, but of libuuid + sed -i 's|''${GLIBC_INCLUDE_PATH}/uuid/uuid.h|${libuuid.dev}/include/uuid/uuid.h|' swift/stdlib/public/Platform/glibc.modulemap.gyb PREFIX=''${out/#\/} + substituteInPlace indexstore-db/Utilities/build-script-helper.py \ + --replace usr "$PREFIX" + substituteInPlace sourcekit-lsp/Utilities/build-script-helper.py \ + --replace usr "$PREFIX" substituteInPlace swift-corelibs-xctest/build_script.py \ --replace usr "$PREFIX" ''; - buildPhase = builder; + configurePhase = '' + cd .. + + mkdir build install + export SWIFT_BUILD_ROOT=$PWD/build + export SWIFT_INSTALL_DIR=$PWD/install + + export INSTALLABLE_PACKAGE=$PWD/swift.tar.gz + export NIX_ENFORCE_PURITY= - doCheck = false; + cd $SWIFT_BUILD_ROOT + ''; + + buildPhase = '' + # gcc-6.4.0/include/c++/6.4.0/cstdlib:75:15: fatal error: 'stdlib.h' file not found + export NIX_CFLAGS_COMPILE="$( echo ${clang.default_cxx_stdlib_compile} ) $NIX_CFLAGS_COMPILE" + # During the Swift build, a full local LLVM build is performed and the resulting clang is invoked. + # This compiler is not using the Nix wrappers, so it needs some help to find things. + export NIX_LDFLAGS_BEFORE="-rpath ${clang.cc.gcc.lib}/lib -L${clang.cc.gcc.lib}/lib $NIX_LDFLAGS_BEFORE" + # However, we want to use the wrapped compiler whenever possible. + export CC="${clang}/bin/clang" + + # fix for https://bugs.llvm.org/show_bug.cgi?id=39743 + # see also https://forums.swift.org/t/18138/15 + export CCC_OVERRIDE_OPTIONS="#x-fmodules s/-fmodules-cache-path.*//" + + $SWIFT_SOURCE_ROOT/swift/utils/build-script \ + --preset=buildbot_linux \ + installable_package=$INSTALLABLE_PACKAGE \ + install_prefix=$out \ + install_destdir=$SWIFT_INSTALL_DIR \ + extra_cmake_options="${stdenv.lib.concatStringsSep "," cmakeFlags}" + ''; + + doCheck = true; checkInputs = [ file ]; - # TODO: investigate the non-working tests checkPhase = '' + # FIXME: disable non-working tests + rm $SWIFT_SOURCE_ROOT/swift/test/Driver/static-stdlib-linux.swift # static linkage of libatomic.a complains about missing PIC + rm $SWIFT_SOURCE_ROOT/swift/validation-test/Python/build_swift.swift # install_prefix not passed properly + + # match the swift wrapper in the install phase + export LIBRARY_PATH=${icu}/lib:${libuuid.out}/lib + checkTarget=check-swift-all ninjaFlags='-C buildbot_linux/swift-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}' - ninjaCheckPhase ''; @@ -268,18 +288,22 @@ stdenv.mkDerivation { mkdir -p $out # Extract the generated tarball into the store - PREFIX=''${out/#\/} - tar xf $INSTALLABLE_PACKAGE -C $out --strip-components=3 $PREFIX + tar xf $INSTALLABLE_PACKAGE -C $out --strip-components=3 ''${out/#\/} find $out -type d -empty -delete + # fix installation weirdness, also present in Appleās official tarballs + mv $out/local/include/indexstore $out/include + rmdir $out/local/include $out/local + rm -r $out/bin/sdk-module-lists $out/bin/swift-api-checker.py + wrapProgram $out/bin/swift \ --suffix C_INCLUDE_PATH : $out/lib/swift/clang/include \ --suffix CPLUS_INCLUDE_PATH : $out/lib/swift/clang/include \ - --suffix LIBRARY_PATH : $icu/lib + --suffix LIBRARY_PATH : ${icu}/lib:${libuuid.out}/lib ''; - # Hack to avoid TMPDIR in RPATHs. - preFixup = ''rm -rf "$(pwd)" ''; + # Hack to avoid build and install directories in RPATHs. + preFixup = ''rm -rf $SWIFT_BUILD_ROOT $SWIFT_INSTALL_DIR''; meta = with stdenv.lib; { description = "The Swift Programming Language"; diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch b/nixpkgs/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch index 79482ac10e69..60b2996b3405 100644 --- a/nixpkgs/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch +++ b/nixpkgs/pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch @@ -1,17 +1,8 @@ -From 1fc49285c7a198de14005803dfde64bda17f4120 Mon Sep 17 00:00:00 2001 -From: Will Dietz <w@wdtz.org> -Date: Tue, 28 Mar 2017 15:01:16 -0500 -Subject: [PATCH 1/4] build-presets: (linux) don't require using Ninja +Don't build Ninja, we use our own. ---- - utils/build-presets.ini | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/utils/build-presets.ini b/utils/build-presets.ini -index 7ee57ad2df..e6b0af3581 100644 --- a/utils/build-presets.ini +++ b/utils/build-presets.ini -@@ -721,7 +721,7 @@ swiftpm +@@ -745,7 +745,7 @@ swiftpm dash-dash @@ -20,6 +11,3 @@ index 7ee57ad2df..e6b0af3581 100644 install-swift install-lldb install-llbuild --- -2.12.2 - diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch b/nixpkgs/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch index 5c1927acb7f1..5ca6bf1354dc 100644 --- a/nixpkgs/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch +++ b/nixpkgs/pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch @@ -1,25 +1,13 @@ -From fca6624b7a0ad670157105336a737cc95f9ce9fb Mon Sep 17 00:00:00 2001 -From: Will Dietz <w@wdtz.org> -Date: Tue, 28 Mar 2017 15:01:40 -0500 -Subject: [PATCH 2/4] build-presets: (linux) allow custom install prefix +allow custom install prefix ---- - utils/build-presets.ini | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/utils/build-presets.ini b/utils/build-presets.ini -index e6b0af3581..1095cbaab7 100644 --- a/utils/build-presets.ini 2019-04-11 14:51:40.060259462 +0200 +++ b/utils/build-presets.ini 2019-04-11 15:16:17.471137969 +0200 -@@ -728,7 +728,7 @@ +@@ -752,7 +752,7 @@ install-swiftpm install-xctest install-libicu -install-prefix=/usr +install-prefix=%(install_prefix)s - swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc - llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt install-libcxx --- -2.12.2 - + install-sourcekit-lsp + build-swift-static-stdlib diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch b/nixpkgs/pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch index 5d766bc25901..0a66af9e5137 100644 --- a/nixpkgs/pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch +++ b/nixpkgs/pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch @@ -1,6 +1,8 @@ +Disable targets, where we use Nix packages. + --- a/utils/build-presets.ini 2019-04-11 15:19:57.845178834 +0200 +++ b/utils/build-presets.ini 2019-04-11 15:27:42.041297057 +0200 -@@ -716,8 +716,6 @@ +@@ -740,8 +740,6 @@ llbuild swiftpm xctest @@ -9,15 +11,13 @@ dash-dash -@@ -727,11 +725,9 @@ +@@ -751,9 +749,7 @@ install-llbuild install-swiftpm install-xctest -install-libicu install-prefix=%(install_prefix)s - swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc - llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt -install-libcxx + install-sourcekit-lsp build-swift-static-stdlib build-swift-static-sdk-overlay - build-swift-stdlib-unittest-extra diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch b/nixpkgs/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch index 1d0a6a9577aa..304b53a1dbf1 100644 --- a/nixpkgs/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch +++ b/nixpkgs/pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch @@ -1,17 +1,8 @@ -From 4a46b12f580d0a9779937d07c4f1fd347570c4ef Mon Sep 17 00:00:00 2001 -From: Will Dietz <w@wdtz.org> -Date: Tue, 28 Mar 2017 15:02:37 -0500 -Subject: [PATCH 4/4] build-presets: (linux) plumb extra-cmake-options +plumb extra-cmake-options ---- - utils/build-presets.ini | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/utils/build-presets.ini b/utils/build-presets.ini -index 1739e91dc2..0608fed9c1 100644 --- a/utils/build-presets.ini +++ b/utils/build-presets.ini -@@ -743,6 +743,8 @@ install-destdir=%(install_destdir)s +@@ -766,6 +766,8 @@ install-destdir=%(install_destdir)s # Path to the .tar.gz package we would create. installable-package=%(installable_package)s @@ -20,6 +11,3 @@ index 1739e91dc2..0608fed9c1 100644 [preset: buildbot_linux] mixin-preset=mixin_linux_installation build-subdir=buildbot_linux --- -2.12.2 - diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch b/nixpkgs/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch index df906f9c84c7..c05db5208012 100644 --- a/nixpkgs/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch +++ b/nixpkgs/pkgs/development/compilers/swift/patches/glibc-arch-headers.patch @@ -2,7 +2,7 @@ The Nix glibc headers do not use include/x86_64-linux-gnu subdirectories. --- swift/stdlib/public/Platform/CMakeLists.txt 2019-04-09 20:14:44.493801403 +0200 +++ swift/stdlib/public/Platform/CMakeLists.txt 2019-04-09 20:14:44.577800593 +0200 -@@ -68,7 +68,7 @@ +@@ -77,7 +77,7 @@ endif() set(GLIBC_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_INCLUDE_PATH}") diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch b/nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch deleted file mode 100644 index d23a308d68f4..000000000000 --- a/nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -Nix compiles with _FORTIFY_SOURCE enabled. Fix error due to -Werror and an unused return value warning. - ---- swift-corelibs-libdispatch/src/internal.h 2019-04-26 09:33:38.287289099 +0200 -+++ swift-corelibs-libdispatch/src/internal.h 2019-04-26 15:31:10.485334128 +0200 -@@ -1053,7 +1053,7 @@ - #else - #define _dispatch_client_assert_fail(fmt, ...) do { \ - char *_msg = NULL; \ -- asprintf(&_msg, "%s" fmt, DISPATCH_ASSERTION_FAILED_MESSAGE, \ -+ (void)asprintf(&_msg, "%s" fmt, DISPATCH_ASSERTION_FAILED_MESSAGE, \ - ##__VA_ARGS__); \ - _dispatch_assert_crash(_msg); \ - free(_msg); \ diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch b/nixpkgs/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch deleted file mode 100644 index 789c0be7e7a8..000000000000 --- a/nixpkgs/pkgs/development/compilers/swift/patches/llvm-include-dirs.patch +++ /dev/null @@ -1,13 +0,0 @@ -Only use the Nix include dirs when no sysroot is configured. - ---- clang/lib/Driver/ToolChains/Linux.cpp 2018-10-05 18:01:15.731109551 +0200 -+++ clang/lib/Driver/ToolChains/Linux.cpp 2018-10-05 18:00:27.959509924 +0200 -@@ -641,7 +641,7 @@ - - // Check for configure-time C include directories. - StringRef CIncludeDirs(C_INCLUDE_DIRS); -- if (CIncludeDirs != "") { -+ if (CIncludeDirs != "" && (SysRoot.empty() || SysRoot == "/")) { - SmallVector<StringRef, 5> dirs; - CIncludeDirs.split(dirs, ":"); - for (StringRef dir : dirs) { diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/llvm-toolchain-dir.patch b/nixpkgs/pkgs/development/compilers/swift/patches/llvm-toolchain-dir.patch new file mode 100644 index 000000000000..c22b5c820c85 --- /dev/null +++ b/nixpkgs/pkgs/development/compilers/swift/patches/llvm-toolchain-dir.patch @@ -0,0 +1,24 @@ +Use the Nix include dirs and gcc runtime dir, when no sysroot is configured. + +--- clang/lib/Driver/ToolChains/Linux.cpp 2018-10-05 18:01:15.731109551 +0200 ++++ clang/lib/Driver/ToolChains/Linux.cpp 2018-10-05 18:00:27.959509924 +0200 +@@ -665,7 +665,7 @@ + + // Check for configure-time C include directories. + StringRef CIncludeDirs(C_INCLUDE_DIRS); +- if (CIncludeDirs != "") { ++ if (CIncludeDirs != "" && (SysRoot.empty() || SysRoot == "/")) { + SmallVector<StringRef, 5> dirs; + CIncludeDirs.split(dirs, ":"); + for (StringRef dir : dirs) { +--- clang/lib/Driver/ToolChains/Gnu.cpp 2019-10-26 09:49:27.003752743 +0200 ++++ clang/lib/Driver/ToolChains/Gnu.cpp 2019-10-26 09:50:49.067236497 +0200 +@@ -1743,7 +1743,7 @@ + // If we have a SysRoot, ignore GCC_INSTALL_PREFIX. + // GCC_INSTALL_PREFIX specifies the gcc installation for the default + // sysroot and is likely not valid with a different sysroot. +- if (!SysRoot.empty()) ++ if (!(SysRoot.empty() || SysRoot == "/")) + return ""; + + return GCC_INSTALL_PREFIX; diff --git a/nixpkgs/pkgs/development/compilers/swift/purity.patch b/nixpkgs/pkgs/development/compilers/swift/purity.patch index 832decdc41f5..4133e89c2830 100644 --- a/nixpkgs/pkgs/development/compilers/swift/purity.patch +++ b/nixpkgs/pkgs/development/compilers/swift/purity.patch @@ -1,17 +1,8 @@ -From 4add81bba40dcec62c4ea4481be8e35ac53e89d8 Mon Sep 17 00:00:00 2001 -From: Will Dietz <w@wdtz.org> -Date: Thu, 18 May 2017 11:56:12 -0500 -Subject: [PATCH] "purity" patch for 5.0 +"purity" patch for 5.0 ---- - lib/Driver/ToolChains/Gnu.cpp | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp -index fe3c0191bb..c6a482bece 100644 --- a/lib/Driver/ToolChains/Gnu.cpp +++ b/lib/Driver/ToolChains/Gnu.cpp -@@ -380,13 +380,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, +@@ -402,13 +402,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (!Args.hasArg(options::OPT_static)) { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); @@ -25,6 +16,3 @@ index fe3c0191bb..c6a482bece 100644 } CmdArgs.push_back("-o"); --- -2.11.0 - |