early-access version 2853
This commit is contained in:
124
externals/vcpkg/ports/libidn2/CMakeLists.txt
vendored
Executable file
124
externals/vcpkg/ports/libidn2/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,124 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
project(libidn2 C)
|
||||
|
||||
find_package(Iconv REQUIRED)
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
add_definitions(-DIDN2_BUILDING)
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
add_definitions(-DIDN2_STATIC)
|
||||
endif()
|
||||
|
||||
# List the source files
|
||||
set(LIB_SRC lib/bidi.c
|
||||
lib/context.c
|
||||
lib/data.c
|
||||
lib/decode.c
|
||||
lib/error.c
|
||||
lib/free.c
|
||||
lib/idna.c
|
||||
lib/lookup.c
|
||||
lib/puny_decode.c
|
||||
lib/puny_encode.c
|
||||
lib/register.c
|
||||
lib/tables.c
|
||||
lib/tr46map.c
|
||||
lib/tr46map_data.c
|
||||
lib/version.c
|
||||
)
|
||||
|
||||
# List the libunistring source files
|
||||
set(UNISTR_SRC unistring/c-ctype.c
|
||||
unistring/c-strcasecmp.c
|
||||
unistring/c-strncasecmp.c
|
||||
unistring/free.c
|
||||
unistring/striconveh.c
|
||||
unistring/striconveha.c
|
||||
unistring/uniconv/u8-conv-from-enc.c
|
||||
unistring/uniconv/u8-strconv-from-enc.c
|
||||
unistring/uniconv/u8-strconv-from-locale.c
|
||||
unistring/uniconv/u8-strconv-to-enc.c
|
||||
unistring/uniconv/u8-strconv-to-locale.c
|
||||
unistring/unistr/u32-cmp.c
|
||||
unistring/unistr/u32-cpy.c
|
||||
unistring/unistr/u32-cpy-alloc.c
|
||||
unistring/unistr/u32-mbtouc-unsafe.c
|
||||
unistring/unistr/u32-strlen.c
|
||||
unistring/unistr/u32-to-u8.c
|
||||
unistring/unistr/u32-uctomb.c
|
||||
unistring/unistr/u8-check.c
|
||||
unistring/unistr/u8-mblen.c
|
||||
unistring/unistr/u8-mbtouc.c
|
||||
unistring/unistr/u8-mbtouc-aux.c
|
||||
unistring/unistr/u8-mbtouc-unsafe.c
|
||||
unistring/unistr/u8-mbtouc-unsafe-aux.c
|
||||
unistring/unistr/u8-mbtoucr.c
|
||||
unistring/unistr/u8-prev.c
|
||||
unistring/unistr/u8-strlen.c
|
||||
unistring/unistr/u8-to-u32.c
|
||||
unistring/unistr/u8-uctomb.c
|
||||
unistring/unistr/u8-uctomb-aux.c
|
||||
unistring/uninorm/canonical-decomposition.c
|
||||
unistring/uninorm/composition.c
|
||||
unistring/uninorm/decompose-internal.c
|
||||
unistring/uninorm/decomposition-table.c
|
||||
unistring/uninorm/nfc.c
|
||||
unistring/uninorm/nfd.c
|
||||
unistring/uninorm/u32-normalize.c
|
||||
unistring/unictype/bidi_of.c
|
||||
unistring/unictype/categ_M.c
|
||||
unistring/unictype/categ_none.c
|
||||
unistring/unictype/categ_of.c
|
||||
unistring/unictype/categ_test.c
|
||||
unistring/unictype/combiningclass.c
|
||||
unistring/unictype/joiningtype_of.c
|
||||
unistring/unictype/scripts.c
|
||||
)
|
||||
|
||||
# List the gnulib source files
|
||||
set(GL_SRC gl/rawmemchr.c
|
||||
gl/strchrnul.c
|
||||
gl/strverscmp.c
|
||||
gl/msvc-inval.c
|
||||
gl/msvc-nothrow.c
|
||||
gl/malloca.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)
|
||||
|
||||
install(TARGETS libidn2
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
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 "-liconv -lcharset")
|
||||
set(LTLIBUNISTRING "")
|
||||
configure_file("libidn2.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" @ONLY)
|
||||
if(WIN32 AND NOT MINGW)
|
||||
file(READ "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" pc_data)
|
||||
string(REPLACE " -lidn" " -llibidn" pc_data "${pc_data}")
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" "${pc_data}")
|
||||
endif()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" DESTINATION "lib/pkgconfig")
|
||||
1289
externals/vcpkg/ports/libidn2/config.h
vendored
Executable file
1289
externals/vcpkg/ports/libidn2/config.h
vendored
Executable file
File diff suppressed because it is too large
Load Diff
73
externals/vcpkg/ports/libidn2/portfile.cmake
vendored
Executable file
73
externals/vcpkg/ports/libidn2/portfile.cmake
vendored
Executable file
@@ -0,0 +1,73 @@
|
||||
set(IDN2_VERSION 2.3.1)
|
||||
set(IDN2_FILENAME libidn2-${IDN2_VERSION}.tar.gz)
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}"
|
||||
FILENAME "${IDN2_FILENAME}"
|
||||
SHA512 4d77a4a79e08a05e46fc14827f987b9e7645ebf5d0c0869eb96f9902c2f6b73ea69fd6f9f97b80a9f07cce84f7aa299834df91485d4e7c16500d31a4b9865fe4
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
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")
|
||||
|
||||
set(HAVE_ALLOCA_H 0)
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/config.h" "${SOURCE_PATH}")
|
||||
configure_file("${SOURCE_PATH}/gl/alloca.in.h" "${SOURCE_PATH}/gl/alloca.h")
|
||||
|
||||
function(simple_copy_template_header FILE_PATH BASE_NAME)
|
||||
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" @ONLY)
|
||||
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_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
"-DPACKAGE_VERSION=${IDN2_VERSION}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
else()
|
||||
set(ENV{GTKDOCIZE} true)
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
COPY_SOURCE
|
||||
OPTIONS
|
||||
"--with-libiconv-prefix=${CURRENT_INSTALLED_DIR}"
|
||||
--disable-gtk-doc
|
||||
--disable-doc
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
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")
|
||||
14
externals/vcpkg/ports/libidn2/string.h
vendored
Executable file
14
externals/vcpkg/ports/libidn2/string.h
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
#ifndef _GL_STRING_H
|
||||
#define _GL_STRING_H
|
||||
|
||||
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 */
|
||||
18
externals/vcpkg/ports/libidn2/vcpkg.json
vendored
Executable file
18
externals/vcpkg/ports/libidn2/vcpkg.json
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "libidn2",
|
||||
"version": "2.3.1",
|
||||
"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",
|
||||
{
|
||||
"name": "libunistring",
|
||||
"platform": "!windows"
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true,
|
||||
"platform": "windows"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user