void-packages/srcpkgs/polkit-qt5/patches/0001-An-overcomplicated-sol...

297 lines
14 KiB
Diff
Raw Normal View History

2021-06-19 15:36:06 +02:00
From 4a3d7709baec95f1d6334fc8198977ff89fc5a35 Mon Sep 17 00:00:00 2001
From: John Zimmermann <me@johnnynator.dev>
Date: Sat, 19 Jun 2021 15:47:56 +0200
Subject: [PATCH] An overcomplicated solution to get find_package working
properly there used to be some absulte paths somewhere that broke the
creation of the SmthTargets.cmake.
---
CMakeLists.txt | 27 +++++++++++----------------
PolkitQt-1Config.cmake.in | 4 ++--
agent/CMakeLists.txt | 6 +++---
core/CMakeLists.txt | 6 +++---
gui/CMakeLists.txt | 6 +++---
polkit-qt-1.pc.cmake | 4 ++--
polkit-qt-agent-1.pc.cmake | 4 ++--
polkit-qt-core-1.pc.cmake | 4 ++--
polkit-qt-gui-1.pc.cmake | 4 ++--
polkit-qt5-1.pc.cmake | 4 ++--
polkit-qt5-agent-1.pc.cmake | 4 ++--
polkit-qt5-core-1.pc.cmake | 4 ++--
polkit-qt5-gui-1.pc.cmake | 4 ++--
13 files changed, 38 insertions(+), 43 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32eb737..a82f8cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,11 +21,6 @@ include(GNUInstallDirs)
include(FeatureSummary)
-# Set the different paths
-set(LIB_DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Library directory name")
-set(INCLUDE_DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}" CACHE PATH "The subdirectory to the header prefix")
-
-
set(REQUIRED_QT_VERSION 5.5.0)
set(CMAKE_CXX_STANDARD 11)
@@ -103,7 +98,7 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/agent/polkitqt1-agent-export.h
DESTINATION
- ${INCLUDE_DESTINATION}/${POLKITQT-1_INCLUDE_PATH} COMPONENT Devel)
+ ${CMAKE_INSTALL_INCLUDEDIR}/${POLKITQT-1_INCLUDE_PATH} COMPONENT Devel)
install(FILES
includes/PolkitQt1/Authority
@@ -113,40 +108,40 @@ install(FILES
includes/PolkitQt1/TemporaryAuthorization
includes/PolkitQt1/ActionDescription
DESTINATION
- ${INCLUDE_DESTINATION}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1 COMPONENT Devel)
+ ${CMAKE_INSTALL_INCLUDEDIR}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1 COMPONENT Devel)
install(FILES
includes/PolkitQt1/Gui/Action
includes/PolkitQt1/Gui/ActionButton
includes/PolkitQt1/Gui/ActionButtons
DESTINATION
- ${INCLUDE_DESTINATION}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1/Gui COMPONENT Devel)
+ ${CMAKE_INSTALL_INCLUDEDIR}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1/Gui COMPONENT Devel)
install(FILES
includes/PolkitQt1/Agent/Listener
includes/PolkitQt1/Agent/Session
DESTINATION
- ${INCLUDE_DESTINATION}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1/Agent COMPONENT Devel)
+ ${CMAKE_INSTALL_INCLUDEDIR}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1/Agent COMPONENT Devel)
if(NOT WIN32)
# Pkgconfig
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${POLKITQT-1_PCNAME}.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_PCNAME}.pc @ONLY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_PCNAME}.pc DESTINATION ${LIB_DESTINATION}/pkgconfig )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_PCNAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${POLKITQT-1_CORE_PCNAME}.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_CORE_PCNAME}.pc
@ONLY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_CORE_PCNAME}.pc DESTINATION ${LIB_DESTINATION}/pkgconfig )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_CORE_PCNAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${POLKITQT-1_GUI_PCNAME}.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_GUI_PCNAME}.pc @ONLY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_GUI_PCNAME}.pc DESTINATION ${LIB_DESTINATION}/pkgconfig )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_GUI_PCNAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${POLKITQT-1_AGENT_PCNAME}.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_AGENT_PCNAME}.pc
@ONLY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_AGENT_PCNAME}.pc DESTINATION ${LIB_DESTINATION}/pkgconfig )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_AGENT_PCNAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
endif(NOT WIN32)
if(USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR)
- set(_PolkitQt-1Config_INSTALL_DIR ${LIB_DESTINATION}/cmake/${POLKITQT-1_CAMEL_NAME})
+ set(_PolkitQt-1Config_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${POLKITQT-1_CAMEL_NAME})
else(USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR)
- set(_PolkitQt-1Config_INSTALL_DIR ${LIB_DESTINATION}/${POLKITQT-1_CAMEL_NAME}/cmake)
+ set(_PolkitQt-1Config_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/${POLKITQT-1_CAMEL_NAME}/cmake)
endif(USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR)
@@ -154,7 +149,7 @@ endif(USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR)
configure_package_config_file(PolkitQt-1Config.cmake.in
${CMAKE_BINARY_DIR}/${POLKITQT-1_CAMEL_NAME}Config.cmake
INSTALL_DESTINATION ${_PolkitQt-1Config_INSTALL_DIR}
- PATH_VARS LIB_DESTINATION INCLUDE_DESTINATION
+ PATH_VARS CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR
)
write_basic_package_version_file(${CMAKE_BINARY_DIR}/${POLKITQT-1_CAMEL_NAME}ConfigVersion.cmake
diff --git a/PolkitQt-1Config.cmake.in b/PolkitQt-1Config.cmake.in
index f39480c..e09678c 100644
--- a/PolkitQt-1Config.cmake.in
+++ b/PolkitQt-1Config.cmake.in
@@ -20,9 +20,9 @@ if(NOT POLKITQT-1_INSTALL_DIR)
set(POLKITQT-1_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@")
endif(NOT POLKITQT-1_INSTALL_DIR)
-set_and_check(POLKITQT-1_INCLUDE_DIR "@PACKAGE_INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@")
+set_and_check(POLKITQT-1_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@")
set_and_check(POLKITQT-1_INCLUDE_DIRS "${POLKITQT-1_INCLUDE_DIR}")
-set_and_check(POLKITQT-1_LIB_DIR "@PACKAGE_LIB_DESTINATION@")
+set_and_check(POLKITQT-1_LIB_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
set(POLKITQT-1_POLICY_FILES_INSTALL_DIR "${POLKITQT-1_INSTALL_DIR}/share/polkit-1/actions")
##################################
diff --git a/agent/CMakeLists.txt b/agent/CMakeLists.txt
index ccf2711..1a86cd8 100644
--- a/agent/CMakeLists.txt
+++ b/agent/CMakeLists.txt
@@ -29,11 +29,11 @@ set_target_properties(${POLKITQT-1_AGENT_PCNAME} PROPERTIES VERSION ${POLKITQT-1
target_include_directories(${POLKITQT-1_AGENT_PCNAME}
INTERFACE
- $<INSTALL_INTERFACE:${INCLUDE_DESTINATION}/${POLKITQT-1_INCLUDE_PATH}>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${POLKITQT-1_INCLUDE_PATH}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
-install(TARGETS ${POLKITQT-1_AGENT_PCNAME} EXPORT ${POLKITQT-1_CAMEL_NAME}Export ARCHIVE DESTINATION ${LIB_DESTINATION}
- LIBRARY DESTINATION ${LIB_DESTINATION}
+install(TARGETS ${POLKITQT-1_AGENT_PCNAME} EXPORT ${POLKITQT-1_CAMEL_NAME}Export ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION bin)
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 3a80adc..8225871 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -32,12 +32,12 @@ set_target_properties(${POLKITQT-1_CORE_PCNAME} PROPERTIES VERSION ${POLKITQT-1_
target_include_directories(${POLKITQT-1_CORE_PCNAME}
INTERFACE
- $<INSTALL_INTERFACE:${INCLUDE_DESTINATION}/${POLKITQT-1_INCLUDE_PATH}>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${POLKITQT-1_INCLUDE_PATH}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
-install(TARGETS ${POLKITQT-1_CORE_PCNAME} EXPORT ${POLKITQT-1_CAMEL_NAME}Export ARCHIVE DESTINATION ${LIB_DESTINATION}
- LIBRARY DESTINATION ${LIB_DESTINATION}
+install(TARGETS ${POLKITQT-1_CORE_PCNAME} EXPORT ${POLKITQT-1_CAMEL_NAME}Export ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION bin)
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index d9d800d..c22deba 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -28,11 +28,11 @@ set_target_properties(${POLKITQT-1_GUI_PCNAME} PROPERTIES VERSION ${POLKITQT-1_L
target_include_directories(${POLKITQT-1_GUI_PCNAME}
INTERFACE
- $<INSTALL_INTERFACE:${INCLUDE_DESTINATION}/${POLKITQT-1_INCLUDE_PATH}>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${POLKITQT-1_INCLUDE_PATH}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
-install(TARGETS ${POLKITQT-1_GUI_PCNAME} EXPORT ${POLKITQT-1_CAMEL_NAME}Export ARCHIVE DESTINATION ${LIB_DESTINATION}
- LIBRARY DESTINATION ${LIB_DESTINATION}
+install(TARGETS ${POLKITQT-1_GUI_PCNAME} EXPORT ${POLKITQT-1_CAMEL_NAME}Export ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION bin)
diff --git a/polkit-qt-1.pc.cmake b/polkit-qt-1.pc.cmake
index 7cc55a9..ba8e46e 100644
--- a/polkit-qt-1.pc.cmake
+++ b/polkit-qt-1.pc.cmake
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_DESTINATION@
-includedir=@INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@
Name: @POLKITQT-1_PCNAME@
Description: Convenience library for using polkit with a Qt-styled API
diff --git a/polkit-qt-agent-1.pc.cmake b/polkit-qt-agent-1.pc.cmake
index 001925d..23b2cae 100644
--- a/polkit-qt-agent-1.pc.cmake
+++ b/polkit-qt-agent-1.pc.cmake
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_DESTINATION@
-includedir=@INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@
Name: @POLKITQT-1_AGENT_PCNAME@
Description: Convenience library for using polkit Agent with a Qt-styled API
diff --git a/polkit-qt-core-1.pc.cmake b/polkit-qt-core-1.pc.cmake
index ca435a6..fa501f0 100644
--- a/polkit-qt-core-1.pc.cmake
+++ b/polkit-qt-core-1.pc.cmake
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_DESTINATION@
-includedir=@INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@
Name: @POLKITQT-1_CORE_PCNAME@
Description: Convenience library for using polkit with a Qt-styled API, non-GUI classes
diff --git a/polkit-qt-gui-1.pc.cmake b/polkit-qt-gui-1.pc.cmake
index e7279d1..7261b0c 100644
--- a/polkit-qt-gui-1.pc.cmake
+++ b/polkit-qt-gui-1.pc.cmake
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_DESTINATION@
-includedir=@INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@
Name: @POLKITQT-1_GUI_PCNAME@
Description: Convenience library for using polkit with a Qt-styled API, GUI classes
diff --git a/polkit-qt5-1.pc.cmake b/polkit-qt5-1.pc.cmake
index 7cc55a9..ba8e46e 100644
--- a/polkit-qt5-1.pc.cmake
+++ b/polkit-qt5-1.pc.cmake
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_DESTINATION@
-includedir=@INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@
Name: @POLKITQT-1_PCNAME@
Description: Convenience library for using polkit with a Qt-styled API
diff --git a/polkit-qt5-agent-1.pc.cmake b/polkit-qt5-agent-1.pc.cmake
index fabc0db..709a24e 100644
--- a/polkit-qt5-agent-1.pc.cmake
+++ b/polkit-qt5-agent-1.pc.cmake
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_DESTINATION@
-includedir=@INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@
Name: @POLKITQT-1_AGENT_PCNAME@
Description: Convenience library for using polkit Agent with a Qt-styled API
diff --git a/polkit-qt5-core-1.pc.cmake b/polkit-qt5-core-1.pc.cmake
index 33687c2..588f267 100644
--- a/polkit-qt5-core-1.pc.cmake
+++ b/polkit-qt5-core-1.pc.cmake
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_DESTINATION@
-includedir=@INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@
Name: @POLKITQT-1_CORE_PCNAME@
Description: Convenience library for using polkit with a Qt-styled API, non-GUI classes
diff --git a/polkit-qt5-gui-1.pc.cmake b/polkit-qt5-gui-1.pc.cmake
index 4280226..1c012dd 100644
--- a/polkit-qt5-gui-1.pc.cmake
+++ b/polkit-qt5-gui-1.pc.cmake
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_DESTINATION@
-includedir=@INCLUDE_DESTINATION@/@POLKITQT-1_INCLUDE_PATH@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/@POLKITQT-1_INCLUDE_PATH@
Name: @POLKITQT-1_GUI_PCNAME@
Description: Convenience library for using polkit with a Qt-styled API, GUI classes
--
2.32.0