2022-11-10 04:14:28 +08:00
|
|
|
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
|
|
|
|
|
|
|
set(IDN2_FILENAME "libidn2-${VERSION}.tar.gz")
|
2017-10-12 17:56:58 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2020-01-07 06:33:00 +08:00
|
|
|
URLS "https://ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}"
|
2017-10-12 17:56:58 +08:00
|
|
|
FILENAME "${IDN2_FILENAME}"
|
2022-11-10 04:14:28 +08:00
|
|
|
SHA512 a6e90ccef56cfd0b37e3333ab3594bb3cec7ca42a138ca8c4f4ce142da208fa792f6c78ca00c01001c2bc02831abcbaf1cf9bcc346a5290fd7b30708f5a462f3
|
2017-10-12 17:56:58 +08:00
|
|
|
)
|
2019-01-09 08:07:42 +08:00
|
|
|
|
2023-02-22 00:47:24 +08:00
|
|
|
vcpkg_list(SET patches)
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
# Fix linking static libidn2 into shared library
|
|
|
|
# https://gitlab.com/libidn/libidn2/-/issues/80
|
|
|
|
vcpkg_list(APPEND patches "fix-static-into-shared-linking.patch")
|
|
|
|
endif()
|
|
|
|
|
2022-11-10 04:14:28 +08:00
|
|
|
vcpkg_extract_source_archive(SOURCE_PATH
|
2021-07-27 02:02:24 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2022-11-10 04:14:28 +08:00
|
|
|
SOURCE_BASE "v${VERSION}"
|
|
|
|
PATCHES
|
2023-02-22 00:47:24 +08:00
|
|
|
${patches}
|
2022-11-10 04:14:28 +08:00
|
|
|
disable-subdirs.patch
|
|
|
|
fix-msvc.patch
|
|
|
|
fix-uwp.patch
|
2019-01-09 08:07:42 +08:00
|
|
|
)
|
2017-10-12 17:56:58 +08:00
|
|
|
|
2022-11-10 04:14:28 +08:00
|
|
|
vcpkg_list(SET options)
|
|
|
|
if("nls" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options "--enable-nls")
|
2020-09-28 08:49:45 +08:00
|
|
|
else()
|
2022-11-10 04:14:28 +08:00
|
|
|
set(ENV{AUTOPOINT} true) # true, the program
|
|
|
|
vcpkg_list(APPEND options "--disable-nls")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_list(APPEND options "CPPFLAGS=\$CPPFLAGS -DIDN2_STATIC")
|
2020-09-28 08:49:45 +08:00
|
|
|
endif()
|
2017-10-12 17:56:58 +08:00
|
|
|
|
2022-11-10 04:14:28 +08:00
|
|
|
set(ENV{GTKDOCIZE} true)
|
|
|
|
vcpkg_configure_make(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
AUTOCONFIG
|
|
|
|
COPY_SOURCE # include dir order problem
|
|
|
|
USE_WRAPPERS
|
|
|
|
OPTIONS
|
|
|
|
${options}
|
|
|
|
--disable-gtk-doc
|
|
|
|
--disable-doc
|
|
|
|
--disable-gcc-warnings
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
"--with-libiconv-prefix=${CURRENT_INSTALLED_DIR}"
|
2022-11-11 02:48:27 +08:00
|
|
|
"--with-libunistring-prefix=${CURRENT_INSTALLED_DIR}"
|
2022-11-10 04:14:28 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
"--with-libiconv-prefix=${CURRENT_INSTALLED_DIR}/debug"
|
2022-11-11 02:48:27 +08:00
|
|
|
"--with-libunistring-prefix=${CURRENT_INSTALLED_DIR}/debug"
|
2022-11-10 04:14:28 +08:00
|
|
|
"CFLAGS=\$CFLAGS -I${CURRENT_INSTALLED_DIR}/include"
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_make()
|
2021-07-27 02:02:24 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2022-11-10 04:14:28 +08:00
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/idn2.h" "defined IDN2_STATIC" "1")
|
|
|
|
endif()
|
2021-07-27 02:02:24 +08:00
|
|
|
|
2022-11-10 04:14:28 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug"
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_copyright(
|
|
|
|
FILE_LIST
|
|
|
|
"${SOURCE_PATH}/COPYING"
|
|
|
|
"${SOURCE_PATH}/COPYING.LESSERv3"
|
|
|
|
"${SOURCE_PATH}/COPYINGv2"
|
|
|
|
"${SOURCE_PATH}/COPYING.unicode"
|
|
|
|
)
|