ports/138105: [patch] games/wesnoth: fix fribidi2 detection and use

Anonymous swell.k at gmail.com
Sun Aug 23 15:40:05 UTC 2009


>Number:         138105
>Category:       ports
>Synopsis:       [patch] games/wesnoth: fix fribidi2 detection and use
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 23 15:40:03 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 8.0-CURRENT amd64
>Organization:
>Environment:
System: FreeBSD 8.0-BETA2 #0 r196396M: Thu Aug 20 02:38:37 UTC 2009     root at luffy:/usr/obj/usr/src/sys/PHOENIX  amd64

>Description:
Aftermath of ports/137946, games/wesnoth still uses fribidi-config.

Change it to use pkg-config instead:
- use autotools
- copy fixes from wesnoth 1.7.3 (actually r36767 and r37394) for files
  configure.ac
  src/Makefile.am
  src/font.cpp
- adapt existing patches for automake run:
  patch-Makefile.in     -> patch-Makefile.am
  patch-src-Makefile.in -> patch-src-Makefile.am

Note: I don't care about wesnoth-devel-1.5.14 unless someone updates
      it to wesnoth-devel-1.7.3 (see ports/137384).
>How-To-Repeat:
1. make config -> select `FRIBIDI' option
2. make install
>Fix:
--- wesnoth.diff begins here ---
 games/wesnoth/Makefile                    |    4 +-
 games/wesnoth/files/patch-Makefile.am     |   11 +++++
 games/wesnoth/files/patch-Makefile.in     |   11 -----
 games/wesnoth/files/patch-configure.ac    |   56 ++++++++++++++++++++++++++++++
 games/wesnoth/files/patch-src-Makefile.am |   34 ++++++++++++++++++
 games/wesnoth/files/patch-src-Makefile.in |   11 -----
 games/wesnoth/files/patch-src-font.cpp    |   44 +++++++++++++++++++++++
 7 files changed, 148 insertions(+), 23 deletions(-)
Index: games/wesnoth/Makefile
===================================================================
RCS file: /home/csup/ports/games/wesnoth/Makefile,v
retrieving revision 1.70
diff -u -p -r1.70 Makefile
--- games/wesnoth/Makefile	22 Aug 2009 17:36:56 -0000	1.70
+++ games/wesnoth/Makefile	23 Aug 2009 14:16:07 -0000
@@ -27,7 +27,9 @@ USE_GMAKE=	yes
 MAKE_JOBS_SAFE=	yes
 WANT_GNOME=	yes
 USE_BZIP2=	yes
-GNU_CONFIGURE=	yes
+USE_AUTOTOOLS=	aclocal:110 autoheader:262 automake:110 autoconf:262
+ACLOCAL_ARGS=	-Im4
+AUTOMAKE_ARGS=	--add-missing --copy
 CONFIGURE_ARGS=	--localstatedir=/var \
 		--with-libiconv-prefix=${LOCALBASE} \
 		--with-libintl-prefix=${LOCALBASE} \
Index: games/wesnoth/files/patch-Makefile.am
===================================================================
RCS file: games/wesnoth/files/patch-Makefile.am
diff -N games/wesnoth/files/patch-Makefile.am
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/wesnoth/files/patch-Makefile.am	23 Aug 2009 15:03:58 -0000
@@ -0,0 +1,11 @@
+--- Makefile.am~
++++ Makefile.am
+@@ -5,7 +5,7 @@ pkgdatadir=$(datadir)/@DATADIR@
+ bin_SCRIPTS =
+ 
+ # Ignore junk -- object files, editor backup files, wmllint backup files.
+-findfilterflags=! \( -name .svn -prune -o -name ".\#*" -o -name "*~" -o -name "*bak" -o -name 'Makefile' -o -name '*Makefile' -o -type d -o -wholename "data/test/*" \)
++findfilterflags=! \( -name .svn -prune -o -name ".\#*" -o -name "*~" -o -name "*bak" -o -name 'Makefile' -o -name '*Makefile' -o -type d -o -path "data/test/*" \)
+ 
+ # List all datafiles, ignoring junk
+ finddata=(cd $(top_srcdir) && find data fonts icons images sounds $(findfilterflags) -print )
Index: games/wesnoth/files/patch-Makefile.in
===================================================================
RCS file: games/wesnoth/files/patch-Makefile.in
diff -N games/wesnoth/files/patch-Makefile.in
--- games/wesnoth/files/patch-Makefile.in	24 Mar 2009 20:09:03 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- Makefile.in.orig	2009-03-24 16:52:32.000000000 +0100
-+++ Makefile.in	2009-03-24 16:52:43.000000000 +0100
-@@ -279,7 +279,7 @@
- bin_SCRIPTS = 
- 
- # Ignore junk -- object files, editor backup files, wmllint backup files.
--findfilterflags = ! \( -name .svn -prune -o -name ".\#*" -o -name "*~" -o -name "*bak" -o -name 'Makefile' -o -name '*Makefile' -o -type d -o -wholename "data/test/*" \)
-+findfilterflags = ! \( -name .svn -prune -o -name ".\#*" -o -name "*~" -o -name "*bak" -o -name 'Makefile' -o -name '*Makefile' -o -type d -o -path "data/test/*" \)
- 
- # List all datafiles, ignoring junk
- finddata = (cd $(top_srcdir) && find data fonts icons images sounds $(findfilterflags) -print )
Index: games/wesnoth/files/patch-configure.ac
===================================================================
RCS file: games/wesnoth/files/patch-configure.ac
diff -N games/wesnoth/files/patch-configure.ac
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/wesnoth/files/patch-configure.ac	23 Aug 2009 14:59:44 -0000
@@ -0,0 +1,56 @@
+--- configure.ac~
++++ configure.ac
+@@ -111,7 +111,7 @@ then
+ fi
+ 
+ # Make tests default in svn version
+-svn_in_version=`expr match "$WESNOTH_VERSION" '.*svn'`
++svn_in_version=`expr "$WESNOTH_VERSION" : '.*svn'`
+ test_build=yes
+ if test $svn_in_version = 0 
+ then
+Index: configure.ac
+===================================================================
+--- configure.ac	(revision 36766)
++++ configure.ac	(revision 37394)
+@@ -416,21 +416,27 @@
+ 
+ # fribidi-config
+ 
+-AC_PATH_PROGS([FRIBIDI_CONFIG], [fribidi-config], [none])
+-
+-if test "x$FRIBIDI_CONFIG" = "xnone"; then
+-    fribidifound=no
+-    AC_MSG_WARN([*** FRIBIDI not found.])
+-else
+-    fribidifound=yes
+-    FRIBIDI_CFLAGS=`$FRIBIDI_CONFIG --cflags`
+-    FRIBIDI_LIBS=`$FRIBIDI_CONFIG --libs`
++if test "x$fribidi" != "xno"; then
++	PKG_CHECK_MODULES([FRIBIDI2], [fribidi >= 0.19.0],
++		[
++			fribidifound=yes
++		],
++		[
++			AC_MSG_RESULT(no)
++			PKG_CHECK_MODULES([FRIBIDI], [fribidi],
++				[
++					fribidifound=yes
++					oldfribidi=yes
++				],
++				[
++					fribidifound=no
++					AC_MSG_RESULT(no)
++				])
++		])
++	AM_CONDITIONAL([FRIBIDI], [test "x$fribidifound" = xyes])
++	AM_CONDITIONAL([OLD_FRIBIDI], [test "x$oldfribidi" = xyes])
+ fi
+ 
+-AC_SUBST([FRIBIDI_CFLAGS])
+-AC_SUBST([FRIBIDI_LIBS])
+-AM_CONDITIONAL([FRIBIDI], [test "x$fribidifound" = xyes -a "x$fribidi" = xyes ])
+-
+ # python
+ AC_PATH_PROG(PYTHON, python, none)
+ AC_SUBST(pkgpythondir)
Index: games/wesnoth/files/patch-src-Makefile.am
===================================================================
RCS file: games/wesnoth/files/patch-src-Makefile.am
diff -N games/wesnoth/files/patch-src-Makefile.am
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/wesnoth/files/patch-src-Makefile.am	23 Aug 2009 15:06:34 -0000
@@ -0,0 +1,34 @@
+--- src/Makefile.am~
++++ src/Makefile.am
+@@ -400,7 +400,7 @@ game_config.o: revision.hpp 
+ REVISION = $(shell LC_ALL=C svnversion -n $(topdir) 2>/dev/null)
+ .PRECIOUS: revision.hpp
+ revision.hpp: FORCE
+-	if [ "$(REVISION)" == "" ] || [ "$(REVISION)" == "exported" ]; then echo '' >/tmp/westemp$$$$; \
++	if [ "$(REVISION)" = "" ] || [ "$(REVISION)" = "exported" ]; then echo '' >/tmp/westemp$$$$; \
+ 	else echo '#define REVISION    "$(REVISION)"' >/tmp/westemp$$$$; fi;\
+ 	if cmp -s revision.hpp /tmp/westemp$$$$ 2>/dev/null; then :; else cp /tmp/westemp$$$$ revision.hpp; fi; \
+ 	if [ -e /tmp/westemp$$$$ ]; then rm /tmp/westemp$$$$; fi
+Index: src/Makefile.am
+===================================================================
+--- src/Makefile.am	(revision 37393)
++++ src/Makefile.am	(revision 37394)
+@@ -485,10 +485,16 @@
+ 	-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR)
+ 
+ if FRIBIDI
+-    AM_CXXFLAGS += -DHAVE_FRIBIDI @FRIBIDI_CFLAGS@
+-    AM_CFLAGS += -DHAVE_FRIBIDI @FRIBIDI_CFLAGS@
++if OLD_FRIBIDI
++    CXXFLAGS += -DOLD_FRIBIDI @FRIBIDI_CFLAGS@
++    CFLAGS += -DOLD_FRIBIDI @FRIBIDI_CFLAGS@
+     THELIBS += @FRIBIDI_LIBS@
++else
++    CXXFLAGS += -DHAVE_FRIBIDI @FRIBIDI2_CFLAGS@
++    CFLAGS += -DHAVE_FRIBIDI @FRIBIDI2_CFLAGS@
++    THELIBS += @FRIBIDI2_LIBS@
+ endif
++endif
+ 
+ if X11
+     CXXFLAGS += -D_X11 @X_CFLAGS@
Index: games/wesnoth/files/patch-src-Makefile.in
===================================================================
RCS file: games/wesnoth/files/patch-src-Makefile.in
diff -N games/wesnoth/files/patch-src-Makefile.in
--- games/wesnoth/files/patch-src-Makefile.in	24 Mar 2009 20:09:03 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- src/Makefile.in.orig	2008-11-02 19:33:40.000000000 +0100
-+++ src/Makefile.in	2008-11-02 19:33:49.000000000 +0100
-@@ -1783,7 +1783,7 @@
- game_config.o: revision.hpp 
- .PRECIOUS: revision.hpp
- revision.hpp: FORCE
--	if [ "$(REVISION)" == "" ] || [ "$(REVISION)" == "exported" ]; then echo '' >/tmp/westemp$$$$; \
-+	if [ "$(REVISION)" = "" ] || [ "$(REVISION)" = "exported" ]; then echo '' >/tmp/westemp$$$$; \
- 	else echo '#define REVISION    "$(REVISION)"' >/tmp/westemp$$$$; fi;\
- 	if cmp -s revision.hpp /tmp/westemp$$$$ 2>/dev/null; then :; else cp /tmp/westemp$$$$ revision.hpp; fi; \
- 	if [ -e /tmp/westemp$$$$ ]; then rm /tmp/westemp$$$$; fi
Index: games/wesnoth/files/patch-src-font.cpp
===================================================================
RCS file: games/wesnoth/files/patch-src-font.cpp
diff -N games/wesnoth/files/patch-src-font.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/wesnoth/files/patch-src-font.cpp	23 Aug 2009 14:56:13 -0000
@@ -0,0 +1,44 @@
+Index: src/font.cpp
+===================================================================
+--- src/font.cpp	(revision 36766)
++++ src/font.cpp	(revision 37394)
+@@ -50,10 +50,7 @@
+ #define ERR_FT LOG_STREAM(err, log_font)
+ 
+ #ifdef	HAVE_FRIBIDI
+-#include <fribidi/fribidi.h>
+-
+-#else
+-
++#include <fribidi.h>
+ #endif
+ 
+ namespace {
+@@ -467,16 +464,25 @@
+ void text_surface::bidi_cvt()
+ {
+ 	char		*c_str = const_cast<char *>(str_.c_str());	// fribidi forgot const...
+-	int		len = str_.length();
++	FriBidiStrIndex	len = str_.length();
+ 	FriBidiChar	*bidi_logical = new FriBidiChar[len + 2];
+ 	FriBidiChar	*bidi_visual = new FriBidiChar[len + 2];
+ 	char		*utf8str = new char[4*len + 1];	//assume worst case here (all 4 Byte characters)
+ 	FriBidiCharType	base_dir = FRIBIDI_TYPE_ON;
+-	int n;
++	FriBidiStrIndex n;
+ 
++
++#ifdef	OLD_FRIBIDI
+ 	n = fribidi_utf8_to_unicode (c_str, len, bidi_logical);
++#else
++	n = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, c_str, len, bidi_logical);
++#endif
+ 	fribidi_log2vis(bidi_logical, n, &base_dir, bidi_visual, NULL, NULL, NULL);
++#ifdef	OLD_FRIBIDI
+ 	fribidi_unicode_to_utf8 (bidi_visual, n, utf8str);
++#else
++	fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, bidi_visual, n, utf8str);
++#endif
+ 	is_rtl_ = base_dir == FRIBIDI_TYPE_RTL;
+ 	str_ = std::string(utf8str);
+ 	delete[] bidi_logical;
--- wesnoth.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list