diff options
| author | Alexander Saprykin <xelfium@gmail.com> | 2018-05-26 13:27:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-26 13:27:14 +0200 |
| commit | 4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5 (patch) | |
| tree | d95c9490352eb73f078d34a33bc4bb44ac9fa48b /ports/gettext | |
| parent | fb689bd13dd6ba563a885d71fff1dd2b32a615db (diff) | |
| parent | 2ac7527b40b1dbeb7856b9f763362c1e139e2ca9 (diff) | |
| download | vcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.tar.gz vcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.zip | |
Merge pull request #1 from Microsoft/master
Update vcpkg from upstream
Diffstat (limited to 'ports/gettext')
| -rw-r--r-- | ports/gettext/0001-Fix-macro-definitions.patch | 33 | ||||
| -rw-r--r-- | ports/gettext/0002-Fix-uwp-build.patch | 77 | ||||
| -rw-r--r-- | ports/gettext/CMakeLists.txt | 96 | ||||
| -rw-r--r-- | ports/gettext/CMakeLists_libintl.txt | 54 | ||||
| -rw-r--r-- | ports/gettext/CONTROL | 3 | ||||
| -rw-r--r-- | ports/gettext/config.win32.h (renamed from ports/gettext/config.h) | 17 | ||||
| -rw-r--r-- | ports/gettext/libgnuintl.win32.h (renamed from ports/gettext/libgnuintl.h) | 2 | ||||
| -rw-r--r-- | ports/gettext/portfile.cmake | 36 |
8 files changed, 217 insertions, 101 deletions
diff --git a/ports/gettext/0001-Fix-macro-definitions.patch b/ports/gettext/0001-Fix-macro-definitions.patch index 506c43dba..07529da97 100644 --- a/ports/gettext/0001-Fix-macro-definitions.patch +++ b/ports/gettext/0001-Fix-macro-definitions.patch @@ -1,37 +1,27 @@ -From df8121a8822245df0b191b7d3b1654611fdac1b2 Mon Sep 17 00:00:00 2001 -From: vlj <vljn.ovi@gmail.com> -Date: Tue, 1 Nov 2016 23:09:06 +0100 -Subject: [PATCH] Fix macro definitions. - ---- - gettext-0.19/gettext-runtime/intl/printf-parse.c | 4 +++- - gettext-0.19/gettext-runtime/intl/xsize.h | 6 ++++++ - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/gettext-0.19/gettext-runtime/intl/printf-parse.c b/gettext-0.19/gettext-runtime/intl/printf-parse.c -index 0e2d2c7..8cedfc6 100644 ---- a/gettext-0.19/gettext-runtime/intl/printf-parse.c -+++ b/gettext-0.19/gettext-runtime/intl/printf-parse.c +diff --git a/gettext-runtime/intl/printf-parse.c b/gettext-runtime/intl/printf-parse.c +index 0e2d2c7..e1dc39b 100644 +--- a/gettext-runtime/intl/printf-parse.c ++++ b/gettext-runtime/intl/printf-parse.c @@ -48,7 +48,9 @@ #include <stddef.h> /* Get intmax_t. */ -#if defined IN_LIBINTL || defined IN_LIBASPRINTF -+#if _MSC_VER ++#if defined _MSC_VER +# define intmax_t long int +#elif defined IN_LIBINTL || defined IN_LIBASPRINTF # if HAVE_STDINT_H_WITH_UINTMAX # include <stdint.h> # endif -diff --git a/gettext-0.19/gettext-runtime/intl/xsize.h b/gettext-0.19/gettext-runtime/intl/xsize.h -index c256665..d09e79f 100644 ---- a/gettext-0.19/gettext-runtime/intl/xsize.h -+++ b/gettext-0.19/gettext-runtime/intl/xsize.h +diff --git a/gettext-runtime/intl/xsize.h b/gettext-runtime/intl/xsize.h +index c256665..7400ea1 100644 +--- a/gettext-runtime/intl/xsize.h ++++ b/gettext-runtime/intl/xsize.h @@ -27,6 +27,12 @@ # include <stdint.h> #endif -+#ifdef _WIN32 ++#if defined _WIN32 +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +# define _GL_INLINE static inline @@ -40,6 +30,3 @@ index c256665..d09e79f 100644 #ifndef _GL_INLINE_HEADER_BEGIN #error "Please include config.h first." #endif --- -2.10.1.windows.1 - diff --git a/ports/gettext/0002-Fix-uwp-build.patch b/ports/gettext/0002-Fix-uwp-build.patch new file mode 100644 index 000000000..154131544 --- /dev/null +++ b/ports/gettext/0002-Fix-uwp-build.patch @@ -0,0 +1,77 @@ +diff --git "a/gettext-runtime/intl/langprefs.c" "b/gettext-runtime/intl/langprefs.c" +index aeb1c4e9..2ac531be 100644 +--- "a/gettext-runtime/intl/langprefs.c" ++++ "b/gettext-runtime/intl/langprefs.c" +@@ -33,7 +33,13 @@ extern void _nl_locale_name_canonicalize (char *name); + #endif + + #if defined _WIN32 || defined __WIN32__ +-# define WIN32_NATIVE ++# if !defined(WINAPI_FAMILY) ++# define WIN32_NATIVE ++# else ++# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) ++# define WIN32_NATIVE ++# endif ++# endif + #endif + + #ifdef WIN32_NATIVE +diff --git "a/gettext-runtime/intl/localcharset.c" "b/gettext-runtime/intl/localcharset.c" +index 670b8e6c..035a96bd 100644 +--- "a/gettext-runtime/intl/localcharset.c" ++++ "b/gettext-runtime/intl/localcharset.c" +@@ -36,6 +36,16 @@ + # define WINDOWS_NATIVE + #endif + ++#if defined _WIN32 || defined __WIN32__ ++# if !defined(WINAPI_FAMILY) ++# define HAVE_ACP ++# else ++# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) ++# define HAVE_ACP ++# endif ++# endif ++#endif ++ + #if defined __EMX__ + /* Assume EMX program runs on OS/2, even if compiled under DOS. */ + # ifndef OS2 +@@ -361,7 +371,7 @@ STATIC + const char * + locale_charset (void) + { +- const char *codeset; ++ const char *codeset = NULL; + const char *aliases; + + #if !(defined WINDOWS_NATIVE || defined OS2) +@@ -457,7 +467,7 @@ locale_charset (void) + + # endif + +-#elif defined WINDOWS_NATIVE ++#elif defined WINDOWS_NATIVE && defined HAVE_ACP + + static char buf[2 + 10 + 1]; + +diff --git "a/gettext-runtime/intl/localename.c" "b/gettext-runtime/intl/localename.c" +index 108dd6f1..ace3aa88 100644 +--- "a/gettext-runtime/intl/localename.c" ++++ "b/gettext-runtime/intl/localename.c" +@@ -54,7 +54,13 @@ + #endif + + #if defined _WIN32 || defined __WIN32__ +-# define WINDOWS_NATIVE ++# if !defined(WINAPI_FAMILY) ++# define WINDOWS_NATIVE ++# else ++# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) ++# define WINDOWS_NATIVE ++# endif ++# endif + #endif + + #if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ diff --git a/ports/gettext/CMakeLists.txt b/ports/gettext/CMakeLists.txt index 410ff9c0a..7df8c33dc 100644 --- a/ports/gettext/CMakeLists.txt +++ b/ports/gettext/CMakeLists.txt @@ -1 +1,95 @@ -add_subdirectory(gettext-runtime)
\ No newline at end of file +cmake_minimum_required(VERSION 3.5)
+project(libintl C)
+
+find_package(unofficial-iconv REQUIRED)
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/config .)
+
+set(CMAKE_STATIC_LIBRARY_PREFIX)
+set(CMAKE_SHARED_LIBRARY_PREFIX)
+
+if(WIN32)
+ set(HAVE_POSIX_PRINTF 0)
+ set(HAVE_SNPRINTF 0)
+ set(HAVE_ASPRINTF 0)
+ set(HAVE_WPRINTF 0)
+ set(HAVE_NEWLOCALE 0)
+
+ configure_file(intl/libgnuintl.win32.h config/libgnuintl.h COPYONLY)
+ configure_file(config.win32.h config/config.h COPYONLY)
+else()
+ set(HAVE_POSIX_PRINTF 1)
+ set(HAVE_SNPRINTF 1)
+ set(HAVE_ASPRINTF 1)
+ set(HAVE_WPRINTF 1)
+ set(HAVE_NEWLOCALE 1)
+ add_definitions(-DHAVE_NEWLOCALE=1)
+
+ configure_file(intl/libgnuintl.in.h config/libgnuintl.h @ONLY)
+ configure_file(config.win32.h config/config.h COPYONLY)
+endif()
+
+if(NOT DISABLE_INSTALL_HEADERS)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/config/libgnuintl.h" DESTINATION include RENAME libintl.h)
+endif()
+
+file(READ "${CMAKE_CURRENT_BINARY_DIR}/config/config.h" _contents)
+if(NOT WIN32)
+ string(REPLACE "/* #undef HAVE_STPCPY */" "#define HAVE_STPCPY 1" _contents "${_contents}")
+endif()
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/config/config.h" "${_contents}")
+
+FILE(GLOB SOURCES
+ "intl/bindtextdom.c"
+ "intl/dcgettext.c"
+ "intl/dcigettext.c"
+ "intl/dcngettext.c"
+ "intl/dgettext.c"
+ "intl/dngettext.c"
+ "intl/explodename.c"
+ "intl/finddomain.c"
+ "intl/gettext.c"
+ "intl/hash-string.c"
+ "intl/intl-compat.c"
+ "intl/l10nflist.c"
+ "intl/langprefs.c"
+ "intl/loadmsgcat.c"
+ "intl/localealias.c"
+ "intl/localename.c"
+ "intl/lock.c"
+ "intl/log.c"
+ "intl/ngettext.c"
+ "intl/osdep.c"
+ "intl/plural-exp.c"
+ "intl/plural.c"
+ "intl/printf.c"
+ "intl/relocatable.c"
+ "intl/textdomain.c"
+ "intl/version.c"
+)
+if(NOT WIN32)
+ list(APPEND SOURCES "intl/setlocale.c")
+endif()
+
+set(LOCALDIR "c:/gettext")
+
+add_definitions(-DLOCALEDIR=\"${LOCALDIR}\")
+add_definitions(-DLOCALE_ALIAS_PATH=\"${LOCALDIR}\")
+add_definitions(-DLIBDIR=\"${LOCALDIR}\")
+add_definitions(-DINSTALLDIR=\"${LOCALDIR}\")
+if(BUILD_SHARED_LIBS)
+ add_definitions(-DBUILDING_DLL)
+endif()
+add_definitions("-DBUILDING_LIBINTL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY")
+
+add_definitions("-DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -D_CRT_SECURE_NO_WARNINGS")
+
+add_library(libintl ${SOURCES})
+target_link_libraries(libintl PRIVATE unofficial::iconv::libcharset unofficial::iconv::libiconv)
+
+install(TARGETS libintl
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION bin
+ ARCHIVE DESTINATION lib
+)
+
diff --git a/ports/gettext/CMakeLists_libintl.txt b/ports/gettext/CMakeLists_libintl.txt deleted file mode 100644 index f01cf632c..000000000 --- a/ports/gettext/CMakeLists_libintl.txt +++ /dev/null @@ -1,54 +0,0 @@ -cmake_policy(SET CMP0005 OLD) - -project(libintl) - -include_directories(".") - -FILE(GLOB SOURCES -"intl/bindtextdom.c" -"intl/dcgettext.c" -"intl/dcigettext.c" -"intl/dcngettext.c" -"intl/dgettext.c" -"intl/dngettext.c" -"intl/explodename.c" -"intl/finddomain.c" -"intl/gettext.c" -"intl/hash-string.c" -"intl/intl-compat.c" -"intl/l10nflist.c" -"intl/langprefs.c" -"intl/loadmsgcat.c" -"intl/localcharset.c" -"intl/localealias.c" -"intl/localename.c" -"intl/lock.c" -"intl/log.c" -"intl/ngettext.c" -"intl/osdep.c" -"intl/plural-exp.c" -"intl/plural.c" -"intl/printf.c" -"intl/relocatable.c" -"intl/textdomain.c" -"intl/version.c" -) - -set(LOCALDIR "c:\\gettext") - -add_definitions(-DLOCALEDIR=\\\"${LOCALDIR}\\\") -add_definitions(-DLOCALE_ALIAS_PATH=\\\"${LOCALDIR}\\\") -add_definitions(-DLIBDIR=\\\"${LOCALDIR}\\\") -add_definitions(-DINSTALLDIR=\\\"${LOCALDIR}\\\") -add_definitions("-DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY") - -add_definitions("-DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -D_CRT_SECURE_NO_WARNINGS") - -add_library(libintl ${SOURCES}) - -install(TARGETS libintl - RUNTIME DESTINATION bin - LIBRARY DESTINATION bin - ARCHIVE DESTINATION lib -) - diff --git a/ports/gettext/CONTROL b/ports/gettext/CONTROL index 3ab837168..9044cd724 100644 --- a/ports/gettext/CONTROL +++ b/ports/gettext/CONTROL @@ -1,3 +1,4 @@ Source: gettext -Version: 0.19 +Version: 0.19-4 Description: The GNU gettext utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages +Build-Depends: libiconv diff --git a/ports/gettext/config.h b/ports/gettext/config.win32.h index cde9f23b4..0d3c1d34e 100644 --- a/ports/gettext/config.h +++ b/ports/gettext/config.win32.h @@ -1,6 +1,15 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +#ifndef WIN32 +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +# define _GL_INLINE static inline +#endif + +/* Disable function deprecated warnings */ +#define _CRT_NONSTDC_NO_WARNINGS + /* Define to the number of bits in type 'ptrdiff_t'. */ #define BITSIZEOF_PTRDIFF_T sizeof(ptrdiff_t) @@ -35,7 +44,7 @@ #define ENABLE_NLS 1 /* Define to 1 if the package shall run at any location in the filesystem. */ -/* #undef ENABLE_RELOCATABLE */ +#define ENABLE_RELOCATABLE 1 /* Define to 1 when using the gnulib module fwriteerror. */ #define GNULIB_FWRITEERROR 1 @@ -468,7 +477,9 @@ /* Define as the maximum value of type 'size_t', if the system doesn't define it. */ +#if defined(_WIN32) #define SIZE_MAX (((1UL << 31) - 1) * 2 + 1) +#endif /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'size_t'. */ @@ -604,7 +615,7 @@ /* Define as a signed type of the same size as size_t. */ #ifdef _WIN64 #define ssize_t __int64 -#else +#elif _WIN32 #define ssize_t __int32 #endif @@ -615,7 +626,7 @@ <inttypes.h> don't define. */ #ifdef _WIN64 #define uintmax_t unsigned __int64 -#else +#elif _WIN32 #define uintmax_t unsigned __int32 #endif diff --git a/ports/gettext/libgnuintl.h b/ports/gettext/libgnuintl.win32.h index eac6c8c25..440da4d59 100644 --- a/ports/gettext/libgnuintl.h +++ b/ports/gettext/libgnuintl.win32.h @@ -19,7 +19,7 @@ USA. */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 -#ifdef BUILDING_LIBINTL +#if defined(_WIN32) && defined(libintl_EXPORTS) #define LIBINTL_DLL_EXPORTED __declspec(dllexport) #else #define LIBINTL_DLL_EXPORTED diff --git a/ports/gettext/portfile.cmake b/ports/gettext/portfile.cmake index f14f7a707..cb5ea37c1 100644 --- a/ports/gettext/portfile.cmake +++ b/ports/gettext/portfile.cmake @@ -1,10 +1,7 @@ -# Common Ambient Variables: -# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg> -# TARGET_TRIPLET is the current triplet (x86-windows, etc) -# PORT is the current port name (zlib, etc) -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# +if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + return() +endif() #Based on https://github.com/winlibs/gettext @@ -17,28 +14,31 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_libintl.txt DESTINATION ${SOURCE_PATH}/gettext-runtime) -file(RENAME ${SOURCE_PATH}/gettext-runtime/CMakeLists_libintl.txt ${SOURCE_PATH}/gettext-runtime/CMakeLists.txt) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/libgnuintl.h DESTINATION ${SOURCE_PATH}/gettext-runtime/intl) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH}/gettext-runtime) +file(COPY + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_LIST_DIR}/config.win32.h + DESTINATION ${SOURCE_PATH}/gettext-runtime +) +file(REMOVE ${SOURCE_PATH}/gettext-runtime/intl/libgnuintl.h ${SOURCE_PATH}/gettext-runtime/config.h) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/libgnuintl.win32.h DESTINATION ${SOURCE_PATH}/gettext-runtime/intl) vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ + SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Fix-macro-definitions.patch" + "${CMAKE_CURRENT_LIST_DIR}/0002-Fix-uwp-build.patch" ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH}/gettext-runtime + PREFER_NINJA + OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON ) vcpkg_install_cmake() -file(COPY ${SOURCE_PATH}/gettext-runtime/intl/libgnuintl.h DESTINATION ${CURRENT_PACKAGES_DIR}/include) -file(RENAME ${CURRENT_PACKAGES_DIR}/include/libgnuintl.h ${CURRENT_PACKAGES_DIR}/include/libintl.h) - # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gettext) file(RENAME ${CURRENT_PACKAGES_DIR}/share/gettext/COPYING ${CURRENT_PACKAGES_DIR}/share/gettext/copyright) -vcpkg_copy_pdbs()
\ No newline at end of file +vcpkg_copy_pdbs() |
