Skip to content

Commit

Permalink
[many ports] add GnuPG libraries (microsoft#13950)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrobelda authored and kw.ryu committed Dec 24, 2020
1 parent c712063 commit a7a3acd
Show file tree
Hide file tree
Showing 12 changed files with 227 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ports/gpgme/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Source: gpgme
Version: 1.14.0
Homepage: https://gnupg.org/software/gpgme/index.html
Description: A library designed to make access to GnuPG easier for applications
Build-Depends: libgpg-error, libassuan
Default-Features: cpp
Supports: !windows

Feature: cpp
Description: C++ bindings
13 changes: 13 additions & 0 deletions ports/gpgme/disable-docs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile.am b/Makefile.am
index 1772d69..9bf9863 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -45,7 +45,7 @@ else
tests =
endif

-SUBDIRS = src ${tests} doc lang
+SUBDIRS = src ${tests} lang

# Fix the version of the spec file.
dist-hook: gen-ChangeLog
51 changes: 51 additions & 0 deletions ports/gpgme/disable-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From b05747aea79083106b27ac7d829db3e65e192682 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dawid=20Wro=CC=81bel?= <me@dawidwrobel.com>
Date: Thu, 29 Oct 2020 13:23:56 -0400
Subject: [PATCH] cpp,python: Respect --disable-gpg-test for tests

* lang/cpp/Makefile.am: Respect --disable-gpg-test
* lang/python/Makefile.am: Respect --disable-gpg-test

This is similar to the qt that had it already enabled
---
lang/cpp/Makefile.am | 8 +++++++-
lang/python/Makefile.am | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/lang/cpp/Makefile.am b/lang/cpp/Makefile.am
index 724da6ca..70ca7462 100644
--- a/lang/cpp/Makefile.am
+++ b/lang/cpp/Makefile.am
@@ -18,6 +18,12 @@
# License along with this program; if not, see <https://gnu.org/licenses/>.
# SPDX-License-Identifier: LGPL-2.1-or-later

-SUBDIRS = src tests
+if RUN_GPG_TESTS
+tests = tests
+else
+tests =
+endif
+
+SUBDIRS = src ${tests}

EXTRA_DIST = README
diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
index 845b7b17..68b98e8e 100644
--- a/lang/python/Makefile.am
+++ b/lang/python/Makefile.am
@@ -23,7 +23,13 @@ EXTRA_DIST = \
gpgme.i \
helpers.c helpers.h private.h

-SUBDIRS = . tests examples doc src
+if RUN_GPG_TESTS
+tests = tests
+else
+tests =
+endif
+
+SUBDIRS = . ${tests} examples doc src

.PHONY: prepare
prepare: copystamp
35 changes: 35 additions & 0 deletions ports/gpgme/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports unix platform" ON_TARGET "Windows")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gpg/gpgme
REF gpgme-1.14.0
SHA512 b4608fd1d9a4122d8886917274e323afc9a30494c13a3dea51e17e9779f925bf8d67e584434d6a13018f274a6cbcf0a5e36f2fea794a065906bbb556b765398e
HEAD_REF master
PATCHES
disable-tests.patch
disable-docs.patch
)

list(REMOVE_ITEM FEATURES core)
string(REPLACE ";" "," LANGUAGES "${FEATURES}")

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
--disable-gpgconf-test
--disable-gpg-test
--disable-gpgsm-test
--disable-g13-test
--enable-languages=${LANGUAGES}
--with-libgpg-error-prefix=${CURRENT_INSTALLED_DIR}/tools/libgpg-error
--with-libassuan-prefix=${CURRENT_INSTALLED_DIR}/tools/libassuan
)

vcpkg_install_make()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Gpgmepp)
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
6 changes: 6 additions & 0 deletions ports/libassuan/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Source: libassuan
Version: 2.5.3
Homepage: https://gnupg.org/software/libassuan/index.html
Description: A library implementing the so-called Assuan protocol
Build-Depends: libgpg-error
Supports: !windows
11 changes: 11 additions & 0 deletions ports/libassuan/fix-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/src/libassuan.pc.in b/src/libassuan.pc.in
index 4e952d7..83ba872 100644
--- a/src/libassuan.pc.in
+++ b/src/libassuan.pc.in
@@ -10,5 +10,5 @@ Description: IPC library for the GnuPG components
Requires: gpg-error
Version: @PACKAGE_VERSION@
Cflags: @LIBASSUAN_CONFIG_CFLAGS@
-Libs: @LIBASSUAN_CONFIG_LIBS@
+Libs: -L${libdir} @LIBASSUAN_CONFIG_LIBS@
URL: https://www.gnupg.org/related_software/libassuan/index.html
27 changes: 27 additions & 0 deletions ports/libassuan/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports unix platform" ON_TARGET "Windows")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gpg/libassuan
REF libassuan-2.5.3
SHA512 5ec896eca6d9d7bec83aa400c8e2dc6f2b09c013050efb2125e2f2a4bd00f179723254483637ca4b7bc30bba951fc985e7ba7db98081606bb106caa7a2622dbe
HEAD_REF master
PATCHES
fix-pkgconfig.patch
)

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
--disable-doc
--disable-silent-rules
--with-libgpg-error-prefix=${CURRENT_INSTALLED_DIR}/tools/libgpg-error
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
6 changes: 6 additions & 0 deletions ports/libgcrypt/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Source: libgcrypt
Version: 1.8.6
Homepage: https://gnupg.org/software/libgcrypt/index.html
Description: A library implementing the so-called Assuan protocol
Build-Depends: libgpg-error
Supports: linux|osx
11 changes: 11 additions & 0 deletions ports/libgcrypt/fix-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/src/libgcrypt.pc.in b/src/libgcrypt.pc.in
index ec68fa2..6bf7a07 100644
--- a/src/libgcrypt.pc.in
+++ b/src/libgcrypt.pc.in
@@ -13,5 +13,5 @@ Description: General purpose cryptographic library
Requires: gpg-error
Version: @PACKAGE_VERSION@
Cflags: @LIBGCRYPT_CONFIG_CFLAGS@
-Libs: @LIBGCRYPT_CONFIG_LIBS@
+Libs: -L${libdir} @LIBGCRYPT_CONFIG_LIBS@
URL: https://www.gnupg.org/software/libgcrypt/index.html
27 changes: 27 additions & 0 deletions ports/libgcrypt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports unix platform" ON_TARGET "Windows")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gpg/libgcrypt
REF libgcrypt-1.8.6
SHA512 85005b159048b7b47b3fc77e8be5b5b317b1ae73ef536d4e2d78496763b7b8c4f80c70016ed27fc60e998cbc7642d3cf487bd4c5e5a5d8abc8f8d51e02f330d1
HEAD_REF master
PATCHES
fix-pkgconfig.patch
)

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
--disable-doc
--disable-silent-rules
--with-libgpg-error-prefix=${CURRENT_INSTALLED_DIR}/tools/libgpg-error
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
5 changes: 5 additions & 0 deletions ports/libgpg-error/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Source: libgpg-error
Version: 1.39
Homepage: https://gnupg.org/software/libgpg-error/index.html
Description: A common dependency of all GnuPG components
Supports: !windows
25 changes: 25 additions & 0 deletions ports/libgpg-error/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports unix platform" ON_TARGET "Windows")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gpg/libgpg-error
REF libgpg-error-1.39
SHA512 c8ca3fc9f1bec90a84214c8fed6073f5a0f6f6880c166a8737a24e0eee841ed5f0f3c94028b50b76535cb2e06f0362b19638e429b4cdc399487d6001b977bbbe
HEAD_REF master
)

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
--disable-tests
--disable-doc
--disable-silent-rules
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYING.LIB DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

0 comments on commit a7a3acd

Please sign in to comment.