void-packages/srcpkgs/gwenhywfar/patches/cmake-prefix.patch

92 lines
3.6 KiB
Diff
Raw Normal View History

--- gwenhywfar-config.cmake.in 2018-01-10 14:46:29.110367258 +0100
+++ gwenhywfar-config.cmake.in 2018-01-10 15:00:33.544490115 +0100
@@ -19,7 +19,18 @@
endforeach()
endmacro()
-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/gwenhywfar-@GWENHYWFAR_VERSION_MAJOR@.@GWENHYWFAR_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(includedir "@includedir@")
set_and_check(GWENHYWFAR_INCLUDE_DIRS "@gwenhywfar_headerdir@")
--- gui/qt4/gwengui-qt4-config.cmake.in 2018-01-10 16:45:24.121341582 +0100
+++ gui/qt4/gwengui-qt4-config.cmake.in 2018-01-10 16:48:25.082803122 +0100
@@ -40,7 +40,18 @@
return()
endif()
-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/gwengui-qt4-@GWENHYWFAR_VERSION_MAJOR@.@GWENHYWFAR_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(includedir "@includedir@")
set_and_check(${CMAKE_FIND_PACKAGE_NAME}_INCLUDE_DIRS "@gwenhywfar_headerdir@")
--- gui/cpp/gwengui-cpp-config.cmake.in 2018-01-10 16:45:30.860247916 +0100
+++ gui/cpp/gwengui-cpp-config.cmake.in 2018-01-10 16:47:54.086241064 +0100
@@ -21,7 +21,18 @@
include(CMakeFindDependencyMacro)
find_dependency(gwenhywfar "@GWENHYWFAR_VERSION_STRING@")
-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/gwengui-cpp-@GWENHYWFAR_VERSION_MAJOR@.@GWENHYWFAR_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(includedir "@includedir@")
set_and_check(GWENGUI_CPP_INCLUDE_DIRS "@gwenhywfar_headerdir@")
--- gui/qt5/gwengui-qt5-config.cmake.in 2018-01-10 16:45:39.551127015 +0100
+++ gui/qt5/gwengui-qt5-config.cmake.in 2018-01-10 16:48:51.927422936 +0100
@@ -23,8 +23,18 @@
find_dependency(Qt5Core)
find_dependency(Qt5Widgets)
+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/gwengui-qt5-@GWENHYWFAR_VERSION_MAJOR@.@GWENHYWFAR_VERSION_MINOR@" REALPATH)
+if(_realCurr STREQUAL _realOrig)
+ set(prefix "/usr")
+endif()
+unset(_realOrig)
+unset(_realCurr)
-set_and_check(prefix "@prefix@")
set_and_check(exec_prefix "@exec_prefix@")
set_and_check(includedir "@includedir@")
set_and_check(${CMAKE_FIND_PACKAGE_NAME}_INCLUDE_DIRS "@gwenhywfar_headerdir@")