mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
[gettext] Improve and simplify port
This commit is contained in:
parent
5a83ee1361
commit
01ba04e9a7
@ -1,7 +1,7 @@
|
||||
diff --git "a/gettext-0.19/gettext-runtime/intl/langprefs.c" "b/gettext-0.19/gettext-runtime/intl/langprefs.c"
|
||||
diff --git "a/gettext-runtime/intl/langprefs.c" "b/gettext-runtime/intl/langprefs.c"
|
||||
index aeb1c4e9..2ac531be 100644
|
||||
--- "a/gettext-0.19/gettext-runtime/intl/langprefs.c"
|
||||
+++ "b/gettext-0.19/gettext-runtime/intl/langprefs.c"
|
||||
--- "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
|
||||
|
||||
@ -17,10 +17,10 @@ index aeb1c4e9..2ac531be 100644
|
||||
#endif
|
||||
|
||||
#ifdef WIN32_NATIVE
|
||||
diff --git "a/gettext-0.19/gettext-runtime/intl/localcharset.c" "b/gettext-0.19/gettext-runtime/intl/localcharset.c"
|
||||
diff --git "a/gettext-runtime/intl/localcharset.c" "b/gettext-runtime/intl/localcharset.c"
|
||||
index 670b8e6c..035a96bd 100644
|
||||
--- "a/gettext-0.19/gettext-runtime/intl/localcharset.c"
|
||||
+++ "b/gettext-0.19/gettext-runtime/intl/localcharset.c"
|
||||
--- "a/gettext-runtime/intl/localcharset.c"
|
||||
+++ "b/gettext-runtime/intl/localcharset.c"
|
||||
@@ -36,6 +36,16 @@
|
||||
# define WINDOWS_NATIVE
|
||||
#endif
|
||||
@ -56,10 +56,10 @@ index 670b8e6c..035a96bd 100644
|
||||
|
||||
static char buf[2 + 10 + 1];
|
||||
|
||||
diff --git "a/gettext-0.19/gettext-runtime/intl/localename.c" "b/gettext-0.19/gettext-runtime/intl/localename.c"
|
||||
diff --git "a/gettext-runtime/intl/localename.c" "b/gettext-runtime/intl/localename.c"
|
||||
index 108dd6f1..ace3aa88 100644
|
||||
--- "a/gettext-0.19/gettext-runtime/intl/localename.c"
|
||||
+++ "b/gettext-0.19/gettext-runtime/intl/localename.c"
|
||||
--- "a/gettext-runtime/intl/localename.c"
|
||||
+++ "b/gettext-runtime/intl/localename.c"
|
||||
@@ -54,7 +54,13 @@
|
||||
#endif
|
||||
|
||||
|
@ -1 +1,65 @@
|
||||
add_subdirectory(gettext-runtime)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(libintl C)
|
||||
|
||||
find_library(ICONV_LIB NAMES iconv libiconv)
|
||||
find_path(ICONV_PATH iconv.h)
|
||||
|
||||
find_library(CHARSET_LIB NAMES charset libcharset)
|
||||
find_path(CHARSET_PATH localcharset.h)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} . ${ICONV_PATH} ${CHARSET_PATH})
|
||||
link_libraries(${CHARSET_LIB} ${ICONV_LIB})
|
||||
|
||||
file(READ 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.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"
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -1,3 +1,4 @@
|
||||
Source: gettext
|
||||
Version: 0.19-2
|
||||
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
|
||||
|
@ -1,6 +1,12 @@
|
||||
/* 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
|
||||
|
||||
@ -471,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'. */
|
||||
@ -607,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
|
||||
|
||||
@ -618,7 +626,7 @@
|
||||
<inttypes.h> don't define. */
|
||||
#ifdef _WIN64
|
||||
#define uintmax_t unsigned __int64
|
||||
#else
|
||||
#elif _WIN32
|
||||
#define uintmax_t unsigned __int32
|
||||
#endif
|
||||
|
||||
|
@ -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
|
||||
|
@ -17,20 +17,19 @@ 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}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/gettext-runtime)
|
||||
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)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
Loading…
x
Reference in New Issue
Block a user