summaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
committerRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
commit4bc5fbef9d159e143fb7e2c3231932e6e76f667c (patch)
treee2198f5c552e0667d838b8ec764ddb3a4d8f6dec /pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch
parentjq: fix build with structured-attrs on darwin (diff)
parentMerge pull request #123802 from superherointj/package-virtmanager-bugfix (diff)
downloadnixpkgs-origin/structured-attrs.tar.gz
Merge remote-tracking branch 'upstream/master' into structured-attrsorigin/structured-attrs
Diffstat (limited to 'pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch')
-rw-r--r--pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch
new file mode 100644
index 000000000000..acc2d3d47760
--- /dev/null
+++ b/pkgs/development/compilers/llvm/8/lld/gnu-install-dirs.patch
@@ -0,0 +1,68 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e2fbdbfbbb47..d601b231ebb8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,6 +6,8 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ set(LLD_BUILT_STANDALONE TRUE)
+
++ include(GNUInstallDirs)
++
+ find_program(LLVM_CONFIG_PATH "llvm-config" DOC "Path to llvm-config binary")
+ if(NOT LLVM_CONFIG_PATH)
+ message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH")
+@@ -203,7 +205,7 @@ include_directories(BEFORE
+
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ install(DIRECTORY include/
+- DESTINATION include
++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ FILES_MATCHING
+ PATTERN "*.h"
+ PATTERN ".svn" EXCLUDE
+diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
+index fa48b428d26b..e7967aad3ceb 100644
+--- a/cmake/modules/AddLLD.cmake
++++ b/cmake/modules/AddLLD.cmake
+@@ -20,9 +20,9 @@ macro(add_lld_library name)
+ install(TARGETS ${name}
+ COMPONENT ${name}
+ ${export_to_lldtargets}
+- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+- RUNTIME DESTINATION bin)
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
+ add_llvm_install_targets(install-${name}
+@@ -54,7 +54,7 @@ macro(add_lld_tool name)
+
+ install(TARGETS ${name}
+ ${export_to_lldtargets}
+- RUNTIME DESTINATION bin
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ COMPONENT ${name})
+
+ if(NOT CMAKE_CONFIGURATION_TYPES)
+@@ -69,5 +69,5 @@ endmacro()
+ macro(add_lld_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()
+diff --git a/tools/lld/CMakeLists.txt b/tools/lld/CMakeLists.txt
+index d8829493fc22..df748a0e749b 100644
+--- a/tools/lld/CMakeLists.txt
++++ b/tools/lld/CMakeLists.txt
+@@ -16,7 +16,7 @@ target_link_libraries(lld
+ )
+
+ install(TARGETS lld
+- RUNTIME DESTINATION bin)
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ if(NOT LLD_SYMLINKS_TO_CREATE)
+ set(LLD_SYMLINKS_TO_CREATE lld-link ld.lld ld64.lld wasm-ld)