Skip to content

Commit

Permalink
Merge pull request #275936 from wegank/lldb-14-patch-revert
Browse files Browse the repository at this point in the history
lldb_14: fix broken bindings again
  • Loading branch information
wegank authored Jan 3, 2024
2 parents 43a55ee + 6afc8c2 commit d42bc1b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 57 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ in (llvmPackages.lldb.overrideAttrs (oldAttrs: rec {
inherit llvmSrc;
};

patches = oldAttrs.patches ++ [
# backport of https://github.com/NixOS/nixpkgs/commit/0d3002334850a819d1a5c8283c39f114af907cd4
# remove when https://github.com/NixOS/nixpkgs/issues/166604 fixed
./fix-python-installation.patch
];

doInstallCheck = true;

# installCheck for lldb_14 currently broken
Expand Down
58 changes: 20 additions & 38 deletions pkgs/development/compilers/llvm/14/lldb/gnu-install-dirs.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79d451965ed4..78188978d6de 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH
# If we are not building as part of LLVM, build LLDB as a standalone project,
# using LLVM as an external library.
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ include(GNUInstallDirs)
+
project(lldb)
set(LLDB_BUILT_STANDALONE TRUE)
endif()
@@ -108,7 +110,7 @@ if (LLDB_ENABLE_PYTHON)
diff --git a/bindings/lua/CMakeLists.txt b/bindings/lua/CMakeLists.txt
index 1a739a980..59f8fc3a0 100644
--- a/bindings/lua/CMakeLists.txt
+++ b/bindings/lua/CMakeLists.txt
@@ -56,7 +56,7 @@ function(finish_swig_lua swig_target lldb_lua_bindings_dir lldb_lua_target_dir)
if(LLDB_BUILD_FRAMEWORK)
set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb")
set(LLDB_LUA_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Resources/Python)
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")
- set(LLDB_LUA_INSTALL_PATH ${LLDB_LUA_RELATIVE_PATH})
+ set(LLDB_LUA_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/../${LLDB_LUA_RELATIVE_PATH})
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}")
@@ -118,7 +120,7 @@ if (LLDB_ENABLE_LUA)
install(DIRECTORY ${lldb_lua_target_dir}/
DESTINATION ${LLDB_LUA_INSTALL_PATH}
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index c631faf52ac3..1d92d069960b 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -160,7 +160,7 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
if(LLDB_BUILD_FRAMEWORK)
set(lldb_lua_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Lua")
set(LLDB_PYTHON_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources/Python)
else()
- set(lldb_lua_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_LUA_RELATIVE_PATH}")
+ set(lldb_lua_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_LUA_RELATIVE_PATH}")
- set(LLDB_PYTHON_INSTALL_PATH ${LLDB_PYTHON_RELATIVE_PATH})
+ set(LLDB_PYTHON_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH})
endif()
get_target_property(lldb_lua_bindings_dir swig_wrapper_lua BINARY_DIR)
finish_swig_lua("lldb-lua" "${lldb_lua_bindings_dir}" "${lldb_lua_target_dir}")
if (NOT CMAKE_CFG_INTDIR STREQUAL ".")
string(REPLACE ${CMAKE_CFG_INTDIR} "\$\{CMAKE_INSTALL_CONFIG_NAME\}" LLDB_PYTHON_INSTALL_PATH ${LLDB_PYTHON_INSTALL_PATH})
diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake
index 3291a7c808e1..b27d27ce6a87 100644
--- a/cmake/modules/AddLLDB.cmake
Expand All @@ -52,16 +47,3 @@ index 7d48491ec89a..c04543585588 100644
install(TARGETS lldbIntelFeatures
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX})
diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake
index 7d48491ec89a..c04543585588 100644
--- a/cmake/modules/LLDBStandalone.cmake
+++ b/cmake/modules/LLDBStandalone.cmake
@@ -70,7 +70,7 @@ endif()

# They are used as destination of target generators.
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
-set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
+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})

0 comments on commit d42bc1b

Please sign in to comment.