From cc72fc29e5126234ae5682faf3af366de5075541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 15 May 2024 18:10:18 +0700 Subject: [PATCH] gpgme: fix cross config for gpgme-qt6 --- .../patches/cmake-crossbuild-support.patch | 49 +++++++++++++++++-- srcpkgs/gpgme/template | 2 +- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/srcpkgs/gpgme/patches/cmake-crossbuild-support.patch b/srcpkgs/gpgme/patches/cmake-crossbuild-support.patch index 328a13e5b64..a3ed8a25ea1 100644 --- a/srcpkgs/gpgme/patches/cmake-crossbuild-support.patch +++ b/srcpkgs/gpgme/patches/cmake-crossbuild-support.patch @@ -1,5 +1,3 @@ -diff --git lang/cpp/src/GpgmeppConfig.cmake.in.in lang/cpp/src/GpgmeppConfig.cmake.in.in -index 73f5eaad..019de555 100644 --- a/lang/cpp/src/GpgmeppConfig.cmake.in.in +++ b/lang/cpp/src/GpgmeppConfig.cmake.in.in @@ -58,19 +58,41 @@ unset(_targetsDefined) @@ -47,8 +45,6 @@ index 73f5eaad..019de555 100644 # Loop over all imported files and verify that they actually exist foreach(target ${_IMPORT_CHECK_TARGETS} ) foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) -diff --git lang/qt/src/QGpgmeConfig.cmake.in.in lang/qt/src/QGpgmeConfig.cmake.in.in -index a17a19fd..29a6b87a 100644 --- a/lang/qt/src/QGpgmeConfig.cmake.in.in +++ b/lang/qt/src/QGpgmeConfig.cmake.in.in @@ -58,19 +58,41 @@ unset(_targetsDefined) @@ -95,3 +91,48 @@ index a17a19fd..29a6b87a 100644 # Loop over all imported files and verify that they actually exist foreach(target ${_IMPORT_CHECK_TARGETS} ) foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) +--- a/lang/qt/src/QGpgmeQt6Config.cmake.in.in ++++ b/lang/qt/src/QGpgmeQt6Config.cmake.in.in +@@ -58,19 +58,40 @@ unset(_targetsDefined) + unset(_targetsNotDefined) + unset(_expectedTargets) + ++# Compute the installation prefix relative to this file. ++get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) ++# Use original install prefix when loaded through a ++# cross-prefix symbolic link such as /lib -> /usr/lib. ++get_filename_component(_realCurr "${_IMPORT_PREFIX}" REALPATH) ++get_filename_component(_realOrig "/usr/lib/cmake/QGpgme" REALPATH) ++if(_realCurr STREQUAL _realOrig) ++ set(_IMPORT_PREFIX "/usr/lib/cmake/QGpgme") ++endif() ++unset(_realOrig) ++unset(_realCurr) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++if(_IMPORT_PREFIX STREQUAL "/") ++ set(_IMPORT_PREFIX "") ++endif() ++ + # Create imported target QGpgmeQt6 + add_library(QGpgmeQt6 SHARED IMPORTED) + + set_target_properties(QGpgmeQt6 PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@" ++ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/qgpgme" + INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt6::Core" +- IMPORTED_LOCATION "@resolved_libdir@/libqgpgmeqt6@libsuffix@" ++ IMPORTED_LOCATION "${_IMPORT_PREFIX}/lib/libqgpgmeqt6@libsuffix@" + ) + + if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.") + endif() + ++# Cleanup temporary variables. ++set(_IMPORT_PREFIX) ++ + # Loop over all imported files and verify that they actually exist + foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) diff --git a/srcpkgs/gpgme/template b/srcpkgs/gpgme/template index b4ca16d5145..18c4c839c7f 100644 --- a/srcpkgs/gpgme/template +++ b/srcpkgs/gpgme/template @@ -1,7 +1,7 @@ # Template file for 'gpgme' pkgname=gpgme version=1.23.2 -revision=2 +revision=3 build_style=gnu-configure build_helper="python3" configure_args="--enable-fd-passing