From 7869d1654517c028aa76fc1dedc9b5ac301a867a Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Thu, 15 Oct 2020 17:23:57 +0900 Subject: llvmPackages: Multuple outputs for everythting Also begin to start work on cross compilation, though that will have to be finished later. The patches are based on the first version of https://reviews.llvm.org/D99484. It's very annoying to do the back-porting but the review has uncovered nothing super major so I'm fine sticking with what I've got. Beyond making the outputs work, I also strove to re-sync the packages, as they have been drifting pointlessly apart for some time. ---- Other misc notes, highly incomplete - lvm-config-native and llvm-config are put in `dev` because they are tools just for build time. - Clang no longer has an lld dep. That was introduced in db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help finding lld when it is used we should just pass it flags / put in the resource dir. Providing it at build time increases critical path length for no good reason. ---- A note on `nativeCC`: `stdenv` takes tools from the previous stage, so: 1. `pkgsBuildBuild`: `(?1, x, x)` 2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)` while: 1. `pkgsBuildBuild`: `(?1, x, x)` 2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)` 3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)` --- pkgs/applications/blockchains/electrs.nix | 2 +- pkgs/applications/blockchains/openethereum/default.nix | 2 +- pkgs/applications/blockchains/polkadot/default.nix | 2 +- pkgs/applications/editors/jucipp/default.nix | 4 ++-- pkgs/applications/editors/kdevelop5/kdevelop.nix | 4 ++-- pkgs/applications/editors/rstudio/clang-location.patch | 2 +- pkgs/applications/editors/rstudio/default.nix | 4 ++-- pkgs/applications/misc/clipcat/default.nix | 2 +- pkgs/applications/misc/imag/default.nix | 2 +- pkgs/applications/networking/browsers/firefox/common.nix | 6 +++--- pkgs/applications/networking/mailreaders/thunderbird/68.nix | 2 +- pkgs/applications/networking/mailreaders/thunderbird/default.nix | 2 +- pkgs/applications/science/math/R/default.nix | 4 ++-- 13 files changed, 19 insertions(+), 19 deletions(-) (limited to 'pkgs/applications') diff --git a/pkgs/applications/blockchains/electrs.nix b/pkgs/applications/blockchains/electrs.nix index 30742f8d7199a..af0346196a321 100644 --- a/pkgs/applications/blockchains/electrs.nix +++ b/pkgs/applications/blockchains/electrs.nix @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec { # needed for librocksdb-sys nativeBuildInputs = [ llvmPackages.clang ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; cargoSha256 = "1rqpadlr9r4z2z825li6vi5a21hivc3bsn5ibxshrdrwiycyyxz8"; diff --git a/pkgs/applications/blockchains/openethereum/default.nix b/pkgs/applications/blockchains/openethereum/default.nix index 82b6f2c1adb72..179c817abb8c9 100644 --- a/pkgs/applications/blockchains/openethereum/default.nix +++ b/pkgs/applications/blockchains/openethereum/default.nix @@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1gm02pcfll362add8a0dcb0sk0mag8z0q23b87yb6fs870bqvhib"; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; nativeBuildInputs = [ cmake llvmPackages.clang diff --git a/pkgs/applications/blockchains/polkadot/default.nix b/pkgs/applications/blockchains/polkadot/default.nix index abe7ab56431c6..c531cc3a88ec4 100644 --- a/pkgs/applications/blockchains/polkadot/default.nix +++ b/pkgs/applications/blockchains/polkadot/default.nix @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ clang ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; PROTOC = "${protobuf}/bin/protoc"; # NOTE: We don't build the WASM runtimes since this would require a more diff --git a/pkgs/applications/editors/jucipp/default.nix b/pkgs/applications/editors/jucipp/default.nix index 7304219e23693..140bf04c9f365 100644 --- a/pkgs/applications/editors/jucipp/default.nix +++ b/pkgs/applications/editors/jucipp/default.nix @@ -56,8 +56,8 @@ stdenv.mkDerivation rec { e = "\");"; v = lib.getVersion llvmPackages.clang; in - p+llvmPackages.libcxx+"/include/c++/v1"+e - +p+llvmPackages.clang-unwrapped+"/lib/clang/"+v+"/include/"+e + p+llvmPackages.libcxx.dev+"/include/c++/v1"+e + +p+llvmPackages.clang-unwrapped.lib+"/lib/clang/"+v+"/include/"+e +p+glibc.dev+"/include"+e; preConfigure = '' diff --git a/pkgs/applications/editors/kdevelop5/kdevelop.nix b/pkgs/applications/editors/kdevelop5/kdevelop.nix index b54015de7b8ff..8894707643ada 100644 --- a/pkgs/applications/editors/kdevelop5/kdevelop.nix +++ b/pkgs/applications/editors/kdevelop5/kdevelop.nix @@ -23,7 +23,7 @@ mkDerivation rec { buildInputs = [ kdevelop-pg-qt - llvmPackages.llvm llvmPackages.clang-unwrapped + llvmPackages.llvm llvmPackages.libclang ]; propagatedBuildInputs = [ @@ -37,7 +37,7 @@ mkDerivation rec { # https://cgit.kde.org/kdevelop.git/commit/?id=716372ae2e8dff9c51e94d33443536786e4bd85b # required as nixos seems to be unable to find CLANG_BUILTIN_DIR cmakeFlags = [ - "-DCLANG_BUILTIN_DIR=${llvmPackages.clang-unwrapped}/lib/clang/${lib.getVersion llvmPackages.clang}/include" + "-DCLANG_BUILTIN_DIR=${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include" ]; dontWrapQtApps = true; diff --git a/pkgs/applications/editors/rstudio/clang-location.patch b/pkgs/applications/editors/rstudio/clang-location.patch index 402abdd85636c..700ed754d2bb4 100644 --- a/pkgs/applications/editors/rstudio/clang-location.patch +++ b/pkgs/applications/editors/rstudio/clang-location.patch @@ -7,7 +7,7 @@ index ec12a3a1ff..8c81b633ae 100644 // we need to add in the associated libclang headers as // they are not discovered / used by default during compilation - FilePath llvmPath = s_libraryPath.parent().parent(); -+ FilePath llvmPath("@clang@"); ++ FilePath llvmPath("@libclang@"); boost::format fmt("%1%/lib/clang/%2%/include"); fmt % llvmPath.absolutePath() % version.asString(); std::string includePath = fmt.str(); diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 00d0259a7a9b8..76d9c2e594b29 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -42,8 +42,8 @@ mkDerivation rec { postPatch = '' substituteInPlace src/cpp/core/r_util/REnvironmentPosix.cpp --replace '@R@' ${R} substituteInPlace src/cpp/core/libclang/LibClang.cpp \ - --replace '@clang@' ${llvmPackages.clang.cc} \ - --replace '@libclang.so@' ${llvmPackages.clang.cc.lib}/lib/libclang.so + --replace '@libclang@' ${llvmPackages.libclang.lib} \ + --replace '@libclang.so@' ${llvmPackages.libclang.lib}/lib/libclang.so ''; ginSrc = fetchurl { diff --git a/pkgs/applications/misc/clipcat/default.nix b/pkgs/applications/misc/clipcat/default.nix index 497e5616e8050..95f50998f3ffa 100644 --- a/pkgs/applications/misc/clipcat/default.nix +++ b/pkgs/applications/misc/clipcat/default.nix @@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1ffgvhkdj8wkhlgi0cj0njdm9ycxq2qda4b5qn8bmaygzr2zkwpd"; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; # needed for internal protobuf c wrapper library PROTOC = "${protobuf}/bin/protoc"; diff --git a/pkgs/applications/misc/imag/default.nix b/pkgs/applications/misc/imag/default.nix index 09f734df9a11d..5c1e87612e1bf 100644 --- a/pkgs/applications/misc/imag/default.nix +++ b/pkgs/applications/misc/imag/default.nix @@ -26,7 +26,7 @@ rustPlatform.buildRustPackage rec { ++ lib.optional stdenv.isDarwin Security; checkInputs = [ gitMinimal util-linuxMinimal ]; - LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; cargoSha256 = "0n8cw70qh8g4hfwfaxwwxbrrx5hm2z037z8kdhvdpqkxljl9189x"; diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 24195e578bd0d..4872324932302 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -248,8 +248,8 @@ buildStdenv.mkDerivation ({ $(< ${buildStdenv.cc}/nix-support/libc-cflags) \ $(< ${buildStdenv.cc}/nix-support/cc-cflags) \ $(< ${buildStdenv.cc}/nix-support/libcxx-cxxflags) \ - ${lib.optionalString buildStdenv.cc.isClang "-idirafter ${buildStdenv.cc.cc}/lib/clang/${lib.getVersion buildStdenv.cc.cc}/include"} \ - ${lib.optionalString buildStdenv.cc.isGNU "-isystem ${buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc} -isystem ${buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc}/${buildStdenv.hostPlatform.config}"} \ + ${lib.optionalString buildStdenv.cc.isClang "-idirafter ${buildStdenv.cc.cc.lib}/lib/clang/${lib.getVersion buildStdenv.cc.cc}/include"} \ + ${lib.optionalString buildStdenv.cc.isGNU "-isystem ${lib.getDev buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc} -isystem ${buildStdenv.cc.cc}/include/c++/${lib.getVersion buildStdenv.cc.cc}/${buildStdenv.hostPlatform.config}"} \ $NIX_CFLAGS_COMPILE" echo "ac_add_options BINDGEN_CFLAGS='$BINDGEN_CFLAGS'" >> $MOZCONFIG @@ -282,7 +282,7 @@ buildStdenv.mkDerivation ({ "--disable-updater" "--enable-jemalloc" "--enable-default-toolkit=${default-toolkit}" - "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-system-nspr" "--with-system-nss" ] diff --git a/pkgs/applications/networking/mailreaders/thunderbird/68.nix b/pkgs/applications/networking/mailreaders/thunderbird/68.nix index 4433551d2e10f..f7713c4163382 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/68.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/68.nix @@ -244,7 +244,7 @@ stdenv.mkDerivation rec { "--enable-strip" ]) ++ lib.optionals (!stdenv.hostPlatform.isi686) [ # on i686-linux: --with-libclang-path is not available in this configuration - "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-clang-path=${llvmPackages.clang}/bin/clang" ] ++ lib.optional alsaSupport "--enable-alsa" ++ lib.optional calendarSupport "--enable-calendar" diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix index 8e176638da60a..72a4d92cabf1f 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix @@ -242,7 +242,7 @@ stdenv.mkDerivation rec { "--enable-strip" ]) ++ lib.optionals (!stdenv.hostPlatform.isi686) [ # on i686-linux: --with-libclang-path is not available in this configuration - "--with-libclang-path=${llvmPackages.libclang}/lib" + "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-clang-path=${llvmPackages.clang}/bin/clang" ] ++ lib.optional alsaSupport "--enable-alsa" ++ lib.optional calendarSupport "--enable-calendar" diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix index 331faa6b14799..62f3921afefb2 100644 --- a/pkgs/applications/science/math/R/default.nix +++ b/pkgs/applications/science/math/R/default.nix @@ -68,8 +68,8 @@ stdenv.mkDerivation rec { '' + lib.optionalString stdenv.isDarwin '' --disable-R-framework OBJC="clang" - CPPFLAGS="-isystem ${libcxx}/include/c++/v1" - LDFLAGS="-L${libcxx}/lib" + CPPFLAGS="-isystem ${lib.getDev libcxx}/include/c++/v1" + LDFLAGS="-L${lib.getLib libcxx}/lib" '' + '' ) echo >>etc/Renviron.in "TCLLIBPATH=${tk}/lib" -- cgit 1.4.1