You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trojita-packaging/debian/patches/vanilla-gpgme-support.patch

77 lines
3.3 KiB

Description: Support both vanilla gpgme and KDE Frameworks gpgmepp.
Author: Jan Kundrát <jkt@kde.org>
Origin: upstream https://cgit.kde.org/trojita.git/commit/?id=e8393376969caf27b0c976d01645edd023c14df2
Last-Update: 2018-09-26
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,7 +61,8 @@ trojita_option(WITH_ZLIB "Build with zli
trojita_option(WITH_SHARED_PLUGINS "Enable shared dynamic plugins" ON)
trojita_option(WITH_TESTS "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")
@@ -94,8 +95,13 @@ trojita_plugin_option(WITH_QTKEYCHAIN_PL
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)
@@ -207,7 +213,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)
@@ -321,12 +327,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)
@@ -625,13 +629,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