aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libgcrypt
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libgcrypt')
-rw-r--r--vcpkg/ports/libgcrypt/cross-tools.patch29
-rw-r--r--vcpkg/ports/libgcrypt/portfile.cmake68
-rw-r--r--vcpkg/ports/libgcrypt/vcpkg.json19
3 files changed, 116 insertions, 0 deletions
diff --git a/vcpkg/ports/libgcrypt/cross-tools.patch b/vcpkg/ports/libgcrypt/cross-tools.patch
new file mode 100644
index 0000000..ab3555b
--- /dev/null
+++ b/vcpkg/ports/libgcrypt/cross-tools.patch
@@ -0,0 +1,29 @@
+diff --git a/cipher/Makefile.am b/cipher/Makefile.am
+index ea9014c..8aeedb7 100644
+--- a/cipher/Makefile.am
++++ b/cipher/Makefile.am
+@@ -19,6 +19,13 @@
+
+ # Process this file with automake to produce Makefile.in
+
++# Building host tools for native triplet, or not at all
++CPPFLAGS_FOR_BUILD = $(CPPFLAGS)
++CFLAGS_FOR_BUILD = $(CFLAGS)
++LDFLAGS_FOR_BUILD = $(LDFLAGS)
++# Using native tools, either this build or from host triplet
++HOST_TOOLS_PREFIX ?= .
++
+ # Need to include ../src in addition to top_srcdir because gcrypt.h is
+ # a built header.
+ AM_CPPFLAGS = -I../src -I$(top_srcdir)/src -I../mpi -I$(top_srcdir)/mpi
+@@ -160,8 +167,8 @@ EXTRA_libcipher_la_SOURCES = \
+ blake2s-amd64-avx.S blake2s-amd64-avx512.S
+
+ gost28147.lo: gost-sb.h
+-gost-sb.h: gost-s-box$(EXEEXT_FOR_BUILD)
+- ./gost-s-box$(EXEEXT_FOR_BUILD) $@
++gost-sb.h: $(HOST_TOOLS_PREFIX)/gost-s-box$(EXEEXT_FOR_BUILD)
++ $(HOST_TOOLS_PREFIX)/gost-s-box$(EXEEXT_FOR_BUILD) $@
+
+ gost-s-box$(EXEEXT_FOR_BUILD): gost-s-box.c
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
diff --git a/vcpkg/ports/libgcrypt/portfile.cmake b/vcpkg/ports/libgcrypt/portfile.cmake
new file mode 100644
index 0000000..e415743
--- /dev/null
+++ b/vcpkg/ports/libgcrypt/portfile.cmake
@@ -0,0 +1,68 @@
+vcpkg_download_distfile(tarball
+ URLS
+ "https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-${VERSION}.tar.bz2"
+ "https://mirrors.dotsrc.org/gcrypt/libgcrypt/libgcrypt-${VERSION}.tar.bz2"
+ "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-${VERSION}.tar.bz2"
+ FILENAME "libgcrypt-${VERSION}.tar.bz2"
+ SHA512 85846d62ce785e4250a2bf8a2b13ec24837e48ab8e10d537ad4a18d650d2cca747f82fd1501feab47ad3114b9593b36c9fa7a892f48139e2a71ef61295a47678
+)
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${tarball}"
+ PATCHES
+ cross-tools.patch
+)
+
+if(VCPKG_CROSSCOMPILING)
+ set(ENV{HOST_TOOLS_PREFIX} "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}")
+endif()
+
+set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/libgpg-error/aclocal/\"")
+vcpkg_make_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTORECONF
+ LANGUAGES C ASM
+ OPTIONS
+ --disable-doc
+ OPTIONS_RELEASE
+ "GPG_ERROR_CONFIG=${CURRENT_INSTALLED_DIR}/tools/libgpg-error/bin/gpgrt-config gpg-error"
+ "GPGRT_CONFIG=${CURRENT_INSTALLED_DIR}/tools/libgpg-error/bin/gpgrt-config"
+ OPTIONS_DEBUG
+ "GPG_ERROR_CONFIG=${CURRENT_INSTALLED_DIR}/tools/libgpg-error/debug/bin/gpgrt-config gpg-error"
+ "GPGRT_CONFIG=${CURRENT_INSTALLED_DIR}/tools/libgpg-error/debug/bin/gpgrt-config"
+)
+
+vcpkg_make_install()
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+if(NOT VCPKG_CROSSCOMPILING)
+ file(INSTALL
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/cipher/gost-s-box${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}"
+ USE_SOURCE_PERMISSIONS
+ )
+ vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}")
+endif()
+
+set(install_prefix "${CURRENT_INSTALLED_DIR}")
+if(VCPKG_HOST_IS_WINDOWS)
+ string(REGEX REPLACE "^([a-zA-Z]):/" "/\\1/" install_prefix "${install_prefix}")
+endif()
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/libgcrypt-config" "${install_prefix}" "`dirname $0`/../../..")
+if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/libgcrypt-config" "${install_prefix}" "`dirname $0`/../../../..")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(COMMENT [[
+The library is distributed under the terms of the GNU Lesser General Public License (LGPL).
+The helper programs as well as the documentation are distributed under the terms of the GNU General Public License (GPL).
+There are additonal notices about contributions that require these additional notices are distributed.
+]]
+ FILE_LIST
+ "${SOURCE_PATH}/COPYING.LIB"
+ "${SOURCE_PATH}/COPYING"
+ "${SOURCE_PATH}/LICENSES"
+)
diff --git a/vcpkg/ports/libgcrypt/vcpkg.json b/vcpkg/ports/libgcrypt/vcpkg.json
new file mode 100644
index 0000000..2f94cc2
--- /dev/null
+++ b/vcpkg/ports/libgcrypt/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "libgcrypt",
+ "version": "1.11.1",
+ "description": "A general purpose cryptographic library",
+ "homepage": "https://gnupg.org/software/libgcrypt/index.html",
+ "license": null,
+ "supports": "!windows | mingw",
+ "dependencies": [
+ {
+ "name": "libgcrypt",
+ "host": true
+ },
+ "libgpg-error",
+ {
+ "name": "vcpkg-make",
+ "host": true
+ }
+ ]
+}