trojita: strip gpgmepp dependencies

- Add upstream patch for vanilla gpgme
- Add upstream fix for conflict command with recent gnupg
This commit is contained in:
Chaoting Liu 2017-09-07 10:32:53 +01:00
parent a7ba0220d9
commit 55d7f313c0
3 changed files with 145 additions and 7 deletions

View File

@ -1,27 +1,34 @@
pkgname=trojita
pkgver=0.7
pkgrel=1
pkgrel=2
pkgdesc="Trojita is a Qt IMAP e-mail client."
arch=('x86_64')
url="http://trojita.flaska.net"
license=('GPL')
depends=('qt5-webkit' 'qt5-tools' 'qt5-translations' 'qt5-svg' 'qtkeychain-qt5' 'zlib'
'ragel' 'libdbus' 'gpgmepp' 'mimetic' 'boost')
makedepends=('cmake')
depends=('qt5-webkit' 'qt5-translations' 'qt5-svg' 'qtkeychain-qt5' 'zlib'
'ragel' 'libdbus' 'gpgme' 'mimetic' 'boost')
makedepends=('cmake' 'qt5-tools')
categories=('network')
screenshot=('http://trojita.flaska.net/trojita-2013-01-09--overview.png')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.xz")
sha256sums=('e08da881721cafa00ecd772eaef6b99fd37d068cb703eeb532de0ed1ea0136d9')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.xz"
'support-gpgme.patch'
'fix-gpg-test.patch')
sha256sums=('e08da881721cafa00ecd772eaef6b99fd37d068cb703eeb532de0ed1ea0136d9'
'9f99bd2d91cd3b345e2bf52c0d9929ea81147f6578b774c5d2b4f2e86aade2a8'
'4b949ab021633241df91576eb99091380e1f70a99e713d4322a62c6c4f231226')
prepare() {
cd "$srcdir/$pkgname-$pkgver"
patch -Np1 -i ../support-gpgme.patch
patch -Np1 -i ../fix-gpg-test.patch
mkdir -p build
}
build() {
cd "$srcdir/$pkgname-$pkgver/build"
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr ..
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_TESTING=OFF ..
make
}

View File

@ -0,0 +1,32 @@
From be8fd5831afa0a04f14cd6206e6576f03ee59558 Mon Sep 17 00:00:00 2001
From: Amaury Pouly <amaury.pouly@gmail.com>
Date: Sat, 17 Sep 2016 16:40:46 +0100
Subject: Fix GPG test
At least GnuPG, when run with both --fingerprint and --with-colons will output
the fingerprint of the public key and the subkey. The command below will thus
output two fingerprints and the delete command will fail because it cannot
find the second fingerprint (which is a subkey and not a public key). It seems
that a safe approach is to consider only the first fingerprint line.
Change-Id: I4c6aa79e4473bca146aa087728a5652d91586a81
---
tests/Cryptography/keygen.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Cryptography/keygen.sh b/tests/Cryptography/keygen.sh
index c94c0ab..98c69ca 100755
--- a/tests/Cryptography/keygen.sh
+++ b/tests/Cryptography/keygen.sh
@@ -115,7 +115,7 @@ $TAIL" > crypto_test_data.h
echo -n "key *\nexpire\nseconds=1\nsave\n" | ${GPG} --no-tty --quiet --command-fd 0 --edit-key "expired@test.trojita.flaska.net"
# extract fingerprint of key to be deleted
-FINGERPRINT="$(${GPG} --quiet --no-tty --list-keys --with-colons --fingerprint unknown@test.trojita.flaska.net | grep fpr | cut -d : -f 10)"
+FINGERPRINT="$(${GPG} --quiet --no-tty --list-keys --with-colons --fingerprint unknown@test.trojita.flaska.net | grep fpr | head -n 1 | cut -d : -f 10)"
# delete key
yes | DISPLAY="" ${GPG} --quiet --batch --no-tty --delete-secret-and-public-key --yes --command-fd 0 --passphrase-fd 0 "${FINGERPRINT}"
--
cgit v0.11.2

View File

@ -0,0 +1,99 @@
From e8393376969caf27b0c976d01645edd023c14df2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jkt@kde.org>
Date: Sat, 17 Dec 2016 13:26:56 +0100
Subject: Support both vanilla gpgme and KDE Frameworks gpgmepp
KF5Gpgmepp has been merged into GPGME (since 1.7.0) and will not see
any further releases with KDE Applications. We still care about older
distros (and that means older gpgme, and therefore a need for extra
bindings).
Stuff is a bit more complicated because 1.7.x is not thread-safe by
default. Given that gpgme upstream start making their releases pretty
often this fall, it seems safe to go with 1.8.0.
Change-Id: Ia2f05bd8ed2a894435ca328a886325366ba41622
Inspired-By: Heiko Becker <heirecka@exherbo.org>
Inspired-By: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Fixed-By: Caspar Schutijser <caspar@schutijser.com>
---
CMakeLists.txt | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e129c1..3346142 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,8 @@ trojita_option(WITH_ZLIB "Build with zlib library" AUTO)
trojita_option(WITH_SHARED_PLUGINS "Enable shared dynamic plugins" ON)
trojita_option(BUILD_TESTING "Build tests" ON)
trojita_option(WITH_MIMETIC "Build with client-side MIME parsing" AUTO)
-trojita_option(WITH_GPGMEPP "Build with the GpgME++ library for cryptography" AUTO)
+trojita_option(WITH_GPGMEPP "Use GpgME's native C++ bindings" AUTO)
+trojita_option(WITH_KF5_GPGMEPP "Use legacy discontinued GpgME++ library from KDE frameworks" AUTO)
if(WIN32)
trojita_option(WITH_NSIS "Build Windows NSIS installer" AUTO "WITH_DESKTOP")
@@ -84,8 +85,13 @@ trojita_plugin_option(WITH_QTKEYCHAIN_PLUGIN "Build Qtkeychain password plugin"
trojita_find_package(Git "" "" "" "")
trojita_find_package(Mimetic "" "http://www.codesink.org/mimetic_mime_library.html" "C++ MIME Library" "Required for client-side MIME parsing" WITH_MIMETIC)
-trojita_find_package(KF5Gpgmepp "" "https://quickgit.kde.org/?p=gpgmepp.git" "C++ bindings for gpgme" "Needed for encrypted/signed e-mails" WITH_GPGMEPP)
-trojita_option(WITH_CRYPTO_MESSAGES "Enable support for encrypted messages" AUTO "WITH_MIMETIC;WITH_GPGMEPP")
+trojita_find_package(Gpgmepp "1.8.0" "https://gnupg.org/related_software/gpgme/index.html" "C++/Qt bindings for gpgme" "Needed for encrypted/signed e-mails" WITH_GPGMEPP)
+if(NOT WITH_GPGMEPP)
+ trojita_find_package(KF5Gpgmepp "" "https://commits.kde.org/gpgmepp?path=/" "C++ bindings for gpgme" "Needed for encrypted/signed e-mails" WITH_KF5_GPGMEPP)
+ trojita_option(WITH_CRYPTO_MESSAGES "Enable support for encrypted messages" AUTO "WITH_MIMETIC;WITH_KF5_GPGMEPP")
+else()
+ trojita_option(WITH_CRYPTO_MESSAGES "Enable support for encrypted messages" AUTO "WITH_MIMETIC;WITH_GPGMEPP")
+endif()
if(WIN32)
trojita_find_package(MakeNSIS "" "http://nsis.sourceforge.net" "Nullsoft Scriptable Install System" "Needed for building Windows installer" WITH_NSIS)
@@ -197,7 +203,7 @@ else()
set(TROJITA_HAVE_MIMETIC False)
endif()
-if(WITH_GPGMEPP)
+if(WITH_GPGMEPP OR WITH_KF5_GPGMEPP)
set(TROJITA_HAVE_GPGMEPP True)
else()
set(TROJITA_HAVE_GPGMEPP False)
@@ -315,12 +321,10 @@ if(WITH_MIMETIC)
)
endif()
if(WITH_CRYPTO_MESSAGES)
- if(WITH_GPGMEPP)
set(libCryptography_SOURCES
${libCryptography_SOURCES}
${path_Cryptography}/GpgMe++.cpp
)
- endif()
endif()
if(WITH_ZLIB)
@@ -614,13 +618,15 @@ if(WITH_MIMETIC)
set_property(TARGET Cryptography APPEND PROPERTY INCLUDE_DIRECTORIES ${MIMETIC_INCLUDE_DIRS})
endif()
if(WITH_CRYPTO_MESSAGES)
- if(WITH_GPGMEPP)
- if (WIN32)
- target_link_libraries(Cryptography KF5::Gpgmepp KF5::QGpgme)
- else()
- target_link_libraries(Cryptography KF5::Gpgmepp-pthread KF5::QGpgme)
+ if(WITH_GPGMEPP)
+ target_link_libraries(Cryptography Gpgmepp QGpgme)
+ elseif(WITH_KF5_GPGMEPP)
+ if(WIN32)
+ target_link_libraries(Cryptography KF5::Gpgmepp KF5::QGpgme)
+ else()
+ target_link_libraries(Cryptography KF5::Gpgmepp-pthread KF5::QGpgme)
+ endif()
endif()
- endif()
endif()
## ClearText password plugin
--
cgit v0.11.2