File: fix-install-paths.patch

package info (click to toggle)
libmygpo-qt 1.0.9-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 676 kB
  • ctags: 724
  • sloc: cpp: 4,532; makefile: 16
file content (81 lines) | stat: -rw-r--r-- 3,879 bytes parent folder | download
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
71
72
73
74
75
76
77
78
79
80
81
Description: fix installation paths
 Use GNUInstallDirs in CMake configuration to use the proper library
 and include directories in multiarch systems.
Author: Jérémy Bobbio <lunar@debian.org>

Index: git/CMakeLists.txt
===================================================================
--- git.orig/CMakeLists.txt
+++ git/CMakeLists.txt
@@ -95,11 +95,9 @@ set( CPACK_PACKAGE_VERSION "${MYGPO_QT_V
 set( CPACK_DEBIAN_PACKAGE_MAINTAINER "gpodder@freelists.org" )
 set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "A c++/qt library to access the APIs provided by gpodder.net." )
 
-set(LIB_SUFFIX "" CACHE STRING "The directories where to install libraries to")
-set(LIB_INSTALL_DIR lib${LIB_SUFFIX} )
-set(LIB_DIR_PKGCONF "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
-set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/mygpo-qt${MYGPO_QT_VERSION_SUFFIX}" CACHE PATH "The directory the headers are installed in")
-set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/mygpo-qt )
+include(GNUInstallDirs)
+set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/mygpo-qt${MYGPO_QT_VERSION_SUFFIX}" CACHE PATH "The directory the headers are installed in")
+set(CMAKECONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/mygpo-qt )
 
 if( APPLE )
     set( CPACK_GENERATOR "DragNDrop" )
@@ -135,7 +133,7 @@ IF (NOT WIN32)
         CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/libmygpo-qt.pc.in
                             ${CMAKE_CURRENT_BINARY_DIR}/libmygpo-qt${MYGPO_QT_VERSION_SUFFIX}.pc
                             @ONLY)
-         INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/libmygpo-qt${MYGPO_QT_VERSION_SUFFIX}.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+         INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/libmygpo-qt${MYGPO_QT_VERSION_SUFFIX}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
     ENDIF (PKG_CONFIG_FOUND)
 ENDIF (NOT WIN32)
 
Index: git/cmake/modules/FindQJSON.cmake
===================================================================
--- git.orig/cmake/modules/FindQJSON.cmake
+++ git/cmake/modules/FindQJSON.cmake
@@ -14,6 +14,7 @@ if (QJSON_INCLUDE_DIR AND QJSON_LIBRARIE
 else (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)
 
   if (NOT WIN32)
+    include (GNUInstallDirs)
     # use pkg-config to get the values of QJSON_INCLUDE_DIRS
     # and QJSON_LIBRARY_DIRS to add as hints to the find commands.
     include (FindPkgConfig)
@@ -25,7 +26,7 @@ else (QJSON_INCLUDE_DIR AND QJSON_LIBRAR
     qjson
     PATHS
     ${QJSON_LIBRARY_DIRS}
-    ${LIB_INSTALL_DIR}
+    ${CMAKE_INSTALL_LIBDIR}
     ${KDE4_LIB_DIR}
   )
 
Index: git/src/CMakeLists.txt
===================================================================
--- git.orig/src/CMakeLists.txt
+++ git/src/CMakeLists.txt
@@ -83,6 +83,6 @@ target_link_libraries( ${MYGPO_QT_TARGET
 set_target_properties( ${MYGPO_QT_TARGET_NAME} PROPERTIES VERSION ${MYGPO_QT_VERSION} SOVERSION ${MYGPO_QT_SONAME} DEFINE_SYMBOL MYGPO_MAKEDLL)
 qt5_use_modules( ${MYGPO_QT_TARGET_NAME} Core Network )
 
-install( TARGETS ${MYGPO_QT_TARGET_NAME} EXPORT ${MYGPO_QT_TARGET_NAME}Export DESTINATION ${LIB_INSTALL_DIR} )
+install( TARGETS ${MYGPO_QT_TARGET_NAME} EXPORT ${MYGPO_QT_TARGET_NAME}Export DESTINATION ${CMAKE_INSTALL_LIBDIR} )
 
-install( FILES ${LIBMYGPO_QT_INSTALL_H} DESTINATION  ${INCLUDE_INSTALL_DIR} COMPONENT Devel )
+install( FILES ${LIBMYGPO_QT_INSTALL_H} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mygpo-qt COMPONENT Devel )
Index: git/libmygpo-qt.pc.in
===================================================================
--- git.orig/libmygpo-qt.pc.in
+++ git/libmygpo-qt.pc.in
@@ -1,7 +1,7 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=${prefix}
-libdir=@LIB_DIR_PKGCONF@
-includedir=@INCLUDE_INSTALL_DIR@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@INCLUDE_INSTALL_DIR@
 
 Name: libmygpo-qt@MYGPO_QT_VERSION_SUFFIX@
 Description: libmygpo-qt is a C++/Qt Library that wraps the gpodder.net WebAPI