From a5f0733461e6937d0397e2afdef73db15f748c61 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 8 Aug 2021 13:56:25 +0200 Subject: [PATCH] llvmPackages_13.lldb: python into lib & wrap binary Ported from cc7740ae770c52ac1f385aa25cfc143fe79c6b6e. --- .../compilers/llvm/13/lldb/default.nix | 7 +++++-- .../compilers/llvm/13/lldb/gnu-install-dirs.patch | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/llvm/13/lldb/default.nix b/pkgs/development/compilers/llvm/13/lldb/default.nix index 63a5c828faa..96d8b19ee41 100644 --- a/pkgs/development/compilers/llvm/13/lldb/default.nix +++ b/pkgs/development/compilers/llvm/13/lldb/default.nix @@ -19,6 +19,7 @@ , Carbon , Cocoa , lit +, makeWrapper , enableManpages ? false }: @@ -42,7 +43,7 @@ stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" ]; nativeBuildInputs = [ - cmake python3 which swig lit + cmake python3 which swig lit makeWrapper ] ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; @@ -85,12 +86,14 @@ stdenv.mkDerivation (rec { doCheck = false; installCheckPhase = '' - if [ ! -e "$out/lib/python3.8/site-packages/lldb/_lldb.so" ] ; then + if [ ! -e "$lib/${python3.sitePackages}/lldb/_lldb.so" ] ; then return 1; fi ''; postInstall = '' + wrapProgram $out/bin/lldb --prefix PYTHONPATH : $lib/${python3.sitePackages}/ + # Editor support # vscode: install -D ../tools/lldb-vscode/package.json $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/package.json diff --git a/pkgs/development/compilers/llvm/13/lldb/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/13/lldb/gnu-install-dirs.patch index 0435784a247..afc945ce261 100644 --- a/pkgs/development/compilers/llvm/13/lldb/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/13/lldb/gnu-install-dirs.patch @@ -75,4 +75,17 @@ index 752113b..010f187 100644 +set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) if(WIN32 OR CYGWIN) # DLL platform -- put DLLs into bin. - set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) \ No newline at end of file + set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b5633e2..86e4738 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -79,7 +79,7 @@ if (LLDB_ENABLE_PYTHON) + if(LLDB_BUILD_FRAMEWORK) + set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb") + else() +- set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") ++ set(lldb_python_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}/lldb") + endif() + get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR) + finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}")