Skip to content

Commit 5310ca8

Browse files
authored
[gpgme] Update 2.0.0, add separate gpgmepp port (#47299)
1 parent 25d20d6 commit 5310ca8

File tree

10 files changed

+194
-29
lines changed

10 files changed

+194
-29
lines changed

ports/gpgme/portfile.cmake

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
vcpkg_download_distfile(tarball
2-
URLS
3-
"https://gnupg.org/ftp/gcrypt/gpgme/gpgme-${VERSION}.tar.bz2"
4-
"https://mirrors.dotsrc.org/gcrypt/gpgme/gpgme-${VERSION}.tar.bz2"
5-
"https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gpgme/gpgme-${VERSION}.tar.bz2"
2+
URLS "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gpgme/gpgme-${VERSION}.tar.bz2"
3+
"https://gnupg.org/ftp/gcrypt/gpgme/gpgme-${VERSION}.tar.bz2"
64
FILENAME "gpgme-${VERSION}.tar.bz2"
7-
SHA512 3b5fc22a2f83576058ac14e744333f46df362b39f742d6c9e54a5a66828194a1312f5f365bdc15683e148821f5d591fa92a2daad83fc116f65dccf14e817ca48
5+
SHA512 ee58dc2a4273c740d5b9ef13cc655d5e600ddddd137fb85a781c31e8854829283b4ce241d7810a963d9a125d603213600f37e7d0c1ce3b3cf1b935e62cf60777
86
)
97
vcpkg_extract_source_archive(
108
SOURCE_PATH
@@ -13,37 +11,28 @@ vcpkg_extract_source_archive(
1311
disable-docs.patch
1412
)
1513

16-
vcpkg_list(SET LANGUAGES)
17-
if("cpp" IN_LIST FEATURES)
18-
vcpkg_list(APPEND LANGUAGES "cpp")
19-
endif()
20-
21-
vcpkg_configure_make(
22-
AUTOCONFIG
14+
vcpkg_make_configure(
2315
SOURCE_PATH "${SOURCE_PATH}"
16+
AUTORECONF
2417
OPTIONS
2518
--disable-gpgconf-test
2619
--disable-gpg-test
2720
--disable-gpgsm-test
2821
--disable-g13-test
29-
--enable-languages=${LANGUAGES}
3022
GPG_ERROR_CONFIG=/ # fake absolute path; gpgrt-config is used instead
3123
OPTIONS_RELEASE
3224
"GPGRT_CONFIG=${CURRENT_INSTALLED_DIR}/tools/libgpg-error/bin/gpgrt-config"
3325
OPTIONS_DEBUG
3426
"GPGRT_CONFIG=${CURRENT_INSTALLED_DIR}/tools/libgpg-error/debug/bin/gpgrt-config"
3527
)
3628

37-
vcpkg_install_make()
29+
vcpkg_make_install()
3830
vcpkg_copy_pdbs()
3931

4032
# This port doesn't support the windows-only glib integration.
4133
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gpgme-glib.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gpgme-glib.pc")
4234
vcpkg_fixup_pkgconfig()
4335

44-
# CMake config needs work for linkage and build type.
45-
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake" "${CURRENT_PACKAGES_DIR}/debug/lib/cmake")
46-
4736
set(install_prefix "${CURRENT_INSTALLED_DIR}")
4837
if(VCPKG_HOST_IS_WINDOWS)
4938
string(REGEX REPLACE "^([a-zA-Z]):/" "/\\1/" install_prefix "${install_prefix}")
@@ -58,7 +47,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
5847
vcpkg_install_copyright(COMMENT [[
5948
The library is distributed under the terms of the GNU Lesser General Public License (LGPL).
6049
The helper programs are distributed under the terms of the GNU General Public License (GPL).
61-
There are additonal notices about contributions that require these additional notices are distributed.
50+
There are additional notices about contributions that require these additional notices are distributed.
6251
]]
6352
FILE_LIST
6453
"${SOURCE_PATH}/COPYING.LESSER"

ports/gpgme/vcpkg.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
{
22
"name": "gpgme",
3-
"version": "1.24.3",
3+
"version": "2.0.0",
44
"description": "A library designed to make access to GnuPG easier for applications",
55
"homepage": "https://gnupg.org/software/gpgme/",
66
"license": null,
77
"supports": "!windows | mingw",
88
"dependencies": [
99
"libassuan",
10-
"libgpg-error"
11-
],
12-
"default-features": [
13-
"cpp"
14-
],
15-
"features": {
16-
"cpp": {
17-
"description": "C++ bindings"
10+
"libgpg-error",
11+
{
12+
"name": "vcpkg-make",
13+
"host": true
1814
}
19-
}
15+
]
2016
}

ports/gpgmepp/cmake-config.diff

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2+
index c121025..1f0554f 100644
3+
--- a/src/CMakeLists.txt
4+
+++ b/src/CMakeLists.txt
5+
@@ -194,14 +194,14 @@ configure_package_config_file(GpgmeppConfig.cmake.in
6+
)
7+
8+
if(ENABLE_SHARED)
9+
- if (MSVC)
10+
+ if (0)
11+
install(TARGETS Gpgmepp EXPORT GpgmeppTargets "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
12+
else()
13+
install(TARGETS Gpgmepp EXPORT GpgmeppTargets)
14+
endif()
15+
endif()
16+
if(ENABLE_STATIC)
17+
- install(TARGETS GpgmeppStatic)
18+
+ install(TARGETS GpgmeppStatic EXPORT GpgmeppTargets)
19+
endif()
20+
21+
set(pkgconfig_host_line "")
22+
@@ -224,7 +224,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gpgmepp_version.h
23+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gpgme++)
24+
25+
# for now we install the cmake config files only for the shared library
26+
-if(ENABLE_SHARED)
27+
+if(1)
28+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/GpgmeppConfigVersion.cmake
29+
${CMAKE_CURRENT_BINARY_DIR}/GpgmeppConfig.cmake
30+
DESTINATION ${CMAKECONFIG_INSTALL_DIR})

ports/gpgmepp/dependencies.diff

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 33a55c7..ed169aa 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -62,10 +62,8 @@ include(ECMUninstallTarget)
6+
include(FeatureSummary)
7+
include(GNUInstallDirs)
8+
9+
-find_package(LibGpgError ${GPG_ERROR_REQUIRED_VERSION})
10+
-set_package_properties(LibGpgError PROPERTIES TYPE REQUIRED)
11+
-find_package(Gpgme ${GPGME_REQUIRED_VERSION})
12+
-set_package_properties(Gpgme PROPERTIES TYPE REQUIRED)
13+
+find_package(PkgConfig REQUIRED)
14+
+pkg_check_modules(Gpgme "gpgme>=${GPGME_REQUIRED_VERSION}" "gpg-error>=${GPG_ERROR_REQUIRED_VERSION}" REQUIRED)
15+
16+
g10_get_full_version()
17+
18+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
19+
index d28ed8f..989a011 100644
20+
--- a/src/CMakeLists.txt
21+
+++ b/src/CMakeLists.txt
22+
@@ -126,11 +126,11 @@ if(ENABLE_SHARED)
23+
target_sources(Gpgmepp PRIVATE ${Gpgmepp_SOURCES})
24+
25+
target_include_directories(Gpgmepp
26+
- PRIVATE ${LibGpgError_INCLUDE_DIRS}
27+
+ PRIVATE ${Gpgme_INCLUDE_DIRS}
28+
INTERFACE $<INSTALL_INTERFACE:include>
29+
)
30+
31+
- target_link_libraries(Gpgmepp Gpgme::Gpgme)
32+
+ target_link_libraries(Gpgmepp PRIVATE ${Gpgme_LINK_LIBRARIES})
33+
34+
set_target_properties(Gpgmepp PROPERTIES
35+
OUTPUT_NAME gpgmepp
36+
@@ -142,11 +142,11 @@ if(ENABLE_STATIC)
37+
target_sources(GpgmeppStatic PRIVATE ${Gpgmepp_SOURCES})
38+
39+
target_include_directories(GpgmeppStatic
40+
- PRIVATE ${LibGpgError_INCLUDE_DIRS}
41+
+ PRIVATE ${Gpgme_INCLUDE_DIRS}
42+
INTERFACE $<INSTALL_INTERFACE:include>
43+
)
44+
45+
- target_link_libraries(GpgmeppStatic Gpgme::Gpgme)
46+
+ target_link_libraries(GpgmeppStatic PRIVATE ${Gpgme_LINK_LIBRARIES})
47+
48+
set_target_properties(GpgmeppStatic PROPERTIES
49+
OUTPUT_NAME gpgmepp
50+
diff --git a/src/GpgmeppConfig.cmake.in b/src/GpgmeppConfig.cmake.in
51+
index 8969602..4d5fedd 100644
52+
--- a/src/GpgmeppConfig.cmake.in
53+
+++ b/src/GpgmeppConfig.cmake.in
54+
@@ -20,9 +20,5 @@
55+
56+
@PACKAGE_INIT@
57+
58+
-include(CMakeFindDependencyMacro)
59+
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
60+
-find_dependency(LibGpgError "@GPG_ERROR_REQUIRED_VERSION@")
61+
-find_dependency(Gpgme "@GPGME_REQUIRED_VERSION@")
62+
63+
include("${CMAKE_CURRENT_LIST_DIR}/GpgmeppTargets.cmake")

ports/gpgmepp/disable-docs.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/Makefile.am b/Makefile.am
2+
index 1772d69..9bf9863 100644
3+
--- a/Makefile.am
4+
+++ b/Makefile.am
5+
@@ -45,7 +45,7 @@ else
6+
tests =
7+
endif
8+
9+
-SUBDIRS = src ${tests} doc lang
10+
+SUBDIRS = src ${tests} lang
11+
12+
# Fix the version of the spec file.
13+
dist-hook: gen-ChangeLog

ports/gpgmepp/portfile.cmake

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
vcpkg_download_distfile(tarball
2+
URLS "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gpgmepp/gpgmepp-${VERSION}.tar.xz"
3+
"https://gnupg.org/ftp/gcrypt/gpgme/gpgmepp-${VERSION}.tar.xz"
4+
FILENAME "gpgmepp-${VERSION}.tar.xz"
5+
SHA512 ed98f5dfd45efa216d0fc983ad650b46235b28a8e4faaf4349bc8e14cf76758e3099cfdc61e549f07e57d663e82550f373641f67303c5f2891b00fa5b419e927
6+
)
7+
vcpkg_extract_source_archive(
8+
SOURCE_PATH
9+
ARCHIVE "${tarball}"
10+
PATCHES
11+
cmake-config.diff
12+
dependencies.diff
13+
)
14+
file(WRITE "${SOURCE_PATH}/VERSION" "${VERSION}")
15+
16+
vcpkg_find_acquire_program(PKGCONFIG)
17+
set(ENV{PKG_CONFIG} "${PKGCONFIG}")
18+
19+
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED)
20+
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
21+
22+
vcpkg_cmake_configure(
23+
SOURCE_PATH "${SOURCE_PATH}"
24+
OPTIONS
25+
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
26+
-DENABLE_SHARED=${ENABLE_SHARED}
27+
-DENABLE_STATIC=${ENABLE_STATIC}
28+
)
29+
vcpkg_cmake_install()
30+
vcpkg_copy_pdbs()
31+
vcpkg_fixup_pkgconfig()
32+
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/Gpgmepp")
33+
34+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
35+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
36+
37+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.LIB")

ports/gpgmepp/vcpkg.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "gpgmepp",
3+
"version": "2.0.0",
4+
"description": "A C++ binding for gpgme",
5+
"homepage": "https://gnupg.org/software/gpgme/",
6+
"license": "LGPL-2.0-or-later",
7+
"dependencies": [
8+
"gpgme",
9+
"libgpg-error",
10+
{
11+
"name": "vcpkg-cmake",
12+
"host": true
13+
},
14+
{
15+
"name": "vcpkg-cmake-config",
16+
"host": true
17+
}
18+
]
19+
}

versions/baseline.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3401,7 +3401,11 @@
34013401
"port-version": 0
34023402
},
34033403
"gpgme": {
3404-
"baseline": "1.24.3",
3404+
"baseline": "2.0.0",
3405+
"port-version": 0
3406+
},
3407+
"gpgmepp": {
3408+
"baseline": "2.0.0",
34053409
"port-version": 0
34063410
},
34073411
"gpgmm": {

versions/g-/gpgme.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "32b19979f8ee8d0288885786718f0c8e8c5d3969",
5+
"version": "2.0.0",
6+
"port-version": 0
7+
},
38
{
49
"git-tree": "383136db526f4875a32ca65e1605e2e0b08426ad",
510
"version": "1.24.3",

versions/g-/gpgmepp.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"versions": [
3+
{
4+
"git-tree": "b900118dfc9a93bb85a3ae93667a01eff64e4c4c",
5+
"version": "2.0.0",
6+
"port-version": 0
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)