gnu: python-babel: Update to 2.7.0.
[guix.git] / gnu / packages / patches / pugixml-versioned-libdir.patch
blob7cd23b1a712cf57916165370f2e80969036318ae
1 This patch makes pugixml install its headers to a standard location when
2 built as a shared library.
4 Taken from this upstream commit:
5 https://github.com/zeux/pugixml/commit/daeb8013b20f9c47e85730faaa4131064a1f9c2e
7 diff --git a/CMakeLists.txt b/CMakeLists.txt
8 index 90fa6793..d7bc1b20 100644
9 --- a/CMakeLists.txt
10 +++ b/CMakeLists.txt
11 @@ -4,7 +4,7 @@ project(pugixml)
13 option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF)
14 option(BUILD_TESTS "Build tests" OFF)
15 -option(BUILD_PKGCONFIG "Build in PKGCONFIG mode" OFF)
16 +option(USE_VERSIONED_LIBDIR "Use a private subdirectory to install the headers and libs" OFF)
18 set(BUILD_DEFINES "" CACHE STRING "Build defines")
20 @@ -55,7 +55,7 @@ endif()
21 set_target_properties(pugixml PROPERTIES VERSION 1.9 SOVERSION 1)
22 get_target_property(PUGIXML_VERSION_STRING pugixml VERSION)
24 -if(BUILD_PKGCONFIG)
25 +if(USE_VERSIONED_LIBDIR)
26 # Install library into its own directory under LIBDIR
27 set(INSTALL_SUFFIX /pugixml-${PUGIXML_VERSION_STRING})
28 endif()
29 @@ -71,10 +71,8 @@ install(TARGETS pugixml EXPORT pugixml-config
30 install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}${INSTALL_SUFFIX})
31 install(EXPORT pugixml-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pugixml)
33 -if(BUILD_PKGCONFIG)
34 - configure_file(scripts/pugixml.pc.in ${PROJECT_BINARY_DIR}/pugixml.pc @ONLY)
35 - install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
36 -endif()
37 +configure_file(scripts/pugixml.pc.in ${PROJECT_BINARY_DIR}/pugixml.pc @ONLY)
38 +install(FILES ${PROJECT_BINARY_DIR}/pugixml.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
40 if(BUILD_TESTS)
41 file(GLOB TEST_SOURCES tests/*.cpp)
42 diff --git a/scripts/pugixml.pc.in b/scripts/pugixml.pc.in
43 index 3c97c28d..804c4d38 100644
44 --- a/scripts/pugixml.pc.in
45 +++ b/scripts/pugixml.pc.in
46 @@ -1,11 +1,11 @@
47 prefix=@CMAKE_INSTALL_PREFIX@
48 exec_prefix=${prefix}
49 -includedir=${prefix}/include/pugixml-@PUGIXML_VERSION_STRING@
50 -libdir=${exec_prefix}/lib/pugixml-@PUGIXML_VERSION_STRING@
51 +includedir=${prefix}/include@INSTALL_SUFFIX@
52 +libdir=${exec_prefix}/lib@INSTALL_SUFFIX@
54 Name: pugixml
55 Description: Light-weight, simple and fast XML parser for C++ with XPath support.
56 URL: http://pugixml.org/
57 Version: @PUGIXML_VERSION_STRING@
58 Cflags: -I${includedir}
59 -Libs: -L${libdir} -lpugixml
60 \ No newline at end of file
61 +Libs: -L${libdir} -lpugixml