From daec5bde32f3eeabeb9f18992838cc9f900e0d0c Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Sat, 17 Jan 2009 03:29:58 +0000 Subject: [PATCH 01/23] Setup of module mingw32-gettext --- .cvsignore | 0 Makefile | 21 +++++++++++++++++++++ sources | 0 3 files changed, 21 insertions(+) create mode 100644 .cvsignore create mode 100644 Makefile create mode 100644 sources diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..089b35c --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: mingw32-gettext +# $Id$ +NAME := mingw32-gettext +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/sources b/sources new file mode 100644 index 0000000..e69de29 From ce61042cb1ac27fa7de7c3f4fae7c3cd854dd56b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 17 Jan 2009 11:38:26 +0000 Subject: [PATCH 02/23] Initial import. --- .cvsignore | 1 + import.log | 1 + ...2-gettext-0.17-gnulib-optarg-symbols.patch | 14 ++ mingw32-gettext.spec | 152 ++++++++++++++++++ sources | 1 + 5 files changed, 169 insertions(+) create mode 100644 import.log create mode 100644 mingw32-gettext-0.17-gnulib-optarg-symbols.patch create mode 100644 mingw32-gettext.spec diff --git a/.cvsignore b/.cvsignore index e69de29..3e77f9f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +gettext-0.17.tar.gz diff --git a/import.log b/import.log new file mode 100644 index 0000000..9161e91 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +mingw32-gettext-0_17-7_fc10:HEAD:mingw32-gettext-0.17-7.fc10.src.rpm:1232192061 diff --git a/mingw32-gettext-0.17-gnulib-optarg-symbols.patch b/mingw32-gettext-0.17-gnulib-optarg-symbols.patch new file mode 100644 index 0000000..f7063c4 --- /dev/null +++ b/mingw32-gettext-0.17-gnulib-optarg-symbols.patch @@ -0,0 +1,14 @@ +See https://bugzilla.redhat.com/show_bug.cgi?id=467398#c3 + +--- ./gettext-tools/woe32dll/gettextlib-exports.c.lfarkas 2008-10-31 11:42:38.000000000 +0100 ++++ ./gettext-tools/woe32dll/gettextlib-exports.c 2008-10-31 11:43:29.000000000 +0100 +@@ -26,7 +26,7 @@ + VARIABLE(gl_array_list_implementation) + VARIABLE(gl_linkedhash_list_implementation) + VARIABLE(program_name) +-VARIABLE(rpl_optarg) +-VARIABLE(rpl_optind) ++/*VARIABLE(rpl_optarg) ++VARIABLE(rpl_optind)*/ + VARIABLE(simple_backup_suffix) + VARIABLE(styled_ostream_typeinfo) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec new file mode 100644 index 0000000..59dfe99 --- /dev/null +++ b/mingw32-gettext.spec @@ -0,0 +1,152 @@ +%define __strip %{_mingw32_strip} +%define __objdump %{_mingw32_objdump} +%define _use_internal_dependency_generator 0 +%define __find_requires %{_mingw32_findrequires} +%define __find_provides %{_mingw32_findprovides} + +Name: mingw32-gettext +Version: 0.17 +Release: 7%{?dist} +Summary: GNU libraries and utilities for producing multi-lingual messages + +License: GPLv2+ and LGPLv2+ +Group: Development/Libraries +URL: http://www.gnu.org/software/gettext/ +Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Patch0: mingw32-gettext-0.17-gnulib-optarg-symbols.patch + +BuildArch: noarch + +BuildRequires: mingw32-filesystem >= 23 +BuildRequires: mingw32-runtime >= 3.15.1 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-gcc-c++ +BuildRequires: mingw32-binutils +BuildRequires: mingw32-iconv +BuildRequires: mingw32-termcap >= 1.3.1-3 + +# Possible extra BRs. These are used if available, but +# not required just for building. +#BuildRequires: mingw32-dlfcn +#BuildRequires: mingw32-libxml2 +#BuildRequires: mingw32-expat +#BuildRequires: mingw32-glib2 + + +%description +MinGW Windows Gettext library + + +%prep +%setup -q -n gettext-%{version} + +%patch0 -p1 + + +%build +%{_mingw32_configure} \ + --disable-java \ + --disable-native-java \ + --disable-csharp \ + --disable-static \ + --enable-threads=win32 \ + --without-emacs +make %{?_smp_mflags} + + +%install +rm -rf $RPM_BUILD_ROOT + +make DESTDIR=$RPM_BUILD_ROOT install +rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/locale/locale.alias +rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/charset.alias +rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/info/dir + +# Remove man pages, these are available in base gettext-devel. +rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man1/ +rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man3/ + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root) +%doc COPYING +%{_mingw32_bindir}/autopoint +%{_mingw32_bindir}/envsubst.exe +%{_mingw32_bindir}/gettext.exe +%{_mingw32_bindir}/gettext.sh +%{_mingw32_bindir}/gettextize +%{_mingw32_bindir}/libasprintf-0.dll +%{_mingw32_bindir}/libgettextlib-0-17.dll +%{_mingw32_bindir}/libgettextpo-0.dll +%{_mingw32_bindir}/libgettextsrc-0-17.dll +%{_mingw32_bindir}/libintl-8.dll +%{_mingw32_bindir}/msg*.exe +%{_mingw32_bindir}/ngettext.exe +%{_mingw32_bindir}/recode-sr-latin.exe +%{_mingw32_bindir}/xgettext.exe + +%{_mingw32_includedir}/autosprintf.h +%{_mingw32_includedir}/gettext-po.h +%{_mingw32_includedir}/libintl.h + +%{_mingw32_libdir}/gettext + +%{_mingw32_libdir}/libasprintf.dll.a +%{_mingw32_libdir}/libasprintf.la + +%{_mingw32_libdir}/libgettextlib.dll.a +%{_mingw32_libdir}/libgettextlib.la + +%{_mingw32_libdir}/libgettextpo.dll.a +%{_mingw32_libdir}/libgettextpo.la + +%{_mingw32_libdir}/libgettextsrc.dll.a +%{_mingw32_libdir}/libgettextsrc.la + +%{_mingw32_libdir}/libintl.dll.a +%{_mingw32_libdir}/libintl.la + +%{_mingw32_docdir}/gettext +%{_mingw32_docdir}/libasprintf/autosprintf_all.html + +%{_mingw32_datadir}/gettext/ + +%{_mingw32_datadir}/aclocal/*m4 +%{_mingw32_datadir}/info/autosprintf.info +%{_mingw32_datadir}/info/gettext.info + +%{_mingw32_datadir}/locale/*/LC_MESSAGES/gettext-tools.mo +%{_mingw32_datadir}/locale/*/LC_MESSAGES/gettext-runtime.mo + + +%changelog +* Fri Jan 16 2009 Richard W.M. Jones - 0.17-7 +- Remove the manpages - already available in base Fedora gettext-devel. +- Use _smp_mflags for build. +- Added list of potential BRs. +- Added license file to doc section. + +* Fri Oct 31 2008 Richard W.M. Jones - 0.17-6 +- Add fix for undefined Gnulib symbols (Farkas Levente). +- Rebuild against mingw32-termcap / libtermcap. + +* Wed Sep 24 2008 Richard W.M. Jones - 0.17-5 +- Rename mingw -> mingw32. + +* Thu Sep 11 2008 Daniel P. Berrange - 0.17-4 +- Disable emacs lisp file install + +* Thu Sep 10 2008 Richard W.M. Jones - 0.17-3 +- Remove static libraries. + +* Thu Sep 4 2008 Richard W.M. Jones - 0.17-2 +- Use RPM macros from mingw-filesystem. + +* Tue Sep 2 2008 Daniel P. Berrange - 0.17-1 +- Initial RPM release, largely based on earlier work from several sources. diff --git a/sources b/sources index e69de29..e072641 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +58a2bc6d39c0ba57823034d55d65d606 gettext-0.17.tar.gz From 718aac0a6566e3cdafb3eab011ee12f96e5442fc Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 23 Jan 2009 11:20:49 +0000 Subject: [PATCH 03/23] Use find_lang macro. --- mingw32-gettext.spec | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index 59dfe99..b5d0044 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 7%{?dist} +Release: 8%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -68,12 +68,14 @@ rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/info/dir rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man1/ rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man3/ +%find_lang %{name} --all-name + %clean rm -rf $RPM_BUILD_ROOT -%files +%files -f %{name}.lang %defattr(-,root,root) %doc COPYING %{_mingw32_bindir}/autopoint @@ -121,11 +123,11 @@ rm -rf $RPM_BUILD_ROOT %{_mingw32_datadir}/info/autosprintf.info %{_mingw32_datadir}/info/gettext.info -%{_mingw32_datadir}/locale/*/LC_MESSAGES/gettext-tools.mo -%{_mingw32_datadir}/locale/*/LC_MESSAGES/gettext-runtime.mo - %changelog +* Fri Jan 23 2009 Richard W.M. Jones - 0.17-8 +- Use find_lang macro. + * Fri Jan 16 2009 Richard W.M. Jones - 0.17-7 - Remove the manpages - already available in base Fedora gettext-devel. - Use _smp_mflags for build. From 142d679389244b866d76bd449dd8a44d28ff672a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 20 Feb 2009 23:28:44 +0000 Subject: [PATCH 04/23] Rebuild for gcc 4.4 --- mingw32-gettext.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index b5d0044..4a9698a 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 8%{?dist} +Release: 9%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -19,7 +19,7 @@ Patch0: mingw32-gettext-0.17-gnulib-optarg-symbols.patch BuildArch: noarch -BuildRequires: mingw32-filesystem >= 23 +BuildRequires: mingw32-filesystem >= 49 BuildRequires: mingw32-runtime >= 3.15.1 BuildRequires: mingw32-gcc BuildRequires: mingw32-gcc-c++ @@ -125,6 +125,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Feb 20 2009 Richard W.M. Jones - 0.17-9 +- Rebuild for mingw32-gcc 4.4 + * Fri Jan 23 2009 Richard W.M. Jones - 0.17-8 - Use find_lang macro. From 41fd6824e3cfbe3b7f978d0bb856f5644ed6fd2a Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Thu, 26 Feb 2009 01:07:19 +0000 Subject: [PATCH 05/23] - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild --- mingw32-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index 4a9698a..b237fab 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 9%{?dist} +Release: 10%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -125,6 +125,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Feb 25 2009 Fedora Release Engineering - 0.17-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + * Fri Feb 20 2009 Richard W.M. Jones - 0.17-9 - Rebuild for mingw32-gcc 4.4 From 040c3eae62e8ab2b8a8c60329495a9cc75f232d1 Mon Sep 17 00:00:00 2001 From: epienbro Date: Tue, 14 Apr 2009 19:26:46 +0000 Subject: [PATCH 06/23] Added -static subpackage --- mingw32-gettext.spec | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index b237fab..0e3d04b 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 10%{?dist} +Release: 11%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -39,6 +39,15 @@ BuildRequires: mingw32-termcap >= 1.3.1-3 MinGW Windows Gettext library +%package static +Summary: Static version of the MinGW Windows Gettext library +Requires: %{name} = %{version}-%{release} +Group: Development/Libraries + +%description static +Static version of the MinGW Windows Gettext library. + + %prep %setup -q -n gettext-%{version} @@ -50,7 +59,7 @@ MinGW Windows Gettext library --disable-java \ --disable-native-java \ --disable-csharp \ - --disable-static \ + --enable-static \ --enable-threads=win32 \ --without-emacs make %{?_smp_mflags} @@ -123,8 +132,17 @@ rm -rf $RPM_BUILD_ROOT %{_mingw32_datadir}/info/autosprintf.info %{_mingw32_datadir}/info/gettext.info +%files static +%defattr(-,root,root,-) +%{_mingw32_libdir}/libasprintf.a +%{_mingw32_libdir}/libgettextpo.a +%{_mingw32_libdir}/libintl.a + %changelog +* Fri Apr 3 2009 Erik van Pienbroek - 0.17-11 +- Added -static subpackage + * Wed Feb 25 2009 Fedora Release Engineering - 0.17-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild From d9a0da383e841ada0f4f37fee17785f4dcad2529 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Sat, 25 Jul 2009 12:18:04 +0000 Subject: [PATCH 07/23] - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild --- mingw32-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index 0e3d04b..becb7f1 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 11%{?dist} +Release: 12%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -140,6 +140,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Jul 25 2009 Fedora Release Engineering - 0.17-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + * Fri Apr 3 2009 Erik van Pienbroek - 0.17-11 - Added -static subpackage From bbe6d11044aa7d8a3b3670e294faa4f64d8e163d Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 23:18:48 +0000 Subject: [PATCH 08/23] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 089b35c..697b2ec 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: mingw32-gettext -# $Id$ +# $Id: Makefile,v 1.1 2009/01/17 03:29:58 kevin Exp $ NAME := mingw32-gettext SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From d0fb1b77886a9837537dd64ac7825c19271b12b0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 03:19:34 +0000 Subject: [PATCH 09/23] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- import.log | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 697b2ec..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: mingw32-gettext -# $Id: Makefile,v 1.1 2009/01/17 03:29:58 kevin Exp $ -NAME := mingw32-gettext -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/import.log b/import.log deleted file mode 100644 index 9161e91..0000000 --- a/import.log +++ /dev/null @@ -1 +0,0 @@ -mingw32-gettext-0_17-7_fc10:HEAD:mingw32-gettext-0.17-7.fc10.src.rpm:1232192061 From 219f27c0a38e23f2f881308a2078edbc0ea19288 Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Sat, 16 Oct 2010 16:47:07 +0200 Subject: [PATCH 10/23] Let other binaries have a soft-dep on libintl-8.dll --- libintl.c | 367 +++++++++++++++++++++++++++++++++++++++++++ libintl.h | 70 +++++++++ mingw32-gettext.spec | 33 +++- 3 files changed, 465 insertions(+), 5 deletions(-) create mode 100644 libintl.c create mode 100644 libintl.h diff --git a/libintl.c b/libintl.c new file mode 100644 index 0000000..b34fe16 --- /dev/null +++ b/libintl.c @@ -0,0 +1,367 @@ +/* + * Copyright (C) 2008 Tor Lillqvist + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; see the file COPYING.LIB.txt. If + * not, write to the Free Software Foundation, Inc., 51 Franklin + * Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifdef _WIN32 +# include +# include +#else +# include +# if !STUB_ONLY +# include +# endif +typedef void* HMODULE; +#endif + +#include + +#include "libintl.h" + +const char *_nl_expand_alias(const char *unused) { return NULL; } +int _nl_msg_cat_cntr; /* So that configury thinks it is GNU + * gettext + */ + +static char * (*p_gettext) (const char *msgid); + +static char * (*p_dgettext) (const char *domainname, + const char *msgid); + +static char * (*p_dcgettext) (const char *domainname, + const char *msgid, + int category); + +static char * (*p_ngettext) (const char *msgid1, + const char *msgid2, + unsigned long int n); + +static char * (*p_dngettext) (const char *domainname, + const char *msgid1, + const char *msgid2, + unsigned long int n); + +static char * (*p_dcngettext) (const char *domainname, + const char *msgid1, + const char *msgid2, + unsigned long int n, + int category); + +static char * (*p_textdomain) (const char *domainname); + +static char * (*p_bindtextdomain) (const char *domainname, + const char *dirname); + +static char * (*p_bind_textdomain_codeset) (const char *domainname, + const char *codeset); + +static int +use_intl_dll (HMODULE dll) +{ +#if !STUB_ONLY +# ifdef _WIN32 +# define LOOKUP(fn) p_##fn = (void *) GetProcAddress (dll, #fn); if (p_##fn == NULL) return 0 +# else +# define LOOKUP(fn) p_##fn = (void *) dlsym (dll, #fn); if (p_##fn == NULL) return 0 +# endif /* _WIN32 */ + + + LOOKUP (gettext); + LOOKUP (dgettext); + LOOKUP (dcgettext); + LOOKUP (ngettext); + LOOKUP (dngettext); + LOOKUP (dcngettext); + LOOKUP (textdomain); + LOOKUP (bindtextdomain); + LOOKUP (bind_textdomain_codeset); + +#undef LOOKUP +#endif /* !STUB_ONLY */ + return 1; +} + +static char *current_domain = NULL; + +#define DUMMY(fn, parlist, retval) \ +static char * \ +dummy_##fn parlist \ +{ \ + return (char *) (retval); \ +} + +DUMMY (gettext, + (const char *msgid), + msgid) + +DUMMY (dgettext, + (const char *domainname, + const char *msgid), + msgid) + +DUMMY (dcgettext, + (const char *domainname, + const char *msgid, + int category), + msgid) + +DUMMY (ngettext, + (const char *msgid1, + const char *msgid2, + unsigned long int n), + n == 1 ? msgid1 : msgid2) + +DUMMY (dngettext, + (const char *domainname, + const char *msgid1, + const char *msgid2, + unsigned long int n), + n == 1 ? msgid1 : msgid2) + +DUMMY (dcngettext, + (const char *domainname, + const char *msgid1, + const char *msgid2, + unsigned long int n, + int category), + n == 1 ? msgid1 : msgid2) + +/* GLib requires that textdomain(NULL) returns "messages" + * if textdomain() hasn't been called earlier. + */ +DUMMY (textdomain, + (const char *domainname), + (domainname ? + (free (current_domain), current_domain = strdup (domainname)) : + (current_domain ? + current_domain : + (current_domain = strdup ("messages"))))) + +/* bindtextdomain() should return the current dirname for the domain, + * after possibly changing it. I don't think software usually checks + * the return value, though, so just return a dummy string now. This + * is the dummy implementation after all, so it hardly matters? + */ +DUMMY (bindtextdomain, + (const char *domainname, + const char *dirname), + "/dummy") + +/* bind_textdomain_codeset() should return the corrent codeset for the + * domain after possibly changing it. Again, this is the dummy + * implementation, so just return the codeset argument. + */ +DUMMY (bind_textdomain_codeset, + (const char *domainname, + const char *codeset), + codeset) + +#undef DUMMY + +static void +use_dummy (void) +{ +#define USE_DUMMY(fn) p_##fn = dummy_##fn + + USE_DUMMY (gettext); + USE_DUMMY (dgettext); + USE_DUMMY (dcgettext); + USE_DUMMY (ngettext); + USE_DUMMY (dngettext); + USE_DUMMY (dcngettext); + USE_DUMMY (textdomain); + USE_DUMMY (bindtextdomain); + USE_DUMMY (bind_textdomain_codeset); + +#undef USE_DUMMY + +} + +#ifdef _WIN32 + +/* To reduce DLL hijacking risk we look for the libintl DLL in + * explicit full paths. We look in two places: The the directory of + * the application's exe file, then the directory of the DLL this code + * is in. (Those two might be the same, of course, but we don't bother + * testing that.) + */ + +static HMODULE +try_load_from_directory_of_module (HMODULE module, + const char *dll_name) +{ + wchar_t buf[MAX_PATH*2]; + wchar_t *slash; + int n; + + n = GetModuleFileNameW (module, buf, MAX_PATH); + + if (n == 0 || n == MAX_PATH) + return NULL; + + slash = wcsrchr (buf, L'\\'); + if (slash) + *slash = L'\0'; + + wcscat (buf, L"\\"); + MultiByteToWideChar (CP_ACP, 0, dll_name, -1, + buf + wcslen (buf), + MAX_PATH); + + return LoadLibraryW (buf); +} + + +static HMODULE +try_load (const char *dll_name) +{ + HMODULE retval = NULL; + HMODULE this_module = NULL; + typedef BOOL (WINAPI *GetModuleHandleExA_t) (DWORD, LPVOID, HMODULE *); + GetModuleHandleExA_t GetModuleHandleExA_p; + + retval = try_load_from_directory_of_module (GetModuleHandle (NULL), dll_name); + + if (retval) + return retval; + + GetModuleHandleExA_p = + (GetModuleHandleExA_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), + "GetModuleHandleExA"); + + if (GetModuleHandleExA_p == NULL || + !(*GetModuleHandleExA_p) (GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | + GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + &try_load, &this_module)) + { + /* If GetModuleHandleExA() fails, or if it isn't present, use + * heuristics that the module handle equals the allocation base + * address for the module's code region. + */ + MEMORY_BASIC_INFORMATION mbi; + + if (VirtualQuery (&try_load, &mbi, sizeof (mbi))) + this_module = (HMODULE) mbi.AllocationBase; + } + + if (this_module) + retval = try_load_from_directory_of_module (this_module, dll_name); + + return retval; +} + +#endif + +static void +setup (void) +{ + static int beenhere = 0; + + if (!beenhere) + { +#if !STUB_ONLY +#if defined(_WIN64) + /* On 64-bit Windows we have let libtool choose the default name + * for the DLL, as we don't need the intl.dll name for backward + * compatibility + */ + HMODULE intl_dll = try_load ("libintl-8.dll"); +# elif defined( _WIN32) + /* On 32-bit Windows try both the traditional name intl.dll, + * and libintl-8.dll. + */ + HMODULE intl_dll = try_load ("intl.dll"); + if (intl_dll == NULL) + intl_dll = try_load ("libintl-8.dll"); +# elif defined(__APPLE__) && defined(__MACH__) + HMODULE intl_dll = dlopen ("libintl.dylib", RTLD_LAZY); +# else + HMODULE intl_dll = dlopen ("libintl.so", RTLD_LAZY); +# endif +#else /* !STUB_ONLY */ + HMODULE intl_dll = NULL; +#endif /* STUB_ONLY */ + + if (intl_dll != NULL && + use_intl_dll (intl_dll)) + ; + else + use_dummy (); + + beenhere = 1; + } +} + +#define IMPLEMENT(fn, parlist, parlist2) \ +char * \ +fn parlist \ +{ \ + setup (); \ + return p_##fn parlist2; \ +} + +IMPLEMENT (gettext, + (const char *msgid), + (msgid)) + +IMPLEMENT (dgettext, + (const char *domainname, + const char *msgid), + (domainname, msgid)) + +IMPLEMENT (dcgettext, + (const char *domainname, + const char *msgid, + int category), + (domainname, msgid, category)) + +IMPLEMENT (ngettext, + (const char *msgid1, + const char *msgid2, + unsigned long int n), + (msgid1, msgid2, n)) + +IMPLEMENT (dngettext, + (const char *domainname, + const char *msgid1, + const char *msgid2, + unsigned long int n), + (domainname, msgid1, msgid2, n)) + +IMPLEMENT (dcngettext, + (const char *domainname, + const char *msgid1, + const char *msgid2, + unsigned long int n, + int category), + (domainname, msgid1, msgid2, n, category)) + +IMPLEMENT (textdomain, + (const char *domainname), + (domainname)) + +IMPLEMENT (bindtextdomain, + (const char *domainname, + const char *dirname), + (domainname, dirname)) + +IMPLEMENT (bind_textdomain_codeset, + (const char *domainname, + const char *codeset), + (domainname, codeset)) + +#undef IMPLEMENT diff --git a/libintl.h b/libintl.h new file mode 100644 index 0000000..82d96e7 --- /dev/null +++ b/libintl.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2008 Tor Lillqvist + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; see the file COPYING.LIB.txt. If + * not, write to the Free Software Foundation, Inc., 51 Franklin + * Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _LIBINTL_H +#define _LIBINTL_H 1 + +#include + +#ifndef LC_MESSAGES +# define LC_MESSAGES 1729 /* Use same value as in GNU gettext */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +extern char *gettext (const char *msgid); + +extern char *dgettext (const char *domainname, + const char *msgid); + +extern char *dcgettext (const char *domainname, + const char *msgid, + int category); + +extern char *ngettext (const char *msgid1, + const char *msgid2, + unsigned long int n); + +extern char *dngettext (const char *domainname, + const char *msgid1, + const char *msgid2, + unsigned long int n); + +extern char *dcngettext (const char *domainname, + const char *msgid1, + const char *msgid2, + unsigned long int n, + int category); + +extern char *textdomain (const char *domainname); + +extern char *bindtextdomain (const char *domainname, + const char *dirname); + +extern char *bind_textdomain_codeset (const char *domainname, + const char *codeset); + + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBINTL_H */ diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index becb7f1..ab4c306 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 12%{?dist} +Release: 13%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -15,11 +15,16 @@ URL: http://www.gnu.org/software/gettext/ Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# Proxy-libintl +# See http://www.gtk.org/download-windows.html for more details +Source1: libintl.c +Source2: libintl.h + Patch0: mingw32-gettext-0.17-gnulib-optarg-symbols.patch BuildArch: noarch -BuildRequires: mingw32-filesystem >= 49 +BuildRequires: mingw32-filesystem >= 49 BuildRequires: mingw32-runtime >= 3.15.1 BuildRequires: mingw32-gcc BuildRequires: mingw32-gcc-c++ @@ -55,6 +60,12 @@ Static version of the MinGW Windows Gettext library. %build +# Build proxy-libintl manually +cp %{SOURCE1} . +cp %{SOURCE2} . +%{_mingw32_cc} -c libintl.c -o libintl.o -I. +%{_mingw32_ar} rc libintl.a libintl.o + %{_mingw32_configure} \ --disable-java \ --disable-native-java \ @@ -77,6 +88,13 @@ rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/info/dir rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man1/ rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man3/ +# Install the proxy-libintl pieces +rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/libintl.la +rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/libintl.dll.a +install -m 0644 intl_win32/libintl.a $RPM_BUILD_ROOT%{_mingw32_libdir}/ +rm -f $RPM_BUILD_ROOT%{_mingw32_includedir}/libintl.h +install -m 0644 libintl.h $RPM_BUILD_ROOT%{_mingw32_includedir}/ + %find_lang %{name} --all-name @@ -120,8 +138,9 @@ rm -rf $RPM_BUILD_ROOT %{_mingw32_libdir}/libgettextsrc.dll.a %{_mingw32_libdir}/libgettextsrc.la -%{_mingw32_libdir}/libintl.dll.a -%{_mingw32_libdir}/libintl.la +# This isn't really a static library, but a small wrapper library +# which adds the ability to have a soft dependency on libintl-8.dll +%{_mingw32_libdir}/libintl.a %{_mingw32_docdir}/gettext %{_mingw32_docdir}/libasprintf/autosprintf_all.html @@ -136,10 +155,14 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %{_mingw32_libdir}/libasprintf.a %{_mingw32_libdir}/libgettextpo.a -%{_mingw32_libdir}/libintl.a %changelog +* Sat Oct 16 2010 Erik van Pienbroek - 0.17-13 +- Replaced the libintl import library with a small wrapper library in order + to let other binaries have a soft-dependency on libintl-8.dll as proposed + on the fedora-mingw mailing list + * Sat Jul 25 2009 Fedora Release Engineering - 0.17-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild From 2136a6d72680f7b43ad153aa70e4114ae57dbe02 Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Sat, 16 Oct 2010 17:00:20 +0200 Subject: [PATCH 11/23] Build fix --- mingw32-gettext.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index ab4c306..b85ed38 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -91,7 +91,7 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man3/ # Install the proxy-libintl pieces rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/libintl.la rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/libintl.dll.a -install -m 0644 intl_win32/libintl.a $RPM_BUILD_ROOT%{_mingw32_libdir}/ +install -m 0644 libintl.a $RPM_BUILD_ROOT%{_mingw32_libdir}/ rm -f $RPM_BUILD_ROOT%{_mingw32_includedir}/libintl.h install -m 0644 libintl.h $RPM_BUILD_ROOT%{_mingw32_includedir}/ From e4171c861172dc05d5872551b1dfc8c0114fdbb1 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 8 Feb 2011 12:31:20 -0600 Subject: [PATCH 12/23] - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild --- mingw32-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index b85ed38..869458a 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 13%{?dist} +Release: 14%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -158,6 +158,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Feb 08 2011 Fedora Release Engineering - 0.17-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Sat Oct 16 2010 Erik van Pienbroek - 0.17-13 - Replaced the libintl import library with a small wrapper library in order to let other binaries have a soft-dependency on libintl-8.dll as proposed From a8889f35706cec8466794dee2212b10333c82cdf Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Wed, 27 Apr 2011 17:36:37 +0200 Subject: [PATCH 13/23] Dropped the proxy-libintl pieces Dropped the proxy-libintl pieces as the upstream gtk+ win32 maintainers also decided to drop it and it's causing more harm than good --- libintl.c | 367 ------------------------------------------- libintl.h | 70 --------- mingw32-gettext.spec | 30 +--- 3 files changed, 8 insertions(+), 459 deletions(-) delete mode 100644 libintl.c delete mode 100644 libintl.h diff --git a/libintl.c b/libintl.c deleted file mode 100644 index b34fe16..0000000 --- a/libintl.c +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (C) 2008 Tor Lillqvist - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; see the file COPYING.LIB.txt. If - * not, write to the Free Software Foundation, Inc., 51 Franklin - * Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifdef _WIN32 -# include -# include -#else -# include -# if !STUB_ONLY -# include -# endif -typedef void* HMODULE; -#endif - -#include - -#include "libintl.h" - -const char *_nl_expand_alias(const char *unused) { return NULL; } -int _nl_msg_cat_cntr; /* So that configury thinks it is GNU - * gettext - */ - -static char * (*p_gettext) (const char *msgid); - -static char * (*p_dgettext) (const char *domainname, - const char *msgid); - -static char * (*p_dcgettext) (const char *domainname, - const char *msgid, - int category); - -static char * (*p_ngettext) (const char *msgid1, - const char *msgid2, - unsigned long int n); - -static char * (*p_dngettext) (const char *domainname, - const char *msgid1, - const char *msgid2, - unsigned long int n); - -static char * (*p_dcngettext) (const char *domainname, - const char *msgid1, - const char *msgid2, - unsigned long int n, - int category); - -static char * (*p_textdomain) (const char *domainname); - -static char * (*p_bindtextdomain) (const char *domainname, - const char *dirname); - -static char * (*p_bind_textdomain_codeset) (const char *domainname, - const char *codeset); - -static int -use_intl_dll (HMODULE dll) -{ -#if !STUB_ONLY -# ifdef _WIN32 -# define LOOKUP(fn) p_##fn = (void *) GetProcAddress (dll, #fn); if (p_##fn == NULL) return 0 -# else -# define LOOKUP(fn) p_##fn = (void *) dlsym (dll, #fn); if (p_##fn == NULL) return 0 -# endif /* _WIN32 */ - - - LOOKUP (gettext); - LOOKUP (dgettext); - LOOKUP (dcgettext); - LOOKUP (ngettext); - LOOKUP (dngettext); - LOOKUP (dcngettext); - LOOKUP (textdomain); - LOOKUP (bindtextdomain); - LOOKUP (bind_textdomain_codeset); - -#undef LOOKUP -#endif /* !STUB_ONLY */ - return 1; -} - -static char *current_domain = NULL; - -#define DUMMY(fn, parlist, retval) \ -static char * \ -dummy_##fn parlist \ -{ \ - return (char *) (retval); \ -} - -DUMMY (gettext, - (const char *msgid), - msgid) - -DUMMY (dgettext, - (const char *domainname, - const char *msgid), - msgid) - -DUMMY (dcgettext, - (const char *domainname, - const char *msgid, - int category), - msgid) - -DUMMY (ngettext, - (const char *msgid1, - const char *msgid2, - unsigned long int n), - n == 1 ? msgid1 : msgid2) - -DUMMY (dngettext, - (const char *domainname, - const char *msgid1, - const char *msgid2, - unsigned long int n), - n == 1 ? msgid1 : msgid2) - -DUMMY (dcngettext, - (const char *domainname, - const char *msgid1, - const char *msgid2, - unsigned long int n, - int category), - n == 1 ? msgid1 : msgid2) - -/* GLib requires that textdomain(NULL) returns "messages" - * if textdomain() hasn't been called earlier. - */ -DUMMY (textdomain, - (const char *domainname), - (domainname ? - (free (current_domain), current_domain = strdup (domainname)) : - (current_domain ? - current_domain : - (current_domain = strdup ("messages"))))) - -/* bindtextdomain() should return the current dirname for the domain, - * after possibly changing it. I don't think software usually checks - * the return value, though, so just return a dummy string now. This - * is the dummy implementation after all, so it hardly matters? - */ -DUMMY (bindtextdomain, - (const char *domainname, - const char *dirname), - "/dummy") - -/* bind_textdomain_codeset() should return the corrent codeset for the - * domain after possibly changing it. Again, this is the dummy - * implementation, so just return the codeset argument. - */ -DUMMY (bind_textdomain_codeset, - (const char *domainname, - const char *codeset), - codeset) - -#undef DUMMY - -static void -use_dummy (void) -{ -#define USE_DUMMY(fn) p_##fn = dummy_##fn - - USE_DUMMY (gettext); - USE_DUMMY (dgettext); - USE_DUMMY (dcgettext); - USE_DUMMY (ngettext); - USE_DUMMY (dngettext); - USE_DUMMY (dcngettext); - USE_DUMMY (textdomain); - USE_DUMMY (bindtextdomain); - USE_DUMMY (bind_textdomain_codeset); - -#undef USE_DUMMY - -} - -#ifdef _WIN32 - -/* To reduce DLL hijacking risk we look for the libintl DLL in - * explicit full paths. We look in two places: The the directory of - * the application's exe file, then the directory of the DLL this code - * is in. (Those two might be the same, of course, but we don't bother - * testing that.) - */ - -static HMODULE -try_load_from_directory_of_module (HMODULE module, - const char *dll_name) -{ - wchar_t buf[MAX_PATH*2]; - wchar_t *slash; - int n; - - n = GetModuleFileNameW (module, buf, MAX_PATH); - - if (n == 0 || n == MAX_PATH) - return NULL; - - slash = wcsrchr (buf, L'\\'); - if (slash) - *slash = L'\0'; - - wcscat (buf, L"\\"); - MultiByteToWideChar (CP_ACP, 0, dll_name, -1, - buf + wcslen (buf), - MAX_PATH); - - return LoadLibraryW (buf); -} - - -static HMODULE -try_load (const char *dll_name) -{ - HMODULE retval = NULL; - HMODULE this_module = NULL; - typedef BOOL (WINAPI *GetModuleHandleExA_t) (DWORD, LPVOID, HMODULE *); - GetModuleHandleExA_t GetModuleHandleExA_p; - - retval = try_load_from_directory_of_module (GetModuleHandle (NULL), dll_name); - - if (retval) - return retval; - - GetModuleHandleExA_p = - (GetModuleHandleExA_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), - "GetModuleHandleExA"); - - if (GetModuleHandleExA_p == NULL || - !(*GetModuleHandleExA_p) (GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | - GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, - &try_load, &this_module)) - { - /* If GetModuleHandleExA() fails, or if it isn't present, use - * heuristics that the module handle equals the allocation base - * address for the module's code region. - */ - MEMORY_BASIC_INFORMATION mbi; - - if (VirtualQuery (&try_load, &mbi, sizeof (mbi))) - this_module = (HMODULE) mbi.AllocationBase; - } - - if (this_module) - retval = try_load_from_directory_of_module (this_module, dll_name); - - return retval; -} - -#endif - -static void -setup (void) -{ - static int beenhere = 0; - - if (!beenhere) - { -#if !STUB_ONLY -#if defined(_WIN64) - /* On 64-bit Windows we have let libtool choose the default name - * for the DLL, as we don't need the intl.dll name for backward - * compatibility - */ - HMODULE intl_dll = try_load ("libintl-8.dll"); -# elif defined( _WIN32) - /* On 32-bit Windows try both the traditional name intl.dll, - * and libintl-8.dll. - */ - HMODULE intl_dll = try_load ("intl.dll"); - if (intl_dll == NULL) - intl_dll = try_load ("libintl-8.dll"); -# elif defined(__APPLE__) && defined(__MACH__) - HMODULE intl_dll = dlopen ("libintl.dylib", RTLD_LAZY); -# else - HMODULE intl_dll = dlopen ("libintl.so", RTLD_LAZY); -# endif -#else /* !STUB_ONLY */ - HMODULE intl_dll = NULL; -#endif /* STUB_ONLY */ - - if (intl_dll != NULL && - use_intl_dll (intl_dll)) - ; - else - use_dummy (); - - beenhere = 1; - } -} - -#define IMPLEMENT(fn, parlist, parlist2) \ -char * \ -fn parlist \ -{ \ - setup (); \ - return p_##fn parlist2; \ -} - -IMPLEMENT (gettext, - (const char *msgid), - (msgid)) - -IMPLEMENT (dgettext, - (const char *domainname, - const char *msgid), - (domainname, msgid)) - -IMPLEMENT (dcgettext, - (const char *domainname, - const char *msgid, - int category), - (domainname, msgid, category)) - -IMPLEMENT (ngettext, - (const char *msgid1, - const char *msgid2, - unsigned long int n), - (msgid1, msgid2, n)) - -IMPLEMENT (dngettext, - (const char *domainname, - const char *msgid1, - const char *msgid2, - unsigned long int n), - (domainname, msgid1, msgid2, n)) - -IMPLEMENT (dcngettext, - (const char *domainname, - const char *msgid1, - const char *msgid2, - unsigned long int n, - int category), - (domainname, msgid1, msgid2, n, category)) - -IMPLEMENT (textdomain, - (const char *domainname), - (domainname)) - -IMPLEMENT (bindtextdomain, - (const char *domainname, - const char *dirname), - (domainname, dirname)) - -IMPLEMENT (bind_textdomain_codeset, - (const char *domainname, - const char *codeset), - (domainname, codeset)) - -#undef IMPLEMENT diff --git a/libintl.h b/libintl.h deleted file mode 100644 index 82d96e7..0000000 --- a/libintl.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2008 Tor Lillqvist - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; see the file COPYING.LIB.txt. If - * not, write to the Free Software Foundation, Inc., 51 Franklin - * Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _LIBINTL_H -#define _LIBINTL_H 1 - -#include - -#ifndef LC_MESSAGES -# define LC_MESSAGES 1729 /* Use same value as in GNU gettext */ -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -extern char *gettext (const char *msgid); - -extern char *dgettext (const char *domainname, - const char *msgid); - -extern char *dcgettext (const char *domainname, - const char *msgid, - int category); - -extern char *ngettext (const char *msgid1, - const char *msgid2, - unsigned long int n); - -extern char *dngettext (const char *domainname, - const char *msgid1, - const char *msgid2, - unsigned long int n); - -extern char *dcngettext (const char *domainname, - const char *msgid1, - const char *msgid2, - unsigned long int n, - int category); - -extern char *textdomain (const char *domainname); - -extern char *bindtextdomain (const char *domainname, - const char *dirname); - -extern char *bind_textdomain_codeset (const char *domainname, - const char *codeset); - - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBINTL_H */ diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index 869458a..e9eadcb 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 14%{?dist} +Release: 15%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -15,11 +15,6 @@ URL: http://www.gnu.org/software/gettext/ Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -# Proxy-libintl -# See http://www.gtk.org/download-windows.html for more details -Source1: libintl.c -Source2: libintl.h - Patch0: mingw32-gettext-0.17-gnulib-optarg-symbols.patch BuildArch: noarch @@ -60,12 +55,6 @@ Static version of the MinGW Windows Gettext library. %build -# Build proxy-libintl manually -cp %{SOURCE1} . -cp %{SOURCE2} . -%{_mingw32_cc} -c libintl.c -o libintl.o -I. -%{_mingw32_ar} rc libintl.a libintl.o - %{_mingw32_configure} \ --disable-java \ --disable-native-java \ @@ -88,13 +77,6 @@ rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/info/dir rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man1/ rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man3/ -# Install the proxy-libintl pieces -rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/libintl.la -rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/libintl.dll.a -install -m 0644 libintl.a $RPM_BUILD_ROOT%{_mingw32_libdir}/ -rm -f $RPM_BUILD_ROOT%{_mingw32_includedir}/libintl.h -install -m 0644 libintl.h $RPM_BUILD_ROOT%{_mingw32_includedir}/ - %find_lang %{name} --all-name @@ -138,9 +120,8 @@ rm -rf $RPM_BUILD_ROOT %{_mingw32_libdir}/libgettextsrc.dll.a %{_mingw32_libdir}/libgettextsrc.la -# This isn't really a static library, but a small wrapper library -# which adds the ability to have a soft dependency on libintl-8.dll -%{_mingw32_libdir}/libintl.a +%{_mingw32_libdir}/libintl.dll.a +%{_mingw32_libdir}/libintl.la %{_mingw32_docdir}/gettext %{_mingw32_docdir}/libasprintf/autosprintf_all.html @@ -155,9 +136,14 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %{_mingw32_libdir}/libasprintf.a %{_mingw32_libdir}/libgettextpo.a +%{_mingw32_libdir}/libintl.a %changelog +* Wed Apr 27 2011 Erik van Pienbroek - 0.17.15 +- Dropped the proxy-libintl pieces as the upstream gtk+ win32 maintainers + also decided to drop it and it's causing more harm than good + * Tue Feb 08 2011 Fedora Release Engineering - 0.17-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From 868e68cf1621700033cb0f64e143e4dbe8303434 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 23 May 2011 06:04:40 +0300 Subject: [PATCH 14/23] Removed html documentation and info pages --- mingw32-gettext.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index e9eadcb..f4c7100 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -6,7 +6,7 @@ Name: mingw32-gettext Version: 0.17 -Release: 15%{?dist} +Release: 16%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -71,11 +71,13 @@ rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/locale/locale.alias rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/charset.alias -rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/info/dir -# Remove man pages, these are available in base gettext-devel. +# Remove documentation - already available in base gettext-devel. rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man1/ rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man3/ +rm -rf $RPM_BUILD_ROOT%{_mingw32_docdir}/gettext/ +rm -rf $RPM_BUILD_ROOT%{_mingw32_docdir}/libasprintf/ +rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/info/ %find_lang %{name} --all-name @@ -123,14 +125,9 @@ rm -rf $RPM_BUILD_ROOT %{_mingw32_libdir}/libintl.dll.a %{_mingw32_libdir}/libintl.la -%{_mingw32_docdir}/gettext -%{_mingw32_docdir}/libasprintf/autosprintf_all.html - %{_mingw32_datadir}/gettext/ %{_mingw32_datadir}/aclocal/*m4 -%{_mingw32_datadir}/info/autosprintf.info -%{_mingw32_datadir}/info/gettext.info %files static %defattr(-,root,root,-) @@ -140,6 +137,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon May 23 2011 Kalev Lember - 0.17-16 +- Removed html documentation and info pages + * Wed Apr 27 2011 Erik van Pienbroek - 0.17.15 - Dropped the proxy-libintl pieces as the upstream gtk+ win32 maintainers also decided to drop it and it's causing more harm than good From ccc1762ededec146f8a9f0db7aebdd6fe7e7754b Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 23 May 2011 08:49:15 +0300 Subject: [PATCH 15/23] Update to 0.18.1.1 --- mingw32-gettext-0.17-gnulib-optarg-symbols.patch | 14 -------------- mingw32-gettext.spec | 16 ++++++++-------- 2 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 mingw32-gettext-0.17-gnulib-optarg-symbols.patch diff --git a/mingw32-gettext-0.17-gnulib-optarg-symbols.patch b/mingw32-gettext-0.17-gnulib-optarg-symbols.patch deleted file mode 100644 index f7063c4..0000000 --- a/mingw32-gettext-0.17-gnulib-optarg-symbols.patch +++ /dev/null @@ -1,14 +0,0 @@ -See https://bugzilla.redhat.com/show_bug.cgi?id=467398#c3 - ---- ./gettext-tools/woe32dll/gettextlib-exports.c.lfarkas 2008-10-31 11:42:38.000000000 +0100 -+++ ./gettext-tools/woe32dll/gettextlib-exports.c 2008-10-31 11:43:29.000000000 +0100 -@@ -26,7 +26,7 @@ - VARIABLE(gl_array_list_implementation) - VARIABLE(gl_linkedhash_list_implementation) - VARIABLE(program_name) --VARIABLE(rpl_optarg) --VARIABLE(rpl_optind) -+/*VARIABLE(rpl_optarg) -+VARIABLE(rpl_optind)*/ - VARIABLE(simple_backup_suffix) - VARIABLE(styled_ostream_typeinfo) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index f4c7100..d398595 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -5,8 +5,8 @@ %define __find_provides %{_mingw32_findprovides} Name: mingw32-gettext -Version: 0.17 -Release: 16%{?dist} +Version: 0.18.1.1 +Release: 1%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -15,8 +15,6 @@ URL: http://www.gnu.org/software/gettext/ Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Patch0: mingw32-gettext-0.17-gnulib-optarg-symbols.patch - BuildArch: noarch BuildRequires: mingw32-filesystem >= 49 @@ -51,10 +49,9 @@ Static version of the MinGW Windows Gettext library. %prep %setup -q -n gettext-%{version} -%patch0 -p1 - %build +echo "gl_cv_func_memchr_works='yes'" >> %{_mingw32_cache} %{_mingw32_configure} \ --disable-java \ --disable-native-java \ @@ -95,9 +92,9 @@ rm -rf $RPM_BUILD_ROOT %{_mingw32_bindir}/gettext.sh %{_mingw32_bindir}/gettextize %{_mingw32_bindir}/libasprintf-0.dll -%{_mingw32_bindir}/libgettextlib-0-17.dll +%{_mingw32_bindir}/libgettextlib-0-18-1.dll %{_mingw32_bindir}/libgettextpo-0.dll -%{_mingw32_bindir}/libgettextsrc-0-17.dll +%{_mingw32_bindir}/libgettextsrc-0-18-1.dll %{_mingw32_bindir}/libintl-8.dll %{_mingw32_bindir}/msg*.exe %{_mingw32_bindir}/ngettext.exe @@ -137,6 +134,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon May 23 2011 Kalev Lember - 0.18.1.1-1 +- Update to 0.18.1.1 + * Mon May 23 2011 Kalev Lember - 0.17-16 - Removed html documentation and info pages From 7f1790f4e186e5fd585fe04f04007e081737f98e Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 23 May 2011 08:53:30 +0300 Subject: [PATCH 16/23] Spec cleanup --- mingw32-gettext.spec | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index d398595..5f7d5b6 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -1,8 +1,5 @@ %define __strip %{_mingw32_strip} %define __objdump %{_mingw32_objdump} -%define _use_internal_dependency_generator 0 -%define __find_requires %{_mingw32_findrequires} -%define __find_provides %{_mingw32_findprovides} Name: mingw32-gettext Version: 0.18.1.1 @@ -13,11 +10,10 @@ License: GPLv2+ and LGPLv2+ Group: Development/Libraries URL: http://www.gnu.org/software/gettext/ Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -BuildRequires: mingw32-filesystem >= 49 +BuildRequires: mingw32-filesystem >= 68 BuildRequires: mingw32-runtime >= 3.15.1 BuildRequires: mingw32-gcc BuildRequires: mingw32-gcc-c++ @@ -63,8 +59,6 @@ make %{?_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT - make DESTDIR=$RPM_BUILD_ROOT install rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/locale/locale.alias rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/charset.alias @@ -79,12 +73,7 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/info/ %find_lang %{name} --all-name -%clean -rm -rf $RPM_BUILD_ROOT - - %files -f %{name}.lang -%defattr(-,root,root) %doc COPYING %{_mingw32_bindir}/autopoint %{_mingw32_bindir}/envsubst.exe @@ -127,7 +116,6 @@ rm -rf $RPM_BUILD_ROOT %{_mingw32_datadir}/aclocal/*m4 %files static -%defattr(-,root,root,-) %{_mingw32_libdir}/libasprintf.a %{_mingw32_libdir}/libgettextpo.a %{_mingw32_libdir}/libintl.a @@ -136,6 +124,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Mon May 23 2011 Kalev Lember - 0.18.1.1-1 - Update to 0.18.1.1 +- Spec cleanup * Mon May 23 2011 Kalev Lember - 0.17-16 - Removed html documentation and info pages From 1be07223601cdec74faa4b6514e36a8d7179a011 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 23 May 2011 08:56:54 +0300 Subject: [PATCH 17/23] Split debug symbols in -debuginfo subpackage --- mingw32-gettext.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index 5f7d5b6..569e0ff 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -1,5 +1,6 @@ %define __strip %{_mingw32_strip} %define __objdump %{_mingw32_objdump} +%define __debug_install_post %{_mingw32_debug_install_post} Name: mingw32-gettext Version: 0.18.1.1 @@ -42,6 +43,9 @@ Group: Development/Libraries Static version of the MinGW Windows Gettext library. +%{?_mingw32_debug_package} + + %prep %setup -q -n gettext-%{version} @@ -125,6 +129,7 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/info/ * Mon May 23 2011 Kalev Lember - 0.18.1.1-1 - Update to 0.18.1.1 - Spec cleanup +- Split debug symbols in -debuginfo subpackage * Mon May 23 2011 Kalev Lember - 0.17-16 - Removed html documentation and info pages From e1a17ac79472710915afccbc880e243089216355 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 23 May 2011 12:12:24 +0300 Subject: [PATCH 18/23] Use gettext-0.18.1.1.tar.gz --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3e77f9f..0927f81 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ gettext-0.17.tar.gz +/gettext-0.18.1.1.tar.gz diff --git a/sources b/sources index e072641..68183b4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -58a2bc6d39c0ba57823034d55d65d606 gettext-0.17.tar.gz +3dd55b952826d2b32f51308f2f91aa89 gettext-0.18.1.1.tar.gz From dde9ce243af6feb2bd18d0c8e2aa02e4a169833b Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Wed, 6 Jul 2011 18:15:48 +0200 Subject: [PATCH 19/23] Rebuild against win-iconv --- mingw32-gettext.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index 569e0ff..f710050 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -4,7 +4,7 @@ Name: mingw32-gettext Version: 0.18.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -19,7 +19,7 @@ BuildRequires: mingw32-runtime >= 3.15.1 BuildRequires: mingw32-gcc BuildRequires: mingw32-gcc-c++ BuildRequires: mingw32-binutils -BuildRequires: mingw32-iconv +BuildRequires: mingw32-win-iconv BuildRequires: mingw32-termcap >= 1.3.1-3 # Possible extra BRs. These are used if available, but @@ -126,6 +126,9 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/info/ %changelog +* Wed Jul 6 2011 Erik van Pienbroek - 0.18.1.1-2 +- Rebuild against win-iconv + * Mon May 23 2011 Kalev Lember - 0.18.1.1-1 - Update to 0.18.1.1 - Spec cleanup From 1a4075d58afea5219088b29219119c3c99257916 Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Wed, 6 Jul 2011 21:04:43 +0200 Subject: [PATCH 20/23] Rebuild again to fix incomplete dependencies --- mingw32-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index f710050..6a0842a 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -4,7 +4,7 @@ Name: mingw32-gettext Version: 0.18.1.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -126,6 +126,9 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/info/ %changelog +* Wed Jul 6 2011 Erik van Pienbroek - 0.18.1.1-3 +- Rebuild again to fix incomplete dependencies + * Wed Jul 6 2011 Erik van Pienbroek - 0.18.1.1-2 - Rebuild against win-iconv From 7cacf3d265b67cc0e9ad705e55f63e94a8cae69b Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 13 Jan 2012 03:59:20 -0600 Subject: [PATCH 21/23] - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild --- mingw32-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index 6a0842a..cd0e249 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -4,7 +4,7 @@ Name: mingw32-gettext Version: 0.18.1.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -126,6 +126,9 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/info/ %changelog +* Fri Jan 13 2012 Fedora Release Engineering - 0.18.1.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + * Wed Jul 6 2011 Erik van Pienbroek - 0.18.1.1-3 - Rebuild again to fix incomplete dependencies From 197f761936c1e2d4967c12c18a89ab58eef688c1 Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Mon, 27 Feb 2012 21:37:21 +0100 Subject: [PATCH 22/23] Rebuild against the mingw-w64 toolchain --- mingw32-gettext.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index cd0e249..2d05031 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -4,7 +4,7 @@ Name: mingw32-gettext Version: 0.18.1.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: GNU libraries and utilities for producing multi-lingual messages License: GPLv2+ and LGPLv2+ @@ -126,6 +126,9 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/info/ %changelog +* Mon Feb 27 2012 Erik van Pienbroek - 0.18.1.1-5 +- Rebuild against the mingw-w64 toolchain + * Fri Jan 13 2012 Fedora Release Engineering - 0.18.1.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild From fded1ce3a158f7d5e3050a842ff0f53c9b3bd93e Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Mon, 27 Feb 2012 22:16:26 +0100 Subject: [PATCH 23/23] Added a patch to fix compatibility with mingw-w64 --- gettext-0.18.1.1-tml.patch | 177 +++++++++++++++++++++++++++++++++++++ mingw32-gettext.spec | 9 +- 2 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 gettext-0.18.1.1-tml.patch diff --git a/gettext-0.18.1.1-tml.patch b/gettext-0.18.1.1-tml.patch new file mode 100644 index 0000000..55e295f --- /dev/null +++ b/gettext-0.18.1.1-tml.patch @@ -0,0 +1,177 @@ +--- gettext-runtime/intl/printf.c ++++ gettext-runtime/intl/printf.c +@@ -69,7 +69,7 @@ + #define STATIC static + + /* This needs to be consistent with libgnuintl.h.in. */ +-#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ ++#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ + /* Don't break __attribute__((format(printf,M,N))). + This redefinition is only possible because the libc in NetBSD, Cygwin, + mingw does not have a function __printf__. */ +--- gettext-runtime/intl/libgnuintl.h.in ++++ gettext-runtime/intl/libgnuintl.h.in +@@ -330,7 +330,7 @@ + + #if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */ + #undef printf +-#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ ++#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ + /* Don't break __attribute__((format(printf,M,N))). + This redefinition is only possible because the libc in NetBSD, Cygwin, + mingw does not have a function __printf__. +---- gettext-tools/gnulib-lib/clean-temp.c ++++ gettext-tools/gnulib-lib/clean-temp.c +@@ -66,9 +66,11 @@ + # endif + #endif + ++#ifndef _WIN64 + #ifndef uintptr_t + # define uintptr_t unsigned long + #endif ++#endif + + #if !GNULIB_FCNTL_SAFER + /* The results of open() in this file are not used with fchdir, +--- gettext-tools/gnulib-lib/fstrcmp.c ++++ gettext-tools/gnulib-lib/fstrcmp.c +@@ -55,9 +55,11 @@ + #include "minmax.h" + #include "xalloc.h" + ++#ifndef _WIN64 + #ifndef uintptr_t + # define uintptr_t unsigned long + #endif ++#endif + + + #define ELEMENT char +--- gettext-tools/gnulib-lib/gl_array_list.c ++++ gettext-tools/gnulib-lib/gl_array_list.c +@@ -55,9 +55,11 @@ + /* Checked size_t computations. */ + #include "xsize.h" + ++#ifndef _WIN64 + #ifndef uintptr_t + # define uintptr_t unsigned long + #endif ++#endif + + /* -------------------------- gl_list_t Data Type -------------------------- */ + +--- gettext-tools/gnulib-lib/gl_linkedhash_list.c ++++ gettext-tools/gnulib-lib/gl_linkedhash_list.c +@@ -55,9 +55,11 @@ + + #include "xsize.h" + ++#ifndef _WIN64 + #ifndef uintptr_t + # define uintptr_t unsigned long + #endif ++#endif + + #define WITH_HASHTABLE 1 + +--- gettext-tools/gnulib-lib/stdio.in.h ++++ gettext-tools/gnulib-lib/stdio.in.h +@@ -642,10 +642,6 @@ + # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ + || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@) + # if defined __GNUC__ +-# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +-/* Don't break __attribute__((format(printf,M,N))). */ +-# define printf __printf__ +-# endif + _GL_FUNCDECL_RPL_1 (__printf__, int, + (const char *format, ...) + __asm__ (@ASM_SYMBOL_PREFIX@ +--- gettext-tools/gnulib-lib/tempname.c ++++ gettext-tools/gnulib-lib/tempname.c +@@ -54,6 +54,10 @@ + #include + #include + ++#ifdef _WIN32 ++# include ++#endif ++ + #include + + #if _LIBC +@@ -73,6 +73,10 @@ + # define __xstat64(version, file, buf) stat (file, buf) + #endif + ++#ifdef _WIN32 ++# define mkdir(path,mode) _mkdir(path) ++#endif ++ + #if ! (HAVE___SECURE_GETENV || _LIBC) + # define __secure_getenv getenv + #endif +--- gettext-tools/src/write-java.c ++++ gettext-tools/src/write-java.c +@@ -30,6 +30,10 @@ + #include + #include + ++#ifdef _WIN32 ++# include ++#endif ++ + #include + #if !defined S_ISDIR && defined S_IFDIR + # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +@@ -53,6 +53,10 @@ + # define S_IXUSR 00100 + #endif + ++#ifdef _WIN32 ++# define mkdir(path,mode) _mkdir(path) ++#endif ++ + #include "c-ctype.h" + #include "error.h" + #include "xerror.h" +--- gettext-tools/src/write-csharp.c ++++ gettext-tools/src/write-csharp.c +@@ -29,6 +29,10 @@ + #include + #include + ++#ifdef _WIN32 ++# include ++#endif ++ + #include + #if !defined S_ISDIR && defined S_IFDIR + # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +@@ -70,6 +70,10 @@ + # define S_IXOTH (S_IXUSR >> 6) + #endif + ++#ifdef _WIN32 ++# define mkdir(path,mode) _mkdir(path) ++#endif ++ + #include "c-ctype.h" + #include "relocatable.h" + #include "error.h" +--- gettext-tools/woe32dll/export.h ++++ gettext-tools/woe32dll/export.h +@@ -90,7 +90,11 @@ + --export-all-symbols is used. */ + + /* IMP(x) is a symbol that contains the address of x. */ ++#ifdef _WIN64 ++#define IMP(x) __imp_##x ++#else + #define IMP(x) _imp__##x ++#endif + + /* Ensure that the variable x is exported from the library, and that a + pseudo-variable IMP(x) is available. */ diff --git a/mingw32-gettext.spec b/mingw32-gettext.spec index 2d05031..244f9bd 100644 --- a/mingw32-gettext.spec +++ b/mingw32-gettext.spec @@ -12,6 +12,9 @@ Group: Development/Libraries URL: http://www.gnu.org/software/gettext/ Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-%{version}.tar.gz +# Fix compatibility with mingw-w64 +Patch0: gettext-0.18.1.1-tml.patch + BuildArch: noarch BuildRequires: mingw32-filesystem >= 68 @@ -48,10 +51,13 @@ Static version of the MinGW Windows Gettext library. %prep %setup -q -n gettext-%{version} +%patch0 -p0 %build -echo "gl_cv_func_memchr_works='yes'" >> %{_mingw32_cache} +# Some build workarounds +export gl_cv_func_memchr_works="yes" +export ac_cv_func_strnlen_working="yes" %{_mingw32_configure} \ --disable-java \ --disable-native-java \ @@ -128,6 +134,7 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/info/ %changelog * Mon Feb 27 2012 Erik van Pienbroek - 0.18.1.1-5 - Rebuild against the mingw-w64 toolchain +- Added a patch to fix compatibility with mingw-w64 * Fri Jan 13 2012 Fedora Release Engineering - 0.18.1.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild