early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,80 @@
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
-# 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 @@
# include <locale.h>
#endif
+#if 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
@@ -830,7 +830,7 @@ STATIC
const char *
locale_charset (void)
{
- const char *codeset;
+ const char *codeset = NULL;
/* This function must be multithread-safe. To achieve this without using
thread-local storage, we use a simple strcpy or memcpy to fill this static
@@ -912,7 +912,7 @@ locale_charset (void)
/* The canonical name cannot be determined. */
codeset = "";
-# elif defined WINDOWS_NATIVE
+# elif defined WINDOWS_NATIVE && defined HAVE_ACP
char buf[2 + 10 + 1];
static char resultbuf[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"
@@ -75,10 +75,16 @@
#endif
#if defined _WIN32 && !defined __CYGWIN__
-# 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
# if !defined IN_LIBINTL
# include "glthread/lock.h"
# endif
#endif
#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */

View File

@@ -0,0 +1,60 @@
diff --git "a/gettext-runtime/intl/loadmsgcat.c" "b/gettext-runtime/intl/loadmsgcat.c"
index 63351523..c078de3f 100644
--- a/gettext-runtime/intl/loadmsgcat.c
+++ b/gettext-runtime/intl/loadmsgcat.c
@@ -388,6 +388,55 @@ char *alloca ();
# define munmap(addr, len) __munmap (addr, len)
#endif
+#ifdef _WIN32
+/* Provide wrapper of "open" for Windows that supports UTF-8 filenames. */
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# ifndef WIN32_EXTRA_LEAN
+# define WIN32_EXTRA_LEAN
+# endif
+# undef NOMINMAX
+# define NOMINMAX
+# include <windows.h> // For: MultiByteToWideChar
+# include <io.h>
+# include <wchar.h>
+
+int _open_utf8_windows_wrapper(
+ const char *filename,
+ int flags
+)
+{
+ int wstr_len = -1;
+ wchar_t* pUtf16FileName = NULL;
+ int fh = -1;
+
+ // on Windows, convert the filename from UTF-8 to UTF-16
+ wstr_len = MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);
+ if (wstr_len <= 0)
+ {
+ // MultiByteToWideChar failed
+ errno = ENOENT;
+ return -1;
+ }
+ pUtf16FileName = malloc(wstr_len * sizeof(wchar_t));
+ if (MultiByteToWideChar(CP_UTF8, 0, filename, -1, pUtf16FileName, wstr_len) == 0)
+ {
+ // MultiByteToWideChar failed
+ free(pUtf16FileName);
+ errno = ENOENT;
+ return -1;
+ }
+
+ // and call _wopen
+ fh = _wopen(pUtf16FileName, flags);
+
+ free(pUtf16FileName);
+ return fh;
+}
+# define open(name, flags) _open_utf8_windows_wrapper(name, flags)
+#endif // #ifdef _WIN32
+
/* For those losing systems which don't have `alloca' we have to add
some additional code emulating it. */
#ifdef HAVE_ALLOCA

View File

@@ -0,0 +1,116 @@
--- a/gettext-runtime/gnulib-lib/fcntl.c 2022-01-11 11:11:28.406622100 +0700
+++ b/gettext-runtime/gnulib-lib/fcntl.c 2022-01-11 11:11:03.406190800 +0700
@@ -38,6 +38,10 @@
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
+#define HANDLE_FLAG_INHERIT 0
+#endif
+
/* Get _get_osfhandle. */
# if GNULIB_MSVC_NOTHROW
# include "msvc-nothrow.h"
--- a/gettext-tools/gnulib-lib/fcntl.c 2022-01-11 11:11:28.406622100 +0700
+++ b/gettext-tools/gnulib-lib/fcntl.c 2022-01-11 11:11:03.406190800 +0700
@@ -38,6 +38,10 @@
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
+#define HANDLE_FLAG_INHERIT 0
+#endif
+
/* Get _get_osfhandle. */
# if GNULIB_MSVC_NOTHROW
# include "msvc-nothrow.h"
--- a/gettext-tools/src/hostname.c 2022-01-12 01:41:13.725124300 +0700
+++ b/gettext-tools/src/hostname.c 2022-01-12 01:47:39.384274300 +0700
@@ -35,15 +35,15 @@
/* Get gethostname(). */
#include <unistd.h>
+#if !HAVE_GETHOSTNAME
#ifdef WIN32_NATIVE
/* Native Woe32 API lacks gethostname() but has GetComputerName() instead. */
# include <windows.h>
#else
/* Some systems, like early Solaris versions, lack gethostname() but
have uname() instead. */
-# if !HAVE_GETHOSTNAME
-# include <sys/utsname.h>
-# endif
+# include <sys/utsname.h>
+#endif
#endif
/* Get MAXHOSTNAMELEN. */
@@ -56,6 +56,9 @@
/* Support for using gethostbyname(). */
#if HAVE_GETHOSTBYNAME
+#if HAVE_WINSOCK2_H
+# include <winsock2.h>
+#else
# include <sys/types.h>
# include <sys/socket.h> /* defines AF_INET, AF_INET6 */
# include <netinet/in.h> /* declares ntohs(), defines struct sockaddr_in */
@@ -77,6 +80,7 @@
# endif
# include <netdb.h> /* defines struct hostent, declares gethostbyname() */
#endif
+#endif
/* Include this after <sys/socket.h>, to avoid a syntax error on BeOS. */
#include <stdbool.h>
@@ -250,7 +254,7 @@
static char *
xgethostname ()
{
-#ifdef WIN32_NATIVE
+#ifdef WIN32_NATIVE && !HAVE_GETHOSTNAME
char hostname[MAX_COMPUTERNAME_LENGTH+1];
DWORD size = sizeof (hostname);
--- a/libtextstyle/lib/fcntl.c 2020-06-27 03:00:38.000000000 +0700
+++ b/libtextstyle/lib/fcntl.c 2022-01-11 11:10:29.936269800 +0700
@@ -38,6 +38,10 @@
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
+#define HANDLE_FLAG_INHERIT 0
+#endif
+
/* Get _get_osfhandle. */
# if GNULIB_MSVC_NOTHROW
# include "msvc-nothrow.h"
--- a/libtextstyle/lib/isatty.c 2020-06-27 03:00:40.000000000 +0700
+++ b/libtextstyle/lib/isatty.c 2022-01-11 11:19:04.852685700 +0700
@@ -99,6 +99,7 @@
BOOL result = FALSE;
ULONG processId;
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
#if !(_WIN32_WINNT >= _WIN32_WINNT_VISTA)
if (!initialized)
initialize ();
@@ -137,6 +138,7 @@
CloseHandle (processHandle);
}
}
+#endif // !WINAPI_FAMILY_APP
return result;
}
--- a/libtextstyle/lib/unistd.in.h 2020-07-08 08:33:18.000000000 +0700
+++ b/libtextstyle/lib/unistd.in.h 2022-01-11 22:11:46.402435600 +0700
@@ -828,7 +828,7 @@
Null terminate it if the name is shorter than LEN.
If the host name is longer than LEN, set errno = EINVAL and return -1.
Return 0 if successful, otherwise set errno and return -1. */
-# if @UNISTD_H_HAVE_WINSOCK2_H@
+# if !@HAVE_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gethostname
# define gethostname rpl_gethostname

70
externals/vcpkg/ports/gettext/Makefile vendored Executable file
View File

@@ -0,0 +1,70 @@
all: build-gettext-runtime-intl build-gettext-runtime-po build-gettext-runtime-src
all: build-gettext-tools build-gettext-tools-gnulib build-gettext-tools-its build-gettext-tools-m4 build-gettext-tools-misc build-gettext-tools-po build-gettext-tools-projects build-gettext-tools-styles
all: build-libtextstyle
install: install-gettext-runtime-intl install-gettext-runtime-po install-gettext-runtime-src
install: install-gettext-tools install-gettext-tools-gnulib install-gettext-tools-its install-gettext-tools-m4 install-gettext-tools-misc install-gettext-tools-po install-gettext-tools-projects install-gettext-tools-styles
install: install-libtextstyle
build-intl:
$(MAKE) -C intl all
install-intl:
$(MAKE) -C intl install
build-gettext-runtime-gnulib: build-gettext-runtime-intl
$(MAKE) -C gettext-runtime/gnulib-lib all
build-gettext-runtime-intl:
$(MAKE) -C gettext-runtime/intl all
build-gettext-runtime-po:
$(MAKE) -C gettext-runtime/po all
build-gettext-runtime-src: build-gettext-runtime-intl build-gettext-runtime-gnulib
$(MAKE) -C gettext-runtime/src all
build-gettext-tools: build-gettext-runtime-intl build-libtextstyle build-gettext-tools-gnulib build-gettext-tools-intl build-gettext-tools-libgrep build-gnulib-local
$(MAKE) -C gettext-tools/src all
build-gettext-tools-gnulib: build-gettext-tools-intl
$(MAKE) -C gettext-tools/gnulib-lib all
build-gettext-tools-libgrep: build-gettext-tools-gnulib
$(MAKE) -C gettext-tools/libgrep all
build-gettext-tools-intl:
$(MAKE) -C gettext-tools/intl all
build-gettext-tools-its:
$(MAKE) -C gettext-tools/its all
build-gettext-tools-m4:
$(MAKE) -C gettext-tools/m4 all
build-gettext-tools-misc:
$(MAKE) -C gettext-tools/misc all
build-gettext-tools-po:
$(MAKE) -C gettext-tools/po all
build-gettext-tools-projects:
$(MAKE) -C gettext-tools/projects all
build-gettext-tools-styles:
$(MAKE) -C gettext-tools/styles all
build-gnulib-local:
$(MAKE) -C gnulib-local all
build-libtextstyle:
$(MAKE) -C libtextstyle/lib all
install-gettext-runtime-intl:
$(MAKE) -C gettext-runtime/intl install
install-gettext-runtime-po:
$(MAKE) -C gettext-runtime/po install
install-gettext-runtime-src:
$(MAKE) -C gettext-runtime/src install
install-gettext-tools:
$(MAKE) -C gettext-tools/src install
install-gettext-tools-gnulib:
$(MAKE) -C gettext-tools/gnulib-lib install
install-gettext-tools-its:
$(MAKE) -C gettext-tools/its install
install-gettext-tools-m4:
$(MAKE) -C gettext-tools/m4 install
install-gettext-tools-misc:
$(MAKE) -C gettext-tools/misc install
install-gettext-tools-po:
$(MAKE) -C gettext-tools/po install
install-gettext-tools-projects:
$(MAKE) -C gettext-tools/projects install
install-gettext-tools-styles:
$(MAKE) -C gettext-tools/styles install
install-libtextstyle:
$(MAKE) -C libtextstyle/lib install

12
externals/vcpkg/ports/gettext/android.patch vendored Executable file
View File

@@ -0,0 +1,12 @@
diff --color -ruN a/gettext-runtime/intl/dcigettext.c src/gettext-runtime/intl/dcigettext.c
--- a/gettext-runtime/intl/dcigettext.c 2021-05-26 16:27:55.420544597 +0200
+++ src/gettext-runtime/intl/dcigettext.c 2021-05-26 16:29:14.546516701 +0200
@@ -143,7 +143,7 @@
# else
# if VMS
# define getcwd(buf, max) (getcwd) (buf, max, 0)
-# else
+# elif !(defined(__clang__) && defined(__BIONIC_FORTIFY))
char *getcwd ();
# endif
# endif

View File

@@ -0,0 +1,14 @@
X-Git-Url: https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blobdiff_plain;f=gettext-tools%2Fwoe32dll%2Fgettextsrc-exports.c;h=6d760895961db57e013552b6b3f248bfa8eb17c2;hp=4477ae8d4b2e887592d4019432b91ea31b84ba59;hb=7cf68dffb2adb76375bfb0781e277510523a1f3e;hpb=3564f5f885544514bd2e345c36b74e5d91cad3e8
diff --git a/gettext-tools/woe32dll/gettextsrc-exports.c b/gettext-tools/woe32dll/gettextsrc-exports.c
index 4477ae8..6d76089 100644
--- a/gettext-tools/woe32dll/gettextsrc-exports.c
+++ b/gettext-tools/woe32dll/gettextsrc-exports.c
@@ -50,6 +50,7 @@ VARIABLE(formatstring_python)
VARIABLE(formatstring_python_brace)
VARIABLE(formatstring_qt)
VARIABLE(formatstring_qt_plural)
+VARIABLE(formatstring_ruby)
VARIABLE(formatstring_scheme)
VARIABLE(formatstring_sh)
VARIABLE(formatstring_smalltalk)

View File

@@ -0,0 +1,49 @@
function(install_autopoint)
# variables for configuring autopoint.in
set(PACKAGE "gettext-tools")
set(VERSION "${GETTEXT_VERSION}")
set(ARCHIVE_VERSION "${GETTEXT_VERSION}")
set(ARCHIVE_FORMAT "dirgz")
set(bindir [[${prefix}/tools/gettext/bin]])
set(datadir [[${datarootdir}]])
set(exec_prefix [[${prefix}]])
set(PATH_SEPARATOR ":")
set(RELOCATABLE "yes")
file(STRINGS "${SOURCE_PATH}/gettext-tools/configure"
VERSIONS_FROM_CONFIGURE
REGEX "^ *(ARCHIVE_VERSION|VERSION)=.*$"
)
foreach(LINE IN LISTS VERSIONS_FROM_CONFIGURE)
if(LINE MATCHES "^ *(ARCHIVE_VERSION|VERSION)='?([0-9.]+)'?$")
set(${CMAKE_MATCH_1} "${CMAKE_MATCH_2}")
endif()
endforeach()
set(WORKING_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
file(MAKE_DIRECTORY "${WORKING_DIR}")
# autopoint script
configure_file("${SOURCE_PATH}/gettext-tools/misc/autopoint.in" "${WORKING_DIR}/autopoint" @ONLY)
# data tarball
if(WIN32)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES gzip)
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
endif()
file(COPY "${SOURCE_PATH}/gettext-tools/misc/archive.dir.tar" DESTINATION "${WORKING_DIR}")
vcpkg_execute_required_process(
COMMAND gzip -f archive.dir.tar
WORKING_DIRECTORY "${WORKING_DIR}"
LOGNAME gzip-${TARGET_TRIPLET}
)
# installation
file(INSTALL "${WORKING_DIR}/autopoint" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin"
FILE_PERMISSIONS
OWNER_WRITE OWNER_READ OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
file(INSTALL "${WORKING_DIR}/archive.dir.tar.gz" DESTINATION "${CURRENT_PACKAGES_DIR}/share/gettext/gettext")
endfunction()

165
externals/vcpkg/ports/gettext/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,165 @@
if(VCPKG_TARGET_IS_LINUX AND NOT EXISTS "/usr/include/libintl.h")
message(FATAL_ERROR "When targeting Linux, `libintl.h` is expected to come from the C Runtime Library (glibc). "
"Please use \"sudo apt-get install libc-dev\" or the equivalent to install development files."
)
endif()
set(VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS enabled)
#Based on https://github.com/winlibs/gettext
set(GETTEXT_VERSION 0.21)
vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnu.org/pub/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz"
FILENAME "gettext-${GETTEXT_VERSION}.tar.gz"
SHA512 bbe590c5dd3580c75bf30ff768da99a88eb8d466ec1ac9eea20be4cab4357ecf72448e6b81b47425e39d50fa6320ba426632914d7898dfebb4f159abc39c31d1
)
set(PATCHES "")
if(VCPKG_TARGET_IS_UWP)
set(PATCHES uwp_remove_localcharset.patch)
endif()
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE "${ARCHIVE}"
REF "${GETTEXT_VERSION}"
PATCHES
0002-Fix-uwp-build.patch
0003-Fix-win-unicode-paths.patch
0004-Fix-uwp-tools-build.patch
rel_path.patch
android.patch
gettext-tools_woe32dll_gettextsrc-exports.c.patch
${PATCHES}
)
vcpkg_find_acquire_program(BISON)
get_filename_component(BISON_PATH "${BISON}" DIRECTORY)
vcpkg_add_to_path("${BISON_PATH}")
set(OPTIONS
--enable-relocatable #symbol duplication with glib-init.c?
--enable-c++
--disable-acl
--disable-csharp
--disable-curses
--disable-java
--disable-openmp
)
if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND OPTIONS
# Avoid unnecessary test.
--with-included-glib
# This is required. For some reason these do not get correctly identified for release builds.
ac_cv_func_wcslen=yes
ac_cv_func_memmove=yes
# The following are required for a full gettext built (libintl and tools).
gl_cv_func_printf_directive_n=no # segfaults otherwise with popup window
ac_cv_func_memset=yes # not detected in release builds
ac_cv_header_pthread_h=no
ac_cv_header_dirent_h=no
ac_cv_header_getopt_h=no
)
endif()
# These functions scope any changes to VCPKG_BUILD_TYPE
function(build_libintl_and_tools)
cmake_parse_arguments(arg "" "BUILD_TYPE" "" ${ARGN})
if(DEFINED arg_BUILD_TYPE)
set(VCPKG_BUILD_TYPE "${arg_BUILD_TYPE}")
endif()
vcpkg_configure_make(SOURCE_PATH "${SOURCE_PATH}"
DETERMINE_BUILD_TRIPLET
USE_WRAPPERS
ADD_BIN_TO_PATH # So configure can check for working iconv
ADDITIONAL_MSYS_PACKAGES gzip
OPTIONS
${OPTIONS}
)
vcpkg_install_make(MAKEFILE "${CMAKE_CURRENT_LIST_DIR}/Makefile")
endfunction()
function(build_libintl_only)
cmake_parse_arguments(arg "" "BUILD_TYPE" "" ${ARGN})
if(DEFINED arg_BUILD_TYPE)
set(VCPKG_BUILD_TYPE "${arg_BUILD_TYPE}")
endif()
vcpkg_configure_make(SOURCE_PATH "${SOURCE_PATH}/gettext-runtime"
DETERMINE_BUILD_TRIPLET
USE_WRAPPERS
ADD_BIN_TO_PATH # So configure can check for working iconv
OPTIONS
${OPTIONS}
)
vcpkg_install_make(
MAKEFILE "${CMAKE_CURRENT_LIST_DIR}/Makefile"
BUILD_TARGET build-intl
INSTALL_TARGET install-intl
)
endfunction()
if("tools" IN_LIST FEATURES)
# Minimization of gettext tools build time by:
# - building tools only for release configuration
# - custom top-level Makefile
# - configuration cache
list(APPEND OPTIONS "--cache-file=../config.cache-${TARGET_TRIPLET}")
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/config.cache-${TARGET_TRIPLET}")
build_libintl_and_tools(BUILD_TYPE "release")
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
file(GLOB tool_libs
LIST_DIRECTORIES false
"${CURRENT_PACKAGES_DIR}/bin/*"
"${CURRENT_PACKAGES_DIR}/lib/*"
)
list(FILTER tool_libs EXCLUDE REGEX "intl[^/\\\\]*$")
file(REMOVE ${tool_libs})
file(GLOB tool_includes
LIST_DIRECTORIES true
"${CURRENT_PACKAGES_DIR}/include/*"
)
list(FILTER tool_includes EXCLUDE REGEX "intl[^/\\\\]*$")
file(REMOVE_RECURSE ${tool_includes})
if(VCPKG_TARGET_IS_LINUX)
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
elseif(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}.release")
file(RENAME "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}.release")
file(READ "${CURRENT_BUILDTREES_DIR}/config.cache-${TARGET_TRIPLET}" config_cache)
string(REGEX REPLACE "\nac_cv_env[^\n]*" "" config_cache "${config_cache}") # Eliminate build type flags
file(WRITE "${CURRENT_BUILDTREES_DIR}/config.cache-${TARGET_TRIPLET}" "${config_cache}")
build_libintl_only(BUILD_TYPE "debug")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}.release/debug")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}")
file(RENAME "${CURRENT_PACKAGES_DIR}.release" "${CURRENT_PACKAGES_DIR}")
endif()
else()
if(VCPKG_TARGET_IS_LINUX)
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
else()
list(APPEND OPTIONS "--config-cache")
build_libintl_only()
endif()
# A fast installation of the autopoint tool and data, needed for autotools
include("${CMAKE_CURRENT_LIST_DIR}/install-autopoint.cmake")
install_autopoint()
endif()
# Handle copyright
configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/gettext/copyright" COPYONLY)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_copy_pdbs()
if(NOT VCPKG_TARGET_IS_LINUX)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/intl")
endif()
if("tools" IN_LIST FEATURES AND NOT VCPKG_CROSSCOMPILING)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/gettext")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/gettext/user-email")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/gettext/user-email" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../..")
endif()

31
externals/vcpkg/ports/gettext/rel_path.patch vendored Executable file
View File

@@ -0,0 +1,31 @@
diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in
index 3a24eee5d..56b36d5ff 100644
--- a/gettext-tools/misc/autopoint.in
+++ b/gettext-tools/misc/autopoint.in
@@ -27,8 +27,9 @@ archive_version=@ARCHIVE_VERSION@
# Set variables
# - gettext_datadir directory where the data files are stored.
-prefix="@prefix@"
-datarootdir="@datarootdir@"
+
+prefix="$(dirname "$0")/../../../"
+datarootdir="${prefix}/share/gettext"
: ${gettext_datadir="@datadir@/gettext"}
: ${AUTOM4TE=autom4te}
diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.in
index c78c308bf..175ad57e7 100644
--- a/gettext-tools/misc/gettextize.in
+++ b/gettext-tools/misc/gettextize.in
@@ -27,8 +27,8 @@ archive_version=@ARCHIVE_VERSION@
# Set variables
# - gettext_datadir directory where the data files are stored.
-prefix="@prefix@"
-datarootdir="@datarootdir@"
+prefix="$(dirname "$0")/../../../"
+datarootdir="${prefix}/share/gettext"
: ${gettext_datadir="@datadir@/gettext"}
: ${AUTOM4TE=autom4te}

View File

@@ -0,0 +1,79 @@
diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in
index 7999d3456..b3ef40340 100644
--- a/gettext-runtime/intl/Makefile.in
+++ b/gettext-runtime/intl/Makefile.in
@@ -252,7 +252,7 @@ am__libgnuintl_la_SOURCES_DIST = bindtextdom.c dcgettext.c dgettext.c \
gettext.c finddomain.c hash-string.c loadmsgcat.c \
localealias.c textdomain.c l10nflist.c explodename.c \
dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
- plural-exp.c localcharset.c threadlib.c lock.c relocatable.c \
+ plural-exp.c threadlib.c lock.c relocatable.c \
langprefs.c localename.c localename-table.c log.c printf.c \
setlocale.c setlocale-lock.c setlocale_null.c version.c \
xsize.c osdep.c intl-compat.c windows-mutex.c windows-rwlock.c \
@@ -264,7 +264,7 @@ am__objects_2 = bindtextdom.lo dcgettext.lo dgettext.lo gettext.lo \
finddomain.lo hash-string.lo loadmsgcat.lo localealias.lo \
textdomain.lo l10nflist.lo explodename.lo dcigettext.lo \
dcngettext.lo dngettext.lo ngettext.lo plural.lo plural-exp.lo \
- localcharset.lo threadlib.lo lock.lo relocatable.lo \
+ threadlib.lo lock.lo relocatable.lo \
langprefs.lo localename.lo localename-table.lo log.lo \
printf.lo setlocale.lo setlocale-lock.lo setlocale_null.lo \
version.lo xsize.lo osdep.lo intl-compat.lo $(am__objects_1)
@@ -282,7 +282,7 @@ am__libintl_la_SOURCES_DIST = bindtextdom.c dcgettext.c dgettext.c \
gettext.c finddomain.c hash-string.c loadmsgcat.c \
localealias.c textdomain.c l10nflist.c explodename.c \
dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \
- plural-exp.c localcharset.c threadlib.c lock.c relocatable.c \
+ plural-exp.c threadlib.c lock.c relocatable.c \
langprefs.c localename.c localename-table.c log.c printf.c \
setlocale.c setlocale-lock.c setlocale_null.c version.c \
xsize.c osdep.c intl-compat.c windows-mutex.c windows-rwlock.c \
@@ -1387,7 +1387,7 @@ AUTOMAKE_OPTIONS = 1.10 gnu no-dependencies
# Miscellaneous files.
EXTRA_DIST = gmo.h gettextP.h hash-string.h loadinfo.h plural-exp.h \
- eval-plural.h localcharset.h lock.h windows-mutex.h \
+ eval-plural.h lock.h windows-mutex.h \
windows-rwlock.h windows-recmutex.h windows-once.h \
windows-initguard.h relocatable.h arg-nonnull.h attribute.h \
filename.h flexmember.h localename-table.in.h setlocale_null.h \
@@ -1543,7 +1543,7 @@ LIBINTLSOURCES = bindtextdom.c dcgettext.c dgettext.c gettext.c \
finddomain.c hash-string.c loadmsgcat.c localealias.c \
textdomain.c l10nflist.c explodename.c dcigettext.c \
dcngettext.c dngettext.c ngettext.c plural.y plural-exp.c \
- localcharset.c threadlib.c lock.c relocatable.c langprefs.c \
+ threadlib.c lock.c relocatable.c langprefs.c \
localename.c localename-table.c log.c printf.c setlocale.c \
setlocale-lock.c setlocale_null.c version.c xsize.c osdep.c \
intl-compat.c $(am__append_2)
@@ -2016,8 +2016,6 @@ plural.lo: $(srcdir)/plural.c
$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/plural.c
plural-exp.lo: $(srcdir)/plural-exp.c
$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/plural-exp.c
-localcharset.lo: $(srcdir)/localcharset.c
- $(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/localcharset.c
threadlib.lo: $(srcdir)/threadlib.c
$(AM_V_CC)$(LTCOMPILE) -c -o $@ $(srcdir)/threadlib.c
lock.lo: $(srcdir)/lock.c
@@ -2074,7 +2072,6 @@ dngettext.lo: ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo
ngettext.lo: ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
plural.lo: ../config.h $(srcdir)/plural-exp.h $(PLURAL_DEPS)
plural-exp.lo: ../config.h $(srcdir)/plural-exp.h
-localcharset.lo: ../config.h $(srcdir)/localcharset.h
threadlib.lo: ../config.h
lock.lo: ../config.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
relocatable.lo: ../config.h $(srcdir)/relocatable.h
diff --git a/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c
index 1a1627888..3e6582f17 100644
--- a/gettext-runtime/intl/localcharset.c
+++ b/gettext-runtime/intl/localcharset.c
@@ -1021,7 +1021,7 @@ locale_charset (void)
# else
-# error "Add code for other platforms here."
+//# error "Add code for other platforms here."
# endif

View File

@@ -0,0 +1,14 @@
_find_package(${ARGS})
if(Intl_FOUND AND Intl_LIBRARIES)
include(SelectLibraryConfigurations)
find_library(Intl_LIBRARY_DEBUG NAMES intl libintl intl-8 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH)
find_library(Intl_LIBRARY_RELEASE NAMES intl libintl intl-8 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
unset(Intl_LIBRARIES)
unset(Intl_LIBRARIES CACHE)
select_library_configurations(Intl)
find_package(Iconv) # Since CMake 3.11
if(Iconv_FOUND AND NOT Iconv_IS_BUILT_IN)
list(APPEND Intl_LIBRARIES ${Iconv_LIBRARIES})
endif()
endif()

View File

@@ -0,0 +1,6 @@
get_filename_component(gettext_tools_dir "${CMAKE_CURRENT_LIST_DIR}/../../tools/gettext/bin" ABSOLUTE)
if(CMAKE_HOST_WIN32)
set(ENV{PATH} "$ENV{PATH};${gettext_tools_dir}")
else()
set(ENV{PATH} "$ENV{PATH}:${gettext_tools_dir}")
endif()

15
externals/vcpkg/ports/gettext/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,15 @@
{
"name": "gettext",
"version": "0.21",
"port-version": 9,
"description": "GNU gettext provides libintl and a set of tools to help produce multi-lingual messages.",
"homepage": "https://www.gnu.org/software/gettext/",
"dependencies": [
"libiconv"
],
"features": {
"tools": {
"description": "Build gettext tools"
}
}
}