2022-11-09 21:14:28 +01:00
|
|
|
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
|
|
|
|
|
|
|
set(IDN2_FILENAME "libidn2-${VERSION}.tar.gz")
|
2017-10-12 12:56:58 +03:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2020-01-06 14: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 12:56:58 +03:00
|
|
|
FILENAME "${IDN2_FILENAME}"
|
2022-11-09 21:14:28 +01:00
|
|
|
SHA512 a6e90ccef56cfd0b37e3333ab3594bb3cec7ca42a138ca8c4f4ce142da208fa792f6c78ca00c01001c2bc02831abcbaf1cf9bcc346a5290fd7b30708f5a462f3
|
2017-10-12 12:56:58 +03:00
|
|
|
)
|
2019-01-08 16:07:42 -08:00
|
|
|
|
2022-11-09 21:14:28 +01:00
|
|
|
vcpkg_extract_source_archive(SOURCE_PATH
|
2021-07-26 20:02:24 +02:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2022-11-09 21:14:28 +01:00
|
|
|
SOURCE_BASE "v${VERSION}"
|
|
|
|
PATCHES
|
|
|
|
disable-subdirs.patch
|
|
|
|
fix-msvc.patch
|
|
|
|
fix-uwp.patch
|
2019-01-08 16:07:42 -08:00
|
|
|
)
|
2017-10-12 12:56:58 +03:00
|
|
|
|
2022-11-09 21:14:28 +01:00
|
|
|
vcpkg_list(SET options)
|
|
|
|
if("nls" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options "--enable-nls")
|
2020-09-27 17:49:45 -07:00
|
|
|
else()
|
2022-11-09 21:14:28 +01: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-27 17:49:45 -07:00
|
|
|
endif()
|
2017-10-12 12:56:58 +03:00
|
|
|
|
2022-11-09 21:14:28 +01: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-10 19:48:27 +01:00
|
|
|
"--with-libunistring-prefix=${CURRENT_INSTALLED_DIR}"
|
2022-11-09 21:14:28 +01:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
"--with-libiconv-prefix=${CURRENT_INSTALLED_DIR}/debug"
|
2022-11-10 19:48:27 +01:00
|
|
|
"--with-libunistring-prefix=${CURRENT_INSTALLED_DIR}/debug"
|
2022-11-09 21:14:28 +01:00
|
|
|
"CFLAGS=\$CFLAGS -I${CURRENT_INSTALLED_DIR}/include"
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_make()
|
2021-07-26 20:02:24 +02:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2022-11-09 21:14:28 +01: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-26 20:02:24 +02:00
|
|
|
|
2022-11-09 21:14:28 +01: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"
|
|
|
|
)
|