aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Pastor <dg0yt@darc.de>2021-07-26 20:02:24 +0200
committerGitHub <noreply@github.com>2021-07-26 11:02:24 -0700
commitb57e29a6ceb3ca1382eca103dee876c7d2ac25ca (patch)
tree2bc9494ecbf59c5b9acc7d3632e227a2f888e754
parentbe01bbc3e1bd99d212225168c6c41329b5dbc969 (diff)
downloadvcpkg-b57e29a6ceb3ca1382eca103dee876c7d2ac25ca.tar.gz
vcpkg-b57e29a6ceb3ca1382eca103dee876c7d2ac25ca.zip
[libidn2] Fixes for mingw and minor issues (#19002)
* Fix port's cmake buildsystem for mingw * Install pc file for windows * Modernize portfile * Increment port-version * x-add-version * Use libunistring for non-windows * CR and doc changes * Update git-tree
-rw-r--r--ports/libidn2/CMakeLists.txt16
-rw-r--r--ports/libidn2/portfile.cmake54
-rw-r--r--ports/libidn2/string.h4
-rw-r--r--ports/libidn2/vcpkg.json13
-rw-r--r--versions/baseline.json2
-rw-r--r--versions/l-/libidn2.json5
6 files changed, 65 insertions, 29 deletions
diff --git a/ports/libidn2/CMakeLists.txt b/ports/libidn2/CMakeLists.txt
index cd87848f3..f8e0908f4 100644
--- a/ports/libidn2/CMakeLists.txt
+++ b/ports/libidn2/CMakeLists.txt
@@ -89,6 +89,12 @@ set(GL_SRC gl/rawmemchr.c
)
add_library(libidn2 ${LIB_SRC} ${UNISTR_SRC} ${GL_SRC})
+set_target_properties(libidn2
+ PROPERTIES
+ OUTPUT_NAME idn2
+ PREFIX lib
+ IMPORT_PREFIX lib
+)
target_include_directories(libidn2 PRIVATE . ./unistring ./gl)
target_link_libraries(libidn2 PRIVATE Iconv::Iconv)
@@ -99,3 +105,13 @@ install(TARGETS libidn2
ARCHIVE DESTINATION lib)
install(FILES lib/idn2.h DESTINATION include)
+
+# Install pc file
+set(prefix "\${pcfiledir}/../..")
+set(exec_prefix "\${prefix}")
+set(includedir "\${prefix}/include")
+set(libdir "\${prefix}/lib")
+set(LTLIBICONV "")
+set(LTLIBUNISTRING "")
+configure_file("libidn2.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" DESTINATION "lib/pkgconfig")
diff --git a/ports/libidn2/portfile.cmake b/ports/libidn2/portfile.cmake
index 55946fcc9..f9ffcae78 100644
--- a/ports/libidn2/portfile.cmake
+++ b/ports/libidn2/portfile.cmake
@@ -9,62 +9,64 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
- ARCHIVE ${ARCHIVE}
+ ARCHIVE "${ARCHIVE}"
REF ${IDN2_VERSION}
)
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)
+ 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})
+ set(HAVE_ALLOCA_H 0)
+
+ 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()
+ if(NOT EXISTS "${FILE_PATH}/${BASE_NAME}.h" AND EXISTS "${FILE_PATH}/${BASE_NAME}.in.h")
+ configure_file("${FILE_PATH}/${BASE_NAME}.in.h" "${FILE_PATH}/${BASE_NAME}.h")
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)
+ 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_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ "-DPACKAGE_VERSION=${IDN2_VERSION}"
)
- vcpkg_install_cmake()
+ vcpkg_cmake_install()
vcpkg_copy_pdbs()
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
else()
set(ENV{GTKDOCIZE} true)
vcpkg_configure_make(
- SOURCE_PATH ${SOURCE_PATH}
+ SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
COPY_SOURCE
OPTIONS
- --with-libiconv-prefix=${CURRENT_INSTALLED_DIR}
+ "--with-libiconv-prefix=${CURRENT_INSTALLED_DIR}"
--disable-gtk-doc
+ --disable-doc
)
vcpkg_install_make()
- vcpkg_fixup_pkgconfig()
-
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
endif()
+vcpkg_fixup_pkgconfig()
+
# 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)
+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")
diff --git a/ports/libidn2/string.h b/ports/libidn2/string.h
index 7ed5f5fdc..0147d8357 100644
--- a/ports/libidn2/string.h
+++ b/ports/libidn2/string.h
@@ -5,6 +5,10 @@ char * strchrnul (const char *s, int c_in);
int strverscmp (const char *s1, const char *s2);
void * rawmemchr (const void *s, int c_in);
+#if defined(__MINGW32__)
+#include <../include/string.h>
+#elif defined(_WIN32)
#include <../ucrt/string.h>
+#endif
#endif /* _GL_STRING_H */
diff --git a/ports/libidn2/vcpkg.json b/ports/libidn2/vcpkg.json
index b39058a5d..9c00c1b15 100644
--- a/ports/libidn2/vcpkg.json
+++ b/ports/libidn2/vcpkg.json
@@ -1,10 +1,19 @@
{
"name": "libidn2",
"version": "2.3.0",
- "port-version": 3,
+ "port-version": 4,
"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.",
"homepage": "https://www.gnu.org/software/libidn/",
"dependencies": [
- "libiconv"
+ "libiconv",
+ {
+ "name": "libunistring",
+ "platform": "!(windows | mingw)"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true,
+ "platform": "windows | mingw"
+ }
]
}
diff --git a/versions/baseline.json b/versions/baseline.json
index f98b67ca2..2282ac6cf 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -3270,7 +3270,7 @@
},
"libidn2": {
"baseline": "2.3.0",
- "port-version": 3
+ "port-version": 4
},
"libigl": {
"baseline": "2.2.0",
diff --git a/versions/l-/libidn2.json b/versions/l-/libidn2.json
index 8c85492c9..47fb7c9c6 100644
--- a/versions/l-/libidn2.json
+++ b/versions/l-/libidn2.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "a73dca27190e239f6ff09db7124b885a23d732e4",
+ "version": "2.3.0",
+ "port-version": 4
+ },
+ {
"git-tree": "cad738e7d2fff6e1ac7c8a2bec14160aa127336f",
"version": "2.3.0",
"port-version": 3