Merge pull request #275936 from wegank/lldb-14-patch-revert

lldb_14: fix broken bindings again

authored by Weijia Wang and committed by GitHub d42bc1ba 43a55ee1

+20 -57
-13
pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/fix-python-installation.patch
··· 1 - diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt 2 - index 82a52da89a7e..5127dc1d8f41 100644 3 - --- a/bindings/python/CMakeLists.txt 4 - +++ b/bindings/python/CMakeLists.txt 5 - @@ -160,7 +160,7 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar 6 - if(LLDB_BUILD_FRAMEWORK) 7 - set(LLDB_PYTHON_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources/Python) 8 - else() 9 - - set(LLDB_PYTHON_INSTALL_PATH ${LLDB_PYTHON_RELATIVE_PATH}) 10 - + set(LLDB_PYTHON_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}) 11 - endif() 12 - if (NOT CMAKE_CFG_INTDIR STREQUAL ".") 13 - string(REPLACE ${CMAKE_CFG_INTDIR} "\$\{CMAKE_INSTALL_CONFIG_NAME\}" LLDB_PYTHON_INSTALL_PATH ${LLDB_PYTHON_INSTALL_PATH})
-6
pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/lldb.nix
··· 13 13 inherit llvmSrc; 14 14 }; 15 15 16 - patches = oldAttrs.patches ++ [ 17 - # backport of https://github.com/NixOS/nixpkgs/commit/0d3002334850a819d1a5c8283c39f114af907cd4 18 - # remove when https://github.com/NixOS/nixpkgs/issues/166604 fixed 19 - ./fix-python-installation.patch 20 - ]; 21 - 22 16 doInstallCheck = true; 23 17 24 18 # installCheck for lldb_14 currently broken
+20 -38
pkgs/development/compilers/llvm/14/lldb/gnu-install-dirs.patch
··· 1 - diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index 79d451965ed4..78188978d6de 100644 3 - --- a/CMakeLists.txt 4 - +++ b/CMakeLists.txt 5 - @@ -10,6 +10,8 @@ set(CMAKE_MODULE_PATH 6 - # If we are not building as part of LLVM, build LLDB as a standalone project, 7 - # using LLVM as an external library. 8 - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) 9 - + include(GNUInstallDirs) 10 - + 11 - project(lldb) 12 - set(LLDB_BUILT_STANDALONE TRUE) 13 - endif() 14 - @@ -108,7 +110,7 @@ if (LLDB_ENABLE_PYTHON) 1 + diff --git a/bindings/lua/CMakeLists.txt b/bindings/lua/CMakeLists.txt 2 + index 1a739a980..59f8fc3a0 100644 3 + --- a/bindings/lua/CMakeLists.txt 4 + +++ b/bindings/lua/CMakeLists.txt 5 + @@ -56,7 +56,7 @@ function(finish_swig_lua swig_target lldb_lua_bindings_dir lldb_lua_target_dir) 15 6 if(LLDB_BUILD_FRAMEWORK) 16 - set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb") 7 + set(LLDB_LUA_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Resources/Python) 17 8 else() 18 - - set(lldb_python_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_PYTHON_RELATIVE_PATH}/lldb") 19 - + set(lldb_python_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}/lldb") 9 + - set(LLDB_LUA_INSTALL_PATH ${LLDB_LUA_RELATIVE_PATH}) 10 + + set(LLDB_LUA_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/../${LLDB_LUA_RELATIVE_PATH}) 20 11 endif() 21 - get_target_property(lldb_python_bindings_dir swig_wrapper_python BINARY_DIR) 22 - finish_swig_python("lldb-python" "${lldb_python_bindings_dir}" "${lldb_python_target_dir}") 23 - @@ -118,7 +120,7 @@ if (LLDB_ENABLE_LUA) 12 + install(DIRECTORY ${lldb_lua_target_dir}/ 13 + DESTINATION ${LLDB_LUA_INSTALL_PATH} 14 + diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt 15 + index c631faf52ac3..1d92d069960b 100644 16 + --- a/bindings/python/CMakeLists.txt 17 + +++ b/bindings/python/CMakeLists.txt 18 + @@ -160,7 +160,7 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar 24 19 if(LLDB_BUILD_FRAMEWORK) 25 - set(lldb_lua_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Lua") 20 + set(LLDB_PYTHON_INSTALL_PATH ${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/${LLDB_FRAMEWORK_VERSION}/Resources/Python) 26 21 else() 27 - - set(lldb_lua_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_LUA_RELATIVE_PATH}") 28 - + set(lldb_lua_target_dir "${CMAKE_INSTALL_LIBDIR}/../${LLDB_LUA_RELATIVE_PATH}") 22 + - set(LLDB_PYTHON_INSTALL_PATH ${LLDB_PYTHON_RELATIVE_PATH}) 23 + + set(LLDB_PYTHON_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/../${LLDB_PYTHON_RELATIVE_PATH}) 29 24 endif() 30 - get_target_property(lldb_lua_bindings_dir swig_wrapper_lua BINARY_DIR) 31 - finish_swig_lua("lldb-lua" "${lldb_lua_bindings_dir}" "${lldb_lua_target_dir}") 25 + if (NOT CMAKE_CFG_INTDIR STREQUAL ".") 26 + string(REPLACE ${CMAKE_CFG_INTDIR} "\$\{CMAKE_INSTALL_CONFIG_NAME\}" LLDB_PYTHON_INSTALL_PATH ${LLDB_PYTHON_INSTALL_PATH}) 32 27 diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake 33 28 index 3291a7c808e1..b27d27ce6a87 100644 34 29 --- a/cmake/modules/AddLLDB.cmake ··· 52 47 install(TARGETS lldbIntelFeatures 53 48 - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) 54 49 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 55 - diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake 56 - index 7d48491ec89a..c04543585588 100644 57 - --- a/cmake/modules/LLDBStandalone.cmake 58 - +++ b/cmake/modules/LLDBStandalone.cmake 59 - @@ -70,7 +70,7 @@ endif() 60 - 61 - # They are used as destination of target generators. 62 - set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) 63 - -set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) 64 - +set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}) 65 - if(WIN32 OR CYGWIN) 66 - # DLL platform -- put DLLs into bin. 67 - set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})