From: Jerome Benoit Date: Sat, 10 Feb 2024 21:40:27 +0000 (+0000) Subject: upstream: fix: multiarch: file-conflict X-Git-Tag: archive/raspbian/0.10.9+ds-2+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ba7a473075b7338e8f04b35548e1bb79baa1240f;p=igraph.git upstream: fix: multiarch: file-conflict Origin: debian Forwarded: https://github.com/igraph/igraph/pull/2372 Last-Update: 2023-07-15 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. Gbp-Pq: Name upstream-fix-multiarch-file_conflict.patch --- diff --git a/etc/cmake/pkgconfig_helpers.cmake b/etc/cmake/pkgconfig_helpers.cmake index d0d9ecb..a410a61 100644 --- a/etc/cmake/pkgconfig_helpers.cmake +++ b/etc/cmake/pkgconfig_helpers.cmake @@ -68,6 +68,11 @@ endif() 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 diff --git a/igraph.pc.in b/igraph.pc.in index f869537..2edd6de 100644 --- a/igraph.pc.in +++ b/igraph.pc.in @@ -10,4 +10,4 @@ URL: @PROJECT_HOMEPAGE_URL@ Libs: -L${libdir} -ligraph Libs.private: @PKGCONFIG_LIBS_PRIVATE@ Requires.private: @PKGCONFIG_REQUIRES_PRIVATE@ -Cflags: -I${includedir}/igraph +Cflags: @PKGCONFIG_CFLAGS_ONLY_I@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd7d6da..9491b83 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -425,6 +425,11 @@ use_all_warnings(igraph) # 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) @@ -468,7 +473,7 @@ install( ) install( DIRECTORY ${PROJECT_BINARY_DIR}/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/igraph + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR_ARCHITECTURE}/igraph FILES_MATCHING PATTERN "*.h" ) install(