2022-02-08 14:06:56 +08:00
|
|
|
set(IDN2_VERSION 2.3.1)
|
2019-08-14 22:40:23 +08:00
|
|
|
set(IDN2_FILENAME libidn2-${IDN2_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-02-08 14:06:56 +08:00
|
|
|
SHA512 4d77a4a79e08a05e46fc14827f987b9e7645ebf5d0c0869eb96f9902c2f6b73ea69fd6f9f97b80a9f07cce84f7aa299834df91485d4e7c16500d31a4b9865fe4
|
2017-10-12 17:56:58 +08:00
|
|
|
)
|
2019-01-09 08:07:42 +08:00
|
|
|
|
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-07-27 02:02:24 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2019-01-09 08:07:42 +08:00
|
|
|
REF ${IDN2_VERSION}
|
|
|
|
)
|
2017-10-12 17:56:58 +08:00
|
|
|
|
2020-09-28 08:49:45 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
2021-07-27 02:02:24 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/string.h" DESTINATION "${SOURCE_PATH}/gl")
|
2020-09-28 08:49:45 +08:00
|
|
|
|
2021-07-27 02:02:24 +08:00
|
|
|
set(HAVE_ALLOCA_H 0)
|
|
|
|
|
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/config.h" "${SOURCE_PATH}")
|
2022-02-08 14:06:56 +08:00
|
|
|
configure_file("${SOURCE_PATH}/gl/alloca.in.h" "${SOURCE_PATH}/gl/alloca.h")
|
2020-09-28 08:49:45 +08:00
|
|
|
|
|
|
|
function(simple_copy_template_header FILE_PATH BASE_NAME)
|
2021-07-27 02:02:24 +08:00
|
|
|
if(NOT EXISTS "${FILE_PATH}/${BASE_NAME}.h" AND EXISTS "${FILE_PATH}/${BASE_NAME}.in.h")
|
2022-01-20 01:15:16 +08:00
|
|
|
configure_file("${FILE_PATH}/${BASE_NAME}.in.h" "${FILE_PATH}/${BASE_NAME}.h" @ONLY)
|
2020-09-28 08:49:45 +08:00
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
# There seems to be no difference between source and destination files after 'configure'
|
|
|
|
# apart from auto-generated notification at the top. So why not just do a simple copy.
|
2021-07-27 02:02:24 +08:00
|
|
|
simple_copy_template_header("${SOURCE_PATH}/unistring" uniconv)
|
|
|
|
simple_copy_template_header("${SOURCE_PATH}/unistring" unictype)
|
|
|
|
simple_copy_template_header("${SOURCE_PATH}/unistring" uninorm)
|
|
|
|
simple_copy_template_header("${SOURCE_PATH}/unistring" unistr)
|
|
|
|
simple_copy_template_header("${SOURCE_PATH}/unistring" unitypes)
|
|
|
|
simple_copy_template_header("${SOURCE_PATH}/unistring" alloca)
|
2020-09-28 08:49:45 +08:00
|
|
|
|
2021-07-27 02:02:24 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
"-DPACKAGE_VERSION=${IDN2_VERSION}"
|
2020-09-28 08:49:45 +08:00
|
|
|
)
|
|
|
|
|
2021-07-27 02:02:24 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-09-28 08:49:45 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-07-27 02:02:24 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2017-10-12 17:56:58 +08:00
|
|
|
|
2020-09-28 08:49:45 +08:00
|
|
|
else()
|
2021-04-25 15:19:50 +08:00
|
|
|
set(ENV{GTKDOCIZE} true)
|
2020-09-28 08:49:45 +08:00
|
|
|
vcpkg_configure_make(
|
2021-07-27 02:02:24 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-02-03 06:37:29 +08:00
|
|
|
AUTOCONFIG
|
2020-09-28 08:49:45 +08:00
|
|
|
COPY_SOURCE
|
|
|
|
OPTIONS
|
2021-07-27 02:02:24 +08:00
|
|
|
"--with-libiconv-prefix=${CURRENT_INSTALLED_DIR}"
|
2021-04-25 15:19:50 +08:00
|
|
|
--disable-gtk-doc
|
2021-07-27 02:02:24 +08:00
|
|
|
--disable-doc
|
2020-09-28 08:49:45 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_make()
|
|
|
|
|
2021-07-27 02:02:24 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2020-09-28 08:49:45 +08:00
|
|
|
endif()
|
2017-10-12 17:56:58 +08:00
|
|
|
|
2021-07-27 02:02:24 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2017-10-12 17:56:58 +08:00
|
|
|
# License and man
|
2021-07-27 02:02:24 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libidn2" RENAME copyright)
|
|
|
|
file(INSTALL "${SOURCE_PATH}/doc/libidn2.pdf" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libidn2")
|