diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-09-27 17:49:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-27 17:49:45 -0700 |
| commit | 870d2cd3b1bf4f14b2e03707d40f8efe1fa19376 (patch) | |
| tree | 08fd461d23ae1f58a561b744f683a40d908e9c94 /ports/libidn2 | |
| parent | 70658669cc038c3016b795b60964e60747a3eb18 (diff) | |
| download | vcpkg-870d2cd3b1bf4f14b2e03707d40f8efe1fa19376.tar.gz vcpkg-870d2cd3b1bf4f14b2e03707d40f8efe1fa19376.zip | |
[libidn2] Support UNIX (#13708)
* [libidn2] Support UNIX
* update baseline
* Add supports
Diffstat (limited to 'ports/libidn2')
| -rw-r--r-- | ports/libidn2/CONTROL | 3 | ||||
| -rw-r--r-- | ports/libidn2/portfile.cmake | 78 |
2 files changed, 49 insertions, 32 deletions
diff --git a/ports/libidn2/CONTROL b/ports/libidn2/CONTROL index 7dc55f126..00ec059a6 100644 --- a/ports/libidn2/CONTROL +++ b/ports/libidn2/CONTROL @@ -1,5 +1,6 @@ Source: libidn2 -Version: 2.2.0-1 +Version: 2.2.0 +Port-Version: 2 Build-Depends: libiconv Homepage: https://www.gnu.org/software/libidn/ Description: GNU Libidn is an implementation of the Stringprep, Punycode and IDNA 2003 specifications. Libidn's purpose is to encode and decode internationalized domain names. diff --git a/ports/libidn2/portfile.cmake b/ports/libidn2/portfile.cmake index 1d7c94070..5d637c5b1 100644 --- a/ports/libidn2/portfile.cmake +++ b/ports/libidn2/portfile.cmake @@ -13,39 +13,55 @@ vcpkg_extract_source_archive_ex( REF ${IDN2_VERSION} ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/string.h DESTINATION ${SOURCE_PATH}/gl) +if (VCPKG_TARGET_IS_WINDOWS) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + file(COPY ${CMAKE_CURRENT_LIST_DIR}/string.h DESTINATION ${SOURCE_PATH}/gl) + + configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h ${SOURCE_PATH}) + + function(simple_copy_template_header FILE_PATH BASE_NAME) + if(NOT EXISTS ${FILE_PATH}/${BASE_NAME}.h) + if(EXISTS ${FILE_PATH}/${BASE_NAME}.in.h) + configure_file(${FILE_PATH}/${BASE_NAME}.in.h ${FILE_PATH}/${BASE_NAME}.h) + endif() + 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. + 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) + + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + ) + + vcpkg_install_cmake() + + vcpkg_copy_pdbs() + + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h ${SOURCE_PATH}) - -function(simple_copy_template_header FILE_PATH BASE_NAME) - if(NOT EXISTS ${FILE_PATH}/${BASE_NAME}.h) - if(EXISTS ${FILE_PATH}/${BASE_NAME}.in.h) - configure_file(${FILE_PATH}/${BASE_NAME}.in.h ${FILE_PATH}/${BASE_NAME}.h) - endif() - 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. -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) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA -) - -vcpkg_install_cmake() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +else() + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + COPY_SOURCE + OPTIONS + --with-libiconv-prefix=${CURRENT_INSTALLED_DIR} + ) + + vcpkg_install_make() + + vcpkg_fixup_pkgconfig() + + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +endif() # License and man 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) - -vcpkg_copy_pdbs() |
