void-packages/srcpkgs/aqbanking/patches/cmake-prefix.patch
Helmut Pozimski b5d8fcd306 aqbanking: fix cross, change prefix detection for the cmake config file
The cmake configuration file for aqbankung always uses /usr as prefix
which causes issues while cross-compiling. This adds a patch to change
the detection to do it the same way most KDE/QT software does it.

Closes: #10663 [via git-merge-pr]
2018-01-12 13:51:43 +01:00

23 lines
983 B
Diff

--- aqbanking-config.cmake.in 2018-01-10 16:09:39.079835643 +0100
+++ aqbanking-config.cmake.in 2018-01-10 16:11:18.140403253 +0100
@@ -19,7 +19,18 @@
include(CMakeFindDependencyMacro)
find_dependency(gwenhywfar "@GWENHYWFAR_MINIMUM_VERSION@")
-set_and_check(prefix "@prefix@")
+get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
+
+# Use original install prefix when loaded through a "/usr move"
+# cross-prefix symbolic link such as /lib -> /usr/lib.
+get_filename_component(_realCurr "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+get_filename_component(_realOrig "@prefix@/lib/cmake/aqbanking-@AQBANKING_VERSION_MAJOR@.@AQBANKING_VERSION_MINOR@" REALPATH)
+if(_realCurr STREQUAL _realOrig)
+ set(prefix "/usr")
+endif()
+unset(_realOrig)
+unset(_realCurr)
+
set_and_check(exec_prefix "@exec_prefix@")
set_and_check(AQBANKING_INCLUDE_DIRS "@includedir@/aqbanking@AQBANKING_VERSION_MAJOR@")
set_and_check(AQBANKING_LIBRARIES "@libdir@/libaqbanking.so")