From 361dc017a1c13de8af4a1bb9e5b27accd1c4e577 Mon Sep 17 00:00:00 2001 From: Olivier Teuliere Date: Mon, 14 Sep 2020 21:13:35 +0200 Subject: [PATCH] Temporarily revert some of the previous commits to use an older gettext This makes it much easier to package eliot for Ubuntu Focal, where gettext 0.20 is not yet available. This reverts the following commits: - 4f4ada677cc7f2e600ca56a88afd03230377f1eb - 7bc44cf5ece3a2bd05132eb06dc6430d50eebd18 - 32a7aa223483c115e5ddaa2eee4d26f783c0f490 It also changes the gettext version in configure.ac. --- .gitignore | 2 +- Makefile.am | 2 +- bootstrap | 4 +++- configure.ac | 8 ++++---- dic/Makefile.am | 8 ++++---- extras/contrib/Makefile | 23 +---------------------- po/makefile-qt4.patch | 17 ++++++++--------- qt/Makefile.am | 2 +- utils/Makefile.am | 4 ++-- 9 files changed, 25 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index e3dead8..72a2d0a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ configure missing .deps tags +intl ABOUT-NLS config.rpath mkinstalldirs @@ -32,7 +33,6 @@ m4/fcntl-o.m4 m4/gettext.m4 m4/glibc2.m4 m4/glibc21.m4 -m4/host-cpu-c-abi.m4 m4/iconv.m4 m4/intdiv0.m4 m4/intl.m4 diff --git a/Makefile.am b/Makefile.am index 4d3e07b..d62f68b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = dic game utils qt po extras +SUBDIRS = intl dic game utils qt po extras ACLOCAL_AMFLAGS = -I m4 diff --git a/bootstrap b/bootstrap index 09217da..029ced3 100755 --- a/bootstrap +++ b/bootstrap @@ -5,4 +5,6 @@ patch -p0 < po/makefile-qt4.patch aclocal -I m4 autoheader automake --add-missing --foreign --copy -Wall -autoconf -Wall +# It would be nice to use -Wall, but AM_GNU_GETTEXT generates +# way too many warnings in version 0.18.1 +autoconf -Wno-obsolete diff --git a/configure.ac b/configure.ac index 590f5ff..019f416 100644 --- a/configure.ac +++ b/configure.ac @@ -211,11 +211,11 @@ AC_ARG_ENABLE([text],AS_HELP_STRING([--enable-text],[text interface support (def AM_CONDITIONAL([BUILD_TEXT], [test "${enable_text}" != "no"]) dnl Internationalization macros -AM_GNU_GETTEXT_VERSION(0.20) -AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.19.3) +AM_GNU_GETTEXT dnl Iconv -AM_ICONV +dnl This test depends on AM_GNU_GETTEXT executed before AS_IF([test "$am_cv_func_iconv" != "yes"], [AC_MSG_ERROR([libiconv is needed for Eliot to work properly])]) @@ -242,7 +242,7 @@ fi dnl -------------------------------------------------------------- dnl Output dnl -------------------------------------------------------------- -AC_CONFIG_FILES(po/Makefile.in +AC_CONFIG_FILES(intl/Makefile po/Makefile.in dic/Makefile game/Makefile utils/Makefile diff --git a/dic/Makefile.am b/dic/Makefile.am index f34a617..7fb3813 100644 --- a/dic/Makefile.am +++ b/dic/Makefile.am @@ -20,7 +20,7 @@ noinst_LIBRARIES = libdic.a localedir = $(datadir)/locale -AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir) $(INCICONV) @LOG4CXX_CFLAGS@ +AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir) -I../intl -I$(top_srcdir)/intl $(INCICONV) @LOG4CXX_CFLAGS@ libdic_a_SOURCES = \ logging.h \ @@ -51,14 +51,14 @@ bin_PROGRAMS = \ compdic_SOURCES=compdicmain.cpp compdic_CPPFLAGS=$(AM_CPPFLAGS) @BOOST_CPPFLAGS@ -compdic_LDADD=libdic.a @LIBINTL@ @LIBICONV@ +compdic_LDADD=libdic.a @LIBINTL@ listdic_SOURCES=listdicmain.cpp -listdic_LDADD=libdic.a @LIBINTL@ @LIBICONV@ +listdic_LDADD=libdic.a @LIBINTL@ #regexp_CFLAGS=-DDEBUG_RE regexp_SOURCES=regexpmain.cpp -regexp_LDADD=libdic.a @LIBINTL@ @LIBICONV@ +regexp_LDADD=libdic.a @LIBINTL@ if WITH_LOGGING compdic_LDADD += @LOG4CXX_LIBS@ diff --git a/extras/contrib/Makefile b/extras/contrib/Makefile index 8065754..208c459 100644 --- a/extras/contrib/Makefile +++ b/extras/contrib/Makefile @@ -3,7 +3,6 @@ APU_VERSION := 1.6.1 ARABICA_VERSION := 2016-January BOOST_VERSION := 1.72.0 EXPAT_VERSION := 2.2.9 -GETTEXT_VERSION := 0.20.1 ICONV_VERSION := 1.16 LIBCONFIG_VERSION := 1.7.2 LIBXML2_VERSION := 2.9.8 @@ -32,7 +31,7 @@ CONFIGURE = CC="$(CC)" CXX="$(CXX)" CPPFLAGS="$(CPPFLAGS)" ./configure --host=$( # Dependencies (incomplete list): # expat <- apr <- apu <- log4cxx -LIBS := iconv gettext boost expat apr apu libconfig log4cxx arabica qt2 +LIBS := iconv boost expat apr apu libconfig log4cxx arabica qt2 TARGETS = $(LIBS:%=.%) .PHONY: help all clean clean-% distclean distclean-% @@ -170,26 +169,6 @@ $(EXPAT_DIR_FLAG): $(EXPAT_ARCHIVE) touch $@ -### gettext ### - -GETTEXT_DIR = $(BUILD_DIR)/gettext-$(GETTEXT_VERSION) -GETTEXT_DIR_FLAG = $(GETTEXT_DIR)/.flag -GETTEXT_ARCHIVE = $(ARCHIVE_DIR)/gettext-$(GETTEXT_VERSION).tar.gz - -$(GETTEXT_ARCHIVE): $(PREFIX_FLAG) - $(WGET) https://ftp.gnu.org/pub/gnu/gettext/$(shell basename $@) - -$(GETTEXT_DIR_FLAG): $(GETTEXT_ARCHIVE) - $(TAR) -xzf $< - touch $@ - -.gettext: $(GETTEXT_DIR_FLAG) - (cd $(GETTEXT_DIR) \ - && $(CONFIGURE) --disable-java --disable-native-java --disable-relocatable --without-emacs --without-included-libxml \ - && make install) - touch $@ - - ### iconv ### ICONV_DIR = $(BUILD_DIR)/libiconv-$(ICONV_VERSION) diff --git a/po/makefile-qt4.patch b/po/makefile-qt4.patch index d60e2d8..9894e5a 100644 --- a/po/makefile-qt4.patch +++ b/po/makefile-qt4.patch @@ -1,6 +1,6 @@ ---- po/Makefile.in.in 2020-04-06 19:12:50.652868150 +0200 -+++ po/Makefile.in.in.new 2020-04-06 19:16:31.289415435 +0200 -@@ -163,6 +163,11 @@ +--- po/Makefile.in.in 2013-01-06 17:32:47.328960440 +0100 ++++ po/Makefile.in.in.new 2013-01-06 17:34:22.641893986 +0100 +@@ -135,6 +135,11 @@ # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. @@ -11,22 +11,21 @@ + # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. - # The determination of whether the package xyz is a GNU one is based on the -@@ -194,7 +199,7 @@ + $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed +@@ -150,14 +155,14 @@ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_builddir) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ -@@ -202,7 +207,7 @@ - $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_builddir) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ diff --git a/qt/Makefile.am b/qt/Makefile.am index 68ce4b2..6a04c61 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -148,7 +148,7 @@ BUILT_SOURCES = $(nodist_eliot_SOURCES) MOSTLYCLEANFILES = $(nodist_eliot_SOURCES) -eliot_LDADD = ../game/libgame.a ../dic/libdic.a @QT_LIBS@ @LIBINTL@ @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ +eliot_LDADD = ../game/libgame.a ../dic/libdic.a @QT_LIBS@ @LIBINTL@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ # Needed for proper stack trace handling eliot_LDFLAGS = -rdynamic diff --git a/utils/Makefile.am b/utils/Makefile.am index aa0039e..8469cc0 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -25,7 +25,7 @@ bin_PROGRAMS = if BUILD_TEXT noinst_PROGRAMS += eliottxt eliottxt_SOURCES = game_io.h game_io.cpp eliottxt.cpp -eliottxt_LDADD = $(top_builddir)/game/libgame.a $(top_builddir)/dic/libdic.a @LIBINTL@ @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ +eliottxt_LDADD = $(top_builddir)/game/libgame.a $(top_builddir)/dic/libdic.a @LIBINTL@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ if HAS_READLINE eliottxt_LDADD += -lreadline @@ -38,7 +38,7 @@ endif if BUILD_NCURSES bin_PROGRAMS += eliotcurses eliotcurses_SOURCES = curses_intf.cpp curses_intf.h -eliotcurses_LDADD = ../game/libgame.a ../dic/libdic.a @CURSES_LIB@ @LIBINTL@ @LIBICONV@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ +eliotcurses_LDADD = ../game/libgame.a ../dic/libdic.a @CURSES_LIB@ @LIBINTL@ @LIBCONFIG_LIBS@ @ARABICA_LIBS@ @EXPAT_LIBS@ if WITH_LOGGING eliotcurses_LDADD += @LOG4CXX_LIBS@ endif