vcpkg/ports/libgnutls/portfile.cmake
Kai Pastor 783e2d8e99
[libgnutls] Update, feature 'nls' (#27783)
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2022-11-14 16:54:13 -08:00

66 lines
2.0 KiB
CMake

vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
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 72c78d7fcb024393c1d15f2a1856608ae4460ba43cc5bbbb4c29b80508cae6cb822df4638029de2363437d110187e0a3cc19a7288c3b2f44b2f648399a028438
)
vcpkg_extract_source_archive(SOURCE_PATH
ARCHIVE "${tarball}"
SOURCE_BASE "v${VERSION}"
PATCHES
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_OSX)
vcpkg_list(APPEND options "LDFLAGS=\$LDFLAGS -framework CoreFoundation")
endif()
set(ENV{GTKDOCIZE} true) # true, the program
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
OPTIONS
--disable-dependency-tracking
--disable-doc
--disable-guile
--disable-libdane
--disable-maintainer-mode
--disable-silent-rules
--disable-rpath
--disable-tests
--without-p11-kit
--without-tpm
${options}
YACC=false # false, the program - not used here
OPTIONS_DEBUG
--disable-tools
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(
FILE_LIST
"${SOURCE_PATH}/LICENSE"
"${SOURCE_PATH}/doc/COPYING"
"${SOURCE_PATH}/doc/COPYING.LESSER"
)