[gettext] Update to 0.21.1 (#29113)

* Use VERSION

* Update to 0.21.1

* Update win unicode paths patch

* Revise uwp patches

* Cleanup

* Build tools for uwp in CI

* tools not supported on uwp

* Add license GPL3.0-or-later.

gettext.c has:

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

* Fix license, but better.

* Version database

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Kai Pastor 2023-01-27 16:25:29 +01:00 committed by GitHub
parent 30016cf1d1
commit 6b3a1a2188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 158 additions and 336 deletions

View File

@ -1,80 +0,0 @@
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

@ -1,12 +1,16 @@
diff --git "a/gettext-runtime/intl/loadmsgcat.c" "b/gettext-runtime/intl/loadmsgcat.c"
index 63351523..c078de3f 100644
diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c
index d5a5fe1..5c47f48 100644
--- a/gettext-runtime/intl/loadmsgcat.c
+++ b/gettext-runtime/intl/loadmsgcat.c
@@ -388,6 +388,55 @@ char *alloca ();
@@ -390,9 +390,56 @@ char *alloca ();
# define munmap(addr, len) __munmap (addr, len)
#endif
+#ifdef _WIN32
#elif defined _WIN32 && !defined __CYGWIN__
/* On native Windows, don't require linking with '-loldnames'. */
-# define open _open
+# define open(name, flags) _open_utf8_windows_wrapper(name, flags)
# define read _read
# define close _close
+
+/* Provide wrapper of "open" for Windows that supports UTF-8 filenames. */
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
@ -14,8 +18,9 @@ index 63351523..c078de3f 100644
+# ifndef WIN32_EXTRA_LEAN
+# define WIN32_EXTRA_LEAN
+# endif
+# undef NOMINMAX
+# define NOMINMAX
+# ifndef NOMINMAX
+# define NOMINMAX
+# endif
+# include <windows.h> // For: MultiByteToWideChar
+# include <io.h>
+# include <wchar.h>
@ -52,9 +57,6 @@ index 63351523..c078de3f 100644
+ free(pUtf16FileName);
+ return fh;
+}
+# define open(name, flags) _open_utf8_windows_wrapper(name, flags)
+#endif // #ifdef _WIN32
+
#endif
/* For those losing systems which don't have `alloca' we have to add
some additional code emulating it. */
#ifdef HAVE_ALLOCA

View File

@ -1,116 +0,0 @@
--- 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

View File

@ -1,14 +0,0 @@
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

@ -1,8 +1,7 @@
function(install_autopoint)
# variables for configuring autopoint.in
set(PACKAGE "gettext-tools")
set(VERSION "${GETTEXT_VERSION}")
set(ARCHIVE_VERSION "${GETTEXT_VERSION}")
set(ARCHIVE_VERSION "${VERSION}")
set(ARCHIVE_FORMAT "dirgz")
set(bindir [[${prefix}/tools/gettext/bin]])
set(datadir [[${datarootdir}]])

View File

@ -6,32 +6,23 @@ 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
URLS "https://ftp.gnu.org/pub/gnu/gettext/gettext-${VERSION}.tar.gz"
"https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gettext/gettext-${VERSION}.tar.gz"
FILENAME "gettext-${VERSION}.tar.gz"
SHA512 ccd43a43fab3c90ed99b3e27628c9aeb7186398153b137a4997f8c7ddfd9729b0ba9d15348567e5206af50ac027673d2b8a3415bb3fc65f87ad778f85dc03a05
)
set(PATCHES "")
if(VCPKG_TARGET_IS_UWP)
set(PATCHES uwp_remove_localcharset.patch)
endif()
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
vcpkg_extract_source_archive(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}
uwp.patch
win-gethostname.patch
0003-Fix-win-unicode-paths.patch
rel_path.patch
)
vcpkg_find_acquire_program(BISON)
get_filename_component(BISON_PATH "${BISON}" DIRECTORY)
vcpkg_add_to_path("${BISON_PATH}")
@ -76,6 +67,7 @@ function(build_libintl_and_tools)
${OPTIONS}
)
vcpkg_install_make(MAKEFILE "${CMAKE_CURRENT_LIST_DIR}/Makefile")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/gettext/user-email" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../..")
endfunction()
function(build_libintl_only)
@ -146,9 +138,6 @@ else()
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()
@ -157,9 +146,7 @@ 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")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
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()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/gettext-runtime/COPYING" "${SOURCE_PATH}/COPYING")

72
ports/gettext/uwp.patch Normal file
View File

@ -0,0 +1,72 @@
diff --git a/gettext-runtime/gnulib-lib/fcntl.c b/gettext-runtime/gnulib-lib/fcntl.c
index f9753c4..3a3caee 100644
--- a/gettext-runtime/gnulib-lib/fcntl.c
+++ b/gettext-runtime/gnulib-lib/fcntl.c
@@ -38,6 +38,12 @@
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+# if defined(WINAPI_FAMILY_PARTITION)
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+# define HANDLE_FLAG_INHERIT 0
+# endif
+# endif
+
/* Get _get_osfhandle. */
# if GNULIB_MSVC_NOTHROW
# include "msvc-nothrow.h"
diff --git a/gettext-runtime/intl/langprefs.c b/gettext-runtime/intl/langprefs.c
index f774ba2..f488b7f 100644
--- a/gettext-runtime/intl/langprefs.c
+++ b/gettext-runtime/intl/langprefs.c
@@ -38,6 +38,11 @@ extern void _nl_locale_name_canonicalize (char *name);
#if defined _WIN32
# define WIN32_NATIVE
+# if defined(WINAPI_FAMILY_PARTITION)
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+# undef WIN32_NATIVE
+# endif
+# endif
#endif
#ifdef WIN32_NATIVE
diff --git a/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c
index ec75427..9e063e4 100644
--- a/gettext-runtime/intl/localcharset.c
+++ b/gettext-runtime/intl/localcharset.c
@@ -34,6 +34,9 @@
#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
# include <locale.h>
+# if !defined(WINAPI_FAMILY_PARTITION)
+# define WINAPI_FAMILY_PARTITION(x) (0)
+# endif
#endif
#if defined __EMX__
@@ -912,6 +915,8 @@ locale_charset (void)
/* The canonical name cannot be determined. */
codeset = "";
+# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ codeset = "";
# elif defined WINDOWS_NATIVE
char buf[2 + 10 + 1];
diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c
index d77bb81..3c6e055 100644
--- a/gettext-runtime/intl/localename.c
+++ b/gettext-runtime/intl/localename.c
@@ -69,6 +69,11 @@ extern char * getlocalename_l(int, locale_t);
#if defined _WIN32 && !defined __CYGWIN__
# define WINDOWS_NATIVE
+# if defined(WINAPI_FAMILY_PARTITION)
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+# undef WIN32_NATIVE
+# endif
+# endif
# if !defined IN_LIBINTL
# include "glthread/lock.h"
# endif

View File

@ -1,79 +0,0 @@
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

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

View File

@ -0,0 +1,45 @@
diff --git a/gettext-tools/src/hostname.c b/gettext-tools/src/hostname.c
index e909637..c2e8065 100644
--- a/gettext-tools/src/hostname.c
+++ b/gettext-tools/src/hostname.c
@@ -29,7 +29,9 @@
#include <locale.h>
#if defined _WIN32
+# if !HAVE_GETHOSTNAME
# define WIN32_NATIVE
+# endif
#endif
/* Get gethostname(). */
@@ -56,6 +58,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 */
@@ -76,6 +81,7 @@
# endif
# endif
# include <netdb.h> /* defines struct hostent, declares gethostbyname() */
+# endif
#endif
/* Include this after <sys/socket.h>, to avoid a syntax error on BeOS. */
diff --git a/libtextstyle/lib/unistd.in.h b/libtextstyle/lib/unistd.in.h
index fd69a48..4ebdcaa 100644
--- a/libtextstyle/lib/unistd.in.h
+++ b/libtextstyle/lib/unistd.in.h
@@ -1240,7 +1240,7 @@ _GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
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 @UNISTD_H_HAVE_WINSOCK2_H@ && !@HAVE_GETHOSTNAME@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gethostname
# define gethostname rpl_gethostname

View File

@ -2641,8 +2641,8 @@
"port-version": 7
},
"gettext": {
"baseline": "0.21",
"port-version": 9
"baseline": "0.21.1",
"port-version": 0
},
"gettimeofday": {
"baseline": "2017-10-14",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4c583e9adc3ab9a044b241466cebedf162cdc410",
"version": "0.21.1",
"port-version": 0
},
{
"git-tree": "5bf45743516e2ae999eb14017370828e237ad533",
"version": "0.21",