From 2defdad9a7f6bb7baa60bbe05823b1557533bb3d Mon Sep 17 00:00:00 2001 From: yopito Date: Sun, 14 May 2017 12:40:15 +0200 Subject: [PATCH] gpgme: add cross-build support and Qt support --- common/shlibs | 1 + .../patches/cmake-crossbuild-support.patch | 98 +++++++++++++++++++ srcpkgs/gpgme/template | 28 +++++- srcpkgs/gpgmeqt | 1 + srcpkgs/gpgmeqt-devel | 1 + 5 files changed, 126 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/gpgme/patches/cmake-crossbuild-support.patch create mode 120000 srcpkgs/gpgmeqt create mode 120000 srcpkgs/gpgmeqt-devel diff --git a/common/shlibs b/common/shlibs index 38fadc7759e..cb258ad47fe 100644 --- a/common/shlibs +++ b/common/shlibs @@ -647,6 +647,7 @@ libassuan.so.0 libassuan-2.0.1_1 libgpgme.so.11 gpgme-1.3.0_1 libgpgme-pthread.so.11 gpgme-1.3.0_1 libgpgmepp.so.6 gpgmepp-1.7.0_3 +libqgpgme.so.7 gpgmeqt-1.7.0_3 libgarcon-1.so.0 garcon-0.1.12_1 libgarcon-gtk2-1.so.0 garcon-0.4.0_1 libxfce4ui-1.so.0 libxfce4ui-4.9.2_1 diff --git a/srcpkgs/gpgme/patches/cmake-crossbuild-support.patch b/srcpkgs/gpgme/patches/cmake-crossbuild-support.patch new file mode 100644 index 00000000000..915fe13c167 --- /dev/null +++ b/srcpkgs/gpgme/patches/cmake-crossbuild-support.patch @@ -0,0 +1,98 @@ +Cross-building needs that include and library paths to be computed +at this package's build time and not at runtime usage of this cmake support. + +Code inspired from cmake files of KDE Framework 5 various subparts. + +--- lang/cpp/src/GpgmeppConfig.cmake.in.in.ORIG ++++ lang/cpp/src/GpgmeppConfig.cmake.in.in +@@ -58,19 +58,41 @@ + 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/Gpgmepp" REALPATH) ++if(_realCurr STREQUAL _realOrig) ++ set(_IMPORT_PREFIX "/usr/lib/cmake/Gpgmepp") ++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 Gpgmepp + add_library(Gpgmepp SHARED IMPORTED) + + set_target_properties(Gpgmepp PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/gpgme++;@resolved_includedir@" +- INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@;@LIBASSUAN_LIBS@" +- IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@" ++ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/gpgme++" ++ INTERFACE_LINK_LIBRARIES "pthread;${_IMPORT_PREFIX}/lib/libgpgme@libsuffix@;@LIBASSUAN_LIBS@" ++ IMPORTED_LOCATION "${_IMPORT_PREFIX}/lib/libgpgmepp@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}} ) +--- lang/qt/src/QGpgmeConfig.cmake.in.in.ORIG ++++ lang/qt/src/QGpgmeConfig.cmake.in.in +@@ -58,19 +58,41 @@ + 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 QGpgme + add_library(QGpgme SHARED IMPORTED) + + set_target_properties(QGpgme PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@" ++ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/qgpgme" + INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt5::Core" +- IMPORTED_LOCATION "@resolved_libdir@/libqgpgme@libsuffix@" ++ IMPORTED_LOCATION "${_IMPORT_PREFIX}/libqgpgme@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 8be7eeb84f6..057668f77e4 100644 --- a/srcpkgs/gpgme/template +++ b/srcpkgs/gpgme/template @@ -1,13 +1,14 @@ # Template file for 'gpgme' pkgname=gpgme version=1.7.1 -revision=2 +revision=3 build_style=gnu-configure configure_args="--enable-fd-passing --disable-gpgconf-test --disable-gpg-test --disable-gpgsm-test --with-libgpg-error-prefix=$XBPS_CROSS_BASE/usr --with-libassuan-prefix=$XBPS_CROSS_BASE/usr" -makedepends="libgpg-error-devel libassuan-devel" +hostmakedepends="qt5-qmake pkg-config qt5-host-tools" +makedepends="libgpg-error-devel libassuan-devel qt5-tools-devel" depends="gnupg2" short_desc="GnuPG Made Easy" maintainer="Juan RP " @@ -25,7 +26,7 @@ case "$XBPS_TARGET_MACHINE" in esac gpgme-devel_package() { - depends="${makedepends} gpgme>=${version}_${revision}" + depends="${makedepends/qt5-tools-devel/} gpgme>=${version}_${revision}" short_desc+=" - development files" pkg_install() { vmove usr/bin/gpgme-config @@ -55,3 +56,24 @@ gpgmepp-devel_package() { vmove usr/lib/cmake/Gpgmepp/GpgmeppConfigVersion.cmake } } + +gpgmeqt_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - Qt binding" + pkg_install() { + vmove usr/lib/libqgpgme.so.* + } +} + +gpgmeqt-devel_package() { + depends="gpgme-devel>=${version}_${revision} gpgmeqt>=${version}_${revision}" + short_desc+=" - Qt binding development files" + pkg_install() { + vmove usr/include/qgpgme_version.h + vmove usr/include/QGpgME + vmove usr/include/qgpgme + vmove usr/lib/libqgpgme.so + vmove usr/lib/cmake/Gpgmepp/QGpgmeConfig.cmake + vmove usr/lib/cmake/Gpgmepp/QGpgmeConfigVersion.cmake + } +} diff --git a/srcpkgs/gpgmeqt b/srcpkgs/gpgmeqt new file mode 120000 index 00000000000..b291e753127 --- /dev/null +++ b/srcpkgs/gpgmeqt @@ -0,0 +1 @@ +gpgme \ No newline at end of file diff --git a/srcpkgs/gpgmeqt-devel b/srcpkgs/gpgmeqt-devel new file mode 120000 index 00000000000..b291e753127 --- /dev/null +++ b/srcpkgs/gpgmeqt-devel @@ -0,0 +1 @@ +gpgme \ No newline at end of file