From 34436df0d0e57caafb6b0ed5911f71861b10a6eb Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Sun, 23 Apr 2017 23:44:50 +0000 Subject: clang: Use cmake from buildPackages --- pkgs/development/compilers/llvm/3.9/clang/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/llvm/3.9/clang/default.nix b/pkgs/development/compilers/llvm/3.9/clang/default.nix index 910682271103..87216e424caf 100644 --- a/pkgs/development/compilers/llvm/3.9/clang/default.nix +++ b/pkgs/development/compilers/llvm/3.9/clang/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src, python }: +{ stdenv, fetch, libxml2, libedit, llvm, version, clang-tools-extra_src, python, buildPackages }: let gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; @@ -13,7 +13,7 @@ let mv clang-tools-extra-* $sourceRoot/tools/extra ''; - buildInputs = [ cmake libedit libxml2 llvm python ]; + buildInputs = [ buildPackages.cmake libedit libxml2 llvm python ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" -- cgit 1.4.1 From 12bbc630247f85f4fa84c100d856a712b6d7cf4d Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Sun, 23 Apr 2017 23:48:02 +0000 Subject: llvm-3.9: Fix cross compilation It's now possible to cross compile llvm: `nix-build -E '(import ./. { crossSystem = import ./platform.nix; }).pkgs.llvm'` --- pkgs/development/compilers/llvm/3.9/llvm.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 2c47ec5127f9..0408b9413c8a 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -17,6 +17,9 @@ , debugVersion ? false , enableSharedLibraries ? true , darwin +, buildPackages +, buildPlatform +, hostPlatform }: let @@ -39,7 +42,13 @@ in stdenv.mkDerivation rec { outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib"; - buildInputs = [ perl groff cmake libxml2 python libffi ] + buildInputs = [ + buildPackages.perl + buildPackages.buildPackages.cmake + buildPackages.python + groff + libxml2 + libffi ] ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ]; propagatedBuildInputs = [ ncurses zlib ]; @@ -88,6 +97,9 @@ in stdenv.mkDerivation rec { ++ stdenv.lib.optionals (isDarwin) [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" + ] ++ stdenv.lib.optionals (buildPlatform != hostPlatform) [ + "-DCMAKE_CROSSCOMPILING=True" + "-DLLVM_TABLEGEN=${buildPackages.llvmPackages_39.llvm}/bin/llvm-tblgen" ]; postBuild = '' -- cgit 1.4.1 From fea424fea33b7b71dfc43b3297ad2d1d2da36f5a Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Tue, 25 Apr 2017 22:23:58 +0000 Subject: LLVM-3.9: Fix RPATH in cross compile builds This error was cause by multiple-outputs.sh not setting NIX_CROSS_LDFLAGS --- pkgs/development/compilers/llvm/3.9/llvm.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 0408b9413c8a..6c86ac0c2942 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -81,6 +81,12 @@ in stdenv.mkDerivation rec { preBuild = '' mkdir -p $out/ ln -sv $PWD/lib $out + '' + + # This is a good candidate for using the `placeholder` primitive when it's released + # This should hopefully be unnecessary once + # https://github.com/NixOS/nixpkgs/pull/25047 is merged + stdenv.lib.optionalString (buildPlatform != hostPlatform && enableSharedLibraries) '' + export NIX_CROSS_LDFLAGS="-rpath $lib/lib -rpath $lib/lib64 $NIX_CROSS_LDFLAGS" ''; cmakeFlags = with stdenv; [ -- cgit 1.4.1 From bad5ca052553aefb724e32bed1ea547b911cbb4b Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Tue, 25 Apr 2017 22:31:31 +0000 Subject: LLVM-3.9: Use nativeBuildInputs instead of buildPackages --- pkgs/development/compilers/llvm/3.9/clang/default.nix | 6 ++++-- pkgs/development/compilers/llvm/3.9/llvm.nix | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/llvm/3.9/clang/default.nix b/pkgs/development/compilers/llvm/3.9/clang/default.nix index 87216e424caf..ec2ec27df363 100644 --- a/pkgs/development/compilers/llvm/3.9/clang/default.nix +++ b/pkgs/development/compilers/llvm/3.9/clang/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetch, libxml2, libedit, llvm, version, clang-tools-extra_src, python, buildPackages }: +{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src, python }: let gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; @@ -13,7 +13,9 @@ let mv clang-tools-extra-* $sourceRoot/tools/extra ''; - buildInputs = [ buildPackages.cmake libedit libxml2 llvm python ]; + nativeBuildInputs = [ cmake ]; + + buildInputs = [ libedit libxml2 llvm python ]; cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-std=c++11" diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 6c86ac0c2942..380abc0b9b47 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -42,10 +42,13 @@ in stdenv.mkDerivation rec { outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib"; + nativeBuildInputs = [ + perl + cmake + python + ]; + buildInputs = [ - buildPackages.perl - buildPackages.buildPackages.cmake - buildPackages.python groff libxml2 libffi ] -- cgit 1.4.1 From 7b7ffc4999ba4b38f8090aab48a78ace0eb3424a Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Wed, 26 Apr 2017 14:01:35 +0000 Subject: LLVM-3.9: disable shared libraries in cross builds The current cc-wrapper script seems to have trouble setting the rpath correctly. Hopefully #25047 will fix this. --- pkgs/development/compilers/llvm/3.9/llvm.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 380abc0b9b47..96efc97323c6 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -15,13 +15,15 @@ , compiler-rt_src , libcxxabi , debugVersion ? false -, enableSharedLibraries ? true +, enableSharedLibraries ? (buildPlatform == hostPlatform) , darwin , buildPackages , buildPlatform , hostPlatform }: +assert (hostPlatform != buildPlatform) -> !enableSharedLibraries; + let src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z"; shlib = if stdenv.isDarwin then "dylib" else "so"; @@ -84,12 +86,6 @@ in stdenv.mkDerivation rec { preBuild = '' mkdir -p $out/ ln -sv $PWD/lib $out - '' - + # This is a good candidate for using the `placeholder` primitive when it's released - # This should hopefully be unnecessary once - # https://github.com/NixOS/nixpkgs/pull/25047 is merged - stdenv.lib.optionalString (buildPlatform != hostPlatform && enableSharedLibraries) '' - export NIX_CROSS_LDFLAGS="-rpath $lib/lib -rpath $lib/lib64 $NIX_CROSS_LDFLAGS" ''; cmakeFlags = with stdenv; [ -- cgit 1.4.1 From ad778a64d7c887405e37a2ddc375dc01350dfe10 Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Wed, 26 Apr 2017 13:14:00 +0000 Subject: LLVM-3.9: formatting --- pkgs/development/compilers/llvm/3.9/llvm.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/compilers') diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix index 96efc97323c6..964b6232fb54 100644 --- a/pkgs/development/compilers/llvm/3.9/llvm.nix +++ b/pkgs/development/compilers/llvm/3.9/llvm.nix @@ -53,8 +53,8 @@ in stdenv.mkDerivation rec { buildInputs = [ groff libxml2 - libffi ] - ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ]; + libffi + ] ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ]; propagatedBuildInputs = [ ncurses zlib ]; -- cgit 1.4.1 From 65ede052fa9f005efcdb2e852315a0e6f02ce92d Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Tue, 16 May 2017 16:35:52 +0200 Subject: treewide: fixup packages with RPATH problems --- pkgs/applications/science/math/calc/default.nix | 3 +++ pkgs/development/compilers/bigloo/default.nix | 3 +++ pkgs/development/compilers/swift/default.nix | 3 +++ pkgs/development/libraries/libftdi/default.nix | 3 +++ pkgs/games/klavaro/default.nix | 3 +++ pkgs/os-specific/linux/libsmbios/default.nix | 3 +++ pkgs/tools/security/ssdeep/default.nix | 3 +++ 7 files changed, 21 insertions(+) (limited to 'pkgs/development/compilers') diff --git a/pkgs/applications/science/math/calc/default.nix b/pkgs/applications/science/math/calc/default.nix index 19f769e4365c..b8ed7ffac3cd 100644 --- a/pkgs/applications/science/math/calc/default.nix +++ b/pkgs/applications/science/math/calc/default.nix @@ -34,6 +34,9 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/calc --prefix LD_LIBRARY_PATH : $out/lib ''; + # Hack to avoid TMPDIR in RPATHs. + preFixup = ''rm -rf "$(pwd)" ''; + meta = { description = "C-style arbitrary precision calculator"; homepage = http://www.isthe.com/chongo/tech/comp/calc/; diff --git a/pkgs/development/compilers/bigloo/default.nix b/pkgs/development/compilers/bigloo/default.nix index 3599ff750c26..bf2272a75c17 100644 --- a/pkgs/development/compilers/bigloo/default.nix +++ b/pkgs/development/compilers/bigloo/default.nix @@ -32,6 +32,9 @@ stdenv.mkDerivation rec { checkTarget = "test"; + # Hack to avoid TMPDIR in RPATHs. + preFixup = ''rm -rf "$(pwd)" ''; + meta = { description = "Efficient Scheme compiler"; homepage = http://www-sop.inria.fr/indes/fp/Bigloo/; diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index 4b918c9e32a9..839ecdbeb652 100644 --- a/pkgs/development/compilers/swift/default.nix +++ b/pkgs/development/compilers/swift/default.nix @@ -253,6 +253,9 @@ stdenv.mkDerivation rec { ln -s ${binutils}/bin/ar $out/bin/ar ''; + # Hack to avoid TMPDIR in RPATHs. + preFixup = ''rm -rf "$(pwd)" ''; + meta = with stdenv.lib; { description = "The Swift Programming Language"; homepage = "https://github.com/apple/swift"; diff --git a/pkgs/development/libraries/libftdi/default.nix b/pkgs/development/libraries/libftdi/default.nix index 36f4a04c9df6..f0d05c0b263f 100644 --- a/pkgs/development/libraries/libftdi/default.nix +++ b/pkgs/development/libraries/libftdi/default.nix @@ -12,6 +12,9 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ libusb ]; + # Hack to avoid TMPDIR in RPATHs. + preFixup = ''rm -rf "$(pwd)" ''; + meta = { description = "A library to talk to FTDI chips using libusb"; homepage = http://www.intra2net.com/en/developer/libftdi/; diff --git a/pkgs/games/klavaro/default.nix b/pkgs/games/klavaro/default.nix index 2ca105af19d2..162543da10c4 100644 --- a/pkgs/games/klavaro/default.nix +++ b/pkgs/games/klavaro/default.nix @@ -16,6 +16,9 @@ stdenv.mkDerivation rec { --prefix LD_LIBRARY_PATH : $out/lib ''; + # Hack to avoid TMPDIR in RPATHs. + preFixup = ''rm -rf "$(pwd)" ''; + meta = { description = "Just another free touch typing tutor program"; homepage = http://klavaro.sourceforge.net/; diff --git a/pkgs/os-specific/linux/libsmbios/default.nix b/pkgs/os-specific/linux/libsmbios/default.nix index e2b675fb4ffa..eaf6d98ba9d8 100644 --- a/pkgs/os-specific/linux/libsmbios/default.nix +++ b/pkgs/os-specific/linux/libsmbios/default.nix @@ -23,6 +23,9 @@ stdenv.mkDerivation { cp -va "out/public-include/"* "$out/include/" ''; + # Hack to avoid TMPDIR in RPATHs. + preFixup = ''rm -rf "$(pwd)" ''; + meta = { homepage = "http://linux.dell.com/libsmbios/main"; description = "A library to obtain BIOS information"; diff --git a/pkgs/tools/security/ssdeep/default.nix b/pkgs/tools/security/ssdeep/default.nix index b581d8007947..0a9804a743bc 100644 --- a/pkgs/tools/security/ssdeep/default.nix +++ b/pkgs/tools/security/ssdeep/default.nix @@ -9,6 +9,9 @@ stdenv.mkDerivation rec { sha256 = "1igqy0j7jrklb8fdlrm6ald4cyl1fda5ipfl8crzyl6bax2ajk3f"; }; + # Hack to avoid TMPDIR in RPATHs. + preFixup = ''rm -rf "$(pwd)" ''; + # For some reason (probably a build system bug), the binary isn't # properly linked to $out/lib to find libfuzzy.so postFixup = stdenv.lib.optionalString (!stdenv.isDarwin) '' -- cgit 1.4.1