File: upstream-fix-multiarch-file_conflict.patch

package info (click to toggle)
igraph 1.0.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 22,428 kB
  • sloc: ansic: 155,735; cpp: 32,500; xml: 2,951; python: 411; makefile: 164; javascript: 20; sh: 9
file content (70 lines) | stat: -rw-r--r-- 2,417 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Description: upstream: fix: multiarch: file-conflict
 This patch installs architecture/built specific C headers
 in a per-architecture location to avoid conflict on multiarch
 systems. It is meant to be submitted to the upstream maintainer.
Origin: debian
Forwarded: https://github.com/igraph/igraph/pull/2372
Author: Jerome Benoit <calculus@rezozer.net>
Author: Szabolcs Horvat <szhorvat@gmail.com>
Last-Update: 2024-07-15

--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -378,6 +378,14 @@
   "$<$<BOOL:${PLFIT_INCLUDE_DIRS}>:${PLFIT_INCLUDE_DIRS}>"
 )
 
+if(CMAKE_LIBRARY_ARCHITECTURE)
+  target_include_directories(
+    igraph
+    PUBLIC
+    $<INSTALL_INTERFACE:include/${CMAKE_LIBRARY_ARCHITECTURE}/igraph>
+  )
+endif()
+
 if(MATH_LIBRARY)
   target_link_libraries(igraph PUBLIC ${MATH_LIBRARY})
 endif()
@@ -434,6 +442,11 @@
 # GNUInstallDirs be included before generating the pkgconfig file, as it defines
 # CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR variables.
 include(GNUInstallDirs)
+if(CMAKE_LIBRARY_ARCHITECTURE)
+  set(CMAKE_INSTALL_INCLUDEDIR_ARCHITECTURE "${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LIBRARY_ARCHITECTURE}")
+else()
+  set(CMAKE_INSTALL_INCLUDEDIR_ARCHITECTURE "${CMAKE_INSTALL_INCLUDEDIR}")
+endif()
 
 # Generate pkgconfig file
 include(pkgconfig_helpers)
@@ -477,7 +490,7 @@
 )
 install(
   DIRECTORY ${PROJECT_BINARY_DIR}/include/
-  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igraph
+  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR_ARCHITECTURE}/igraph
   FILES_MATCHING PATTERN "*.h"
 )
 install(
--- a/etc/cmake/pkgconfig_helpers.cmake
+++ b/etc/cmake/pkgconfig_helpers.cmake
@@ -68,6 +68,11 @@
 
 join_paths(PKGCONFIG_LIBDIR "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
 join_paths(PKGCONFIG_INCLUDEDIR "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
+join_paths(PKGCONFIG_CFLAGS_ONLY_I "-I\${includedir}" "igraph")
+if(CMAKE_LIBRARY_ARCHITECTURE)
+  join_paths(PKGCONFIG_CFLAGS_ONLY_I_ARCH "-I\${includedir}" "${CMAKE_LIBRARY_ARCHITECTURE}" "igraph")
+  set(PKGCONFIG_CFLAGS_ONLY_I "${PKGCONFIG_CFLAGS_ONLY_I_ARCH} ${PKGCONFIG_CFLAGS_ONLY_I}")
+endif()
 configure_file(
   ${PROJECT_SOURCE_DIR}/igraph.pc.in
   ${PROJECT_BINARY_DIR}/igraph.pc
--- a/igraph.pc.in
+++ b/igraph.pc.in
@@ -10,4 +10,4 @@
 Libs: -L${libdir} -ligraph
 Libs.private: @PKGCONFIG_LIBS_PRIVATE@
 Requires.private: @PKGCONFIG_REQUIRES_PRIVATE@
-Cflags: -I${includedir}/igraph
+Cflags: @PKGCONFIG_CFLAGS_ONLY_I@