about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/llvm/9
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/9')
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix11
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/lldb/default.nix11
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch40
3 files changed, 55 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix
index 700fcb414fce..c98b4a830c42 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
+{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
 , buildLlvmTools
 , fixDarwinDylibNames
 , enableManpages ? false
@@ -52,6 +52,10 @@ let
       # make clang -xhip use $PATH to find executables
       ./HIP-use-PATH-9.patch
       ./gnu-install-dirs.patch
+      (substituteAll {
+        src = ../../clang-6-10-LLVMgold-path.patch;
+        libllvmLibdir = "${libllvm.lib}/lib";
+      })
     ];
 
     postPatch = ''
@@ -70,12 +74,7 @@ let
 
     outputs = [ "out" "lib" "dev" "python" ];
 
-    # Clang expects to find LLVMgold in its own prefix
     postInstall = ''
-      if [ -e ${libllvm.lib}/lib/LLVMgold.so ]; then
-        ln -sv ${libllvm.lib}/lib/LLVMgold.so $lib/lib
-      fi
-
       ln -sv $out/bin/clang $out/bin/cpp
 
       # Move libclang to 'lib' output
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/lldb/default.nix b/nixpkgs/pkgs/development/compilers/llvm/9/lldb/default.nix
index 9957a0218da8..63edc60828eb 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/lldb/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/lldb/default.nix
@@ -12,6 +12,7 @@
 , python3
 , version
 , darwin
+, makeWrapper
 , lit
 }:
 
@@ -29,7 +30,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "lib" "dev" ];
 
   nativeBuildInputs = [
-    cmake python3 which swig lit
+    cmake python3 which swig lit makeWrapper
   ];
 
   buildInputs = [
@@ -58,7 +59,15 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
+  installCheckPhase = ''
+    if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then
+        return 1;
+    fi
+  '';
+
   postInstall = ''
+    wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/
+
     # man page
     mkdir -p $out/share/man/man1
     install ../docs/lldb.1 -t $out/share/man/man1/
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch b/nixpkgs/pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch
index cb4e400b3678..6ceb29ced92f 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/lldb/gnu-install-dirs.patch
@@ -63,3 +63,43 @@ index b5316540fdf3..3c3c882d503f 100644
  install(TARGETS lldbIntelFeatures
 -  LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
 +  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cdf22c4..d56fc6a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -146,7 +146,7 @@ if (NOT LLDB_DISABLE_PYTHON)
+                --cfgBldDir=${lldb_scripts_dir}
+                --prefix=${CMAKE_BINARY_DIR}
+                --cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}
+-               --lldbLibDir=lib${LLVM_LIBDIR_SUFFIX}
++               --lldbLibDir=${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
+                ${use_python_wrapper_from_src_dir}
+                ${use_six_py_from_system}
+         VERBATIM
+diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake
+index b726797..1f057ac 100644
+--- a/cmake/modules/LLDBStandalone.cmake
++++ b/cmake/modules/LLDBStandalone.cmake
+@@ -95,7 +95,7 @@ include_directories(
+   "${CLANG_INCLUDE_DIRS}")
+
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR}/lib${LLVM_LIBDIR_SUFFIX})
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
+
+ set(LLDB_BUILT_STANDALONE 1)
+diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
+index 7de7973..b70aecc 100644
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -50,7 +50,8 @@ if(NOT LLDB_BUILD_FRAMEWORK)
+     OUTPUT_STRIP_TRAILING_WHITESPACE)
+   execute_process(
+     COMMAND ${PYTHON_EXECUTABLE}
+-        -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(True, False, ''))"
++        -c "import distutils.sysconfig, sys; print(distutils.sysconfig.get_python_lib(True, False, sys.argv[1]))"
++        ${CMAKE_INSTALL_LIBDIR}/../
+     OUTPUT_VARIABLE SWIG_INSTALL_DIR
+     OUTPUT_STRIP_TRAILING_WHITESPACE)
+