about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch')
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch b/nixpkgs/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch
new file mode 100644
index 000000000000..57c54e18c37b
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/llvm/14/clang/gnu-install-dirs.patch
@@ -0,0 +1,50 @@
+diff --git a/cmake/modules/AddClang.cmake b/cmake/modules/AddClang.cmake
+index 9bbbfc032b7d..947bd0da865d 100644
+--- a/cmake/modules/AddClang.cmake
++++ b/cmake/modules/AddClang.cmake
+@@ -119,8 +119,8 @@ macro(add_clang_library name)
+         install(TARGETS ${lib}
+           COMPONENT ${lib}
+           ${export_to_clangtargets}
+-          LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+-          ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
++          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
++          ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
+           RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+
+         if (NOT LLVM_ENABLE_IDE)
+@@ -175,7 +175,7 @@ endmacro()
+ macro(add_clang_symlink name dest)
+   add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
+   # Always generate install targets
+-  llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
++  llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE)
+ endmacro()
+
+ function(clang_target_link_libraries target type)
+diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
+index 078988980c52..14b58614b40a 100644
+--- a/lib/Headers/CMakeLists.txt
++++ b/lib/Headers/CMakeLists.txt
+@@ -234,7 +234,7 @@ set_target_properties(clang-resource-headers PROPERTIES
+   FOLDER "Misc"
+   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
+
+-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
++set(header_install_dir ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+
+ install(
+   FILES ${files} ${generated_files}
+diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt
+index 4e0647971ab4..68dd67fcc476 100644
+--- a/tools/libclang/CMakeLists.txt
++++ b/tools/libclang/CMakeLists.txt
+@@ -216,7 +216,7 @@ foreach(PythonVersion ${CLANG_PYTHON_BINDINGS_VERSIONS})
+           COMPONENT
+             libclang-python-bindings
+           DESTINATION
+-            "lib${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
++            "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/python${PythonVersion}/site-packages")
+ endforeach()
+ if(NOT LLVM_ENABLE_IDE)
+   add_custom_target(libclang-python-bindings)