diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libgnutls | |
Diffstat (limited to 'vcpkg/ports/libgnutls')
| -rw-r--r-- | vcpkg/ports/libgnutls/ccasflags.patch | 23 | ||||
| -rw-r--r-- | vcpkg/ports/libgnutls/portfile.cmake | 82 | ||||
| -rw-r--r-- | vcpkg/ports/libgnutls/use-gmp-pkgconfig.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/libgnutls/vcpkg.json | 38 |
4 files changed, 155 insertions, 0 deletions
diff --git a/vcpkg/ports/libgnutls/ccasflags.patch b/vcpkg/ports/libgnutls/ccasflags.patch new file mode 100644 index 0000000..f7a4071 --- /dev/null +++ b/vcpkg/ports/libgnutls/ccasflags.patch @@ -0,0 +1,23 @@ +diff --git a/configure.ac b/configure.ac +index d6f283a..77e5a56 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -40,6 +40,8 @@ AC_PROG_CC + gl_EARLY + ggl_EARLY + unistring_EARLY ++# Override AM_PROG_AS default ++test "${CCASFLAGS+set}" = set || CCASFLAGS="$CPPFLAGS $CFLAGS" + AM_PROG_AS + AM_PROG_AR + AC_PROG_CXX +@@ -243,7 +245,8 @@ if test "$hw_accel" = aarch64; then + AARCH64_CCASFLAGS="-Wa,-march=all" + AC_MSG_CHECKING([whether the compiler supports -Wa,-march=all]) + : > conftest.s +- if "$CCAS" "$AARCH64_CCASFLAGS" -c conftest.s >/dev/null 2>&1; then ++ # As in Makefiles ++ if "$CCAS" "$AARCH64_CCASFLAGS" $CCASFLAGS -c conftest.s >/dev/null 2>&1; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) diff --git a/vcpkg/ports/libgnutls/portfile.cmake b/vcpkg/ports/libgnutls/portfile.cmake new file mode 100644 index 0000000..530e0e9 --- /dev/null +++ b/vcpkg/ports/libgnutls/portfile.cmake @@ -0,0 +1,82 @@ +string(REGEX REPLACE "^([0-9]*[.][0-9]*)[.].*" "\\1" GNUTLS_BRANCH "${VERSION}")
+vcpkg_download_distfile(tarball
+ URLS
+ "https://gnupg.org/ftp/gcrypt/gnutls/v${GNUTLS_BRANCH}/gnutls-${VERSION}.tar.xz"
+ "https://mirrors.dotsrc.org/gcrypt/gnutls/v${GNUTLS_BRANCH}/gnutls-${VERSION}.tar.xz"
+ "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v${GNUTLS_BRANCH}/gnutls-${VERSION}.tar.xz"
+ FILENAME "gnutls-${VERSION}.tar.xz"
+ SHA512 d453bd4527af95cb3905ce8753ceafd969e3f442ad1d148544a233ebf13285b999930553a805a0511293cc25390bb6a040260df5544a7c55019640f920ad3d92
+)
+vcpkg_extract_source_archive(SOURCE_PATH
+ ARCHIVE "${tarball}"
+ SOURCE_BASE "v${VERSION}"
+ PATCHES
+ ccasflags.patch
+ use-gmp-pkgconfig.patch
+)
+
+vcpkg_list(SET options)
+
+if("nls" IN_LIST FEATURES)
+ vcpkg_list(APPEND options "--enable-nls")
+else()
+ set(ENV{AUTOPOINT} true) # true, the program
+ vcpkg_list(APPEND options "--disable-nls")
+endif()
+if ("openssl" IN_LIST FEATURES)
+ vcpkg_list(APPEND options "--enable-openssl-compatibility")
+endif()
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_list(APPEND options "LIBS=\$LIBS -liconv -lcharset") # for libunistring
+endif()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_list(APPEND options "ac_cv_dlopen_soname_works=no") # ensure vcpkg libs
+endif()
+
+set(ENV{GTKDOCIZE} true) # true, the program
+set(ENV{YACC} false) # false, the program - not used here
+
+vcpkg_make_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTORECONF
+ OPTIONS
+ --disable-dependency-tracking
+ --disable-doc
+ --disable-guile
+ --disable-libdane
+ --disable-maintainer-mode
+ --disable-rpath
+ --disable-tests
+ --with-brotli=no
+ --with-liboqs=no
+ --with-p11-kit=no
+ --with-tpm=no
+ --with-tpm2=no
+ --with-zlib=link
+ --with-zstd=no
+ ${options}
+ OPTIONS_DEBUG
+ --disable-tools
+)
+vcpkg_make_install()
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(
+ COMMENT [[
+The main libraries (libgnutls and libdane) are released under the
+GNU Lesser General Public License version 2.1 or later
+(LGPLv2+, see COPYING.LESSERv2 for the license terms), and
+the gnutls-openssl extra library and the application are under the
+GNU General Public License version 3 or later
+(GPLv3+, see COPYING for the license terms),
+unless otherwise specified in the indivual source files.
+]]
+ FILE_LIST
+ "${SOURCE_PATH}/COPYING.LESSERv2"
+ "${SOURCE_PATH}/COPYING"
+)
diff --git a/vcpkg/ports/libgnutls/use-gmp-pkgconfig.patch b/vcpkg/ports/libgnutls/use-gmp-pkgconfig.patch new file mode 100644 index 0000000..60d2e71 --- /dev/null +++ b/vcpkg/ports/libgnutls/use-gmp-pkgconfig.patch @@ -0,0 +1,12 @@ +diff --git a/m4/hooks.m4 b/m4/hooks.m4 +index e026dd1..cf6064c 100644 +--- a/m4/hooks.m4 ++++ b/m4/hooks.m4 +@@ -91,6 +91,7 @@ AC_MSG_ERROR([[ + mini_nettle=$withval, + mini_nettle=no) + ++ PKG_CHECK_MODULES(GMP, [gmp], [], [AC_MSG_ERROR([[gmp is required]])]) + AC_ARG_VAR(GMP_CFLAGS, [C compiler flags for gmp]) + AC_ARG_VAR(GMP_LIBS, [linker flags for gmp]) + if test "$mini_nettle" != no;then diff --git a/vcpkg/ports/libgnutls/vcpkg.json b/vcpkg/ports/libgnutls/vcpkg.json new file mode 100644 index 0000000..dac99cb --- /dev/null +++ b/vcpkg/ports/libgnutls/vcpkg.json @@ -0,0 +1,38 @@ +{ + "name": "libgnutls", + "version": "3.8.10", + "description": "A secure communications library implementing the SSL, TLS and DTLS protocols.", + "homepage": "https://www.gnutls.org/", + "license": null, + "supports": "!windows | mingw", + "dependencies": [ + "gmp", + "libidn2", + "libtasn1", + "libunistring", + "nettle", + { + "name": "vcpkg-make", + "host": true + }, + "zlib" + ], + "features": { + "nls": { + "description": "Enable native language support.", + "dependencies": [ + { + "name": "gettext", + "host": true, + "features": [ + "tools" + ] + }, + "gettext-libintl" + ] + }, + "openssl": { + "description": "Enable the OpenSSL compatibility library." + } + } +} |