Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Nov 2007 19:17:58 +0100
From:      "Pietro Cerutti" <gahr@gahr.ch>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   ports/118185: [patch] games/adonthell unbreak fix build w/ GCC 4.2 + upgrade to python25
Message-ID:  <1195669078.988@gahrtop.localhost>
Resent-Message-ID: <200711211820.lALIK1Ib002345@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         118185
>Category:       ports
>Synopsis:       [patch] games/adonthell unbreak fix build w/ GCC 4.2 + upgrade to python25
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 21 18:20:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Pietro Cerutti
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:


System: FreeBSD 8.0-CURRENT #12: Tue Nov 20 17:46:40 CET 2007
    root@gahrtop.localhost:/usr/obj/usr/src/sys/MSI1034



>Description:


- fixed an "extra qualification on member" error
- got rid of a few string -> char * conversion warnings
- upgraded USE_PYTHON from "-2.4" to "-2.5"
- removed useless USE_GMAKE flag from Makefile


>How-To-Repeat:


cd /usr/ports/games/adonthell && make


>Fix:


--- _adonthell.diff begins here ---
--- Makefile.orig	2007-07-30 11:41:28.000000000 +0200
+++ Makefile	2007-11-21 19:14:42.000000000 +0100
@@ -22,9 +22,8 @@
 LIB_DEPENDS=	vorbis.4:${PORTSDIR}/audio/libvorbis
 
 USE_SDL=	mixer sdl
-USE_PYTHON=	-2.4
+USE_PYTHON=	-2.5
 USE_GETTEXT=	yes
-USE_GMAKE=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS+=	--disable-py-debug
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@@ -33,10 +32,6 @@
 
 .include <bsd.port.pre.mk>
 
-.if ${OSVERSION} >= 700042
-BROKEN=		Broken with gcc 4.2
-.endif
-
 .if ${ARCH} == "sparc64"
 BROKEN=		Does not build on sparc64
 .endif
--- /dev/null	2007-11-21 19:06:29.000000000 +0100
+++ files/patch-src_dialog.cc	2007-11-21 17:52:14.000000000 +0100
@@ -0,0 +1,41 @@
+--- src/dialog.cc.orig	2007-11-21 17:49:38.000000000 +0100
++++ src/dialog.cc	2007-11-21 17:52:11.000000000 +0100
+@@ -90,7 +90,7 @@
+         {
+             s = PyList_GetItem (list, i);
+             if (s && PyString_Check (s)) strings[i] = PyString_AsString (s);
+-            else strings[i] = "*** Error";
++            else strings[i] = (char *)"*** Error";
+         }
+ 
+         Py_DECREF (list);
+@@ -157,7 +157,7 @@
+     do
+     {
+         // Execute the next part of the dialogue
+-        arg = Py_BuildValue ("(i)", answer);
++        arg = Py_BuildValue ((char *)"(i)", answer);
+         
+          // run next part of dialogue
+         dialogue.run (arg);
+@@ -222,7 +222,7 @@
+             }
+             
+             // check whether we shall continue or not
+-            arg = Py_BuildValue ("(i)", answer);
++            arg = Py_BuildValue ((char *)"(i)", answer);
+             result = dialogue.call_method_ret ("stop", arg);
+             stop = PyInt_AsLong (result);
+             Py_XDECREF (result);
+@@ -298,9 +298,9 @@
+             strncpy (str, start+3, end);
+ 
+             if (the_player->storage::get_val ("gender") == FEMALE)
+-                mid = get_substr (str, "{", "/");
++                mid = get_substr (str, (char *)"{", (char *)"/");
+             else
+-                mid = get_substr (str, "/", "}");
++                mid = get_substr (str, (char *)"/", (char *)"}");
+ 
+             begin = newstr.length () - strlen(start);
+             tmp = new char[newstr.length () - end + strlen (mid)];
--- /dev/null	2007-11-21 19:06:29.000000000 +0100
+++ files/patch-src_drawing_area.h	2007-11-21 17:49:29.000000000 +0100
@@ -0,0 +1,11 @@
+--- src/drawing_area.h.orig	2007-11-21 17:48:25.000000000 +0100
++++ src/drawing_area.h	2007-11-21 17:48:50.000000000 +0100
+@@ -156,7 +156,7 @@
+      * 
+      * @return drawing_area which has the same dimensions and location as r.
+      */
+-    drawing_area& drawing_area::operator = (SDL_Rect& r); 
++    drawing_area& operator = (SDL_Rect& r); 
+ #endif
+     
+     /** 
--- /dev/null	2007-11-21 19:06:29.000000000 +0100
+++ files/patch-src_music.c	2007-11-21 18:02:45.000000000 +0100
@@ -0,0 +1,20 @@
+--- src/music.c.orig	2007-11-21 18:01:48.000000000 +0100
++++ src/music.c	2007-11-21 18:02:31.000000000 +0100
+@@ -393,7 +393,7 @@
+ #endif
+ #ifdef MID_MUSIC
+ 	/* MIDI files have the magic four bytes "MThd" */
+-	if ( strcmp(magic, "MThd") == 0 ) {
++	if ( strcmp((char *)magic, "MThd") == 0 ) {
+ 		music->type = MUS_MID;
+ 		if ( timidity_ok ) {
+ 			music->data.midi = Timidity_LoadSong((char *)file);
+@@ -410,7 +410,7 @@
+ #endif
+ #ifdef OGG_MUSIC
+ 	/* Ogg Vorbis files have the magic four bytes "OggS" */
+-	if ( strcmp(magic, "OggS") == 0 ) {
++	if ( strcmp((char *)magic, "OggS") == 0 ) {
+ 		music->type = MUS_OGG;
+ 		music->data.ogg = OGG_new(file);
+ 		if ( music->data.ogg == NULL ) {
--- /dev/null	2007-11-21 19:06:29.000000000 +0100
+++ files/patch-src_prefs.cc	2007-11-21 17:58:53.000000000 +0100
@@ -0,0 +1,11 @@
+--- src/prefs.cc.orig	2007-11-21 17:58:31.000000000 +0100
++++ src/prefs.cc	2007-11-21 17:58:43.000000000 +0100
+@@ -144,7 +144,7 @@
+             case 'c':
+             {
+                 python::init (); 
+-                python::exec_string ("import compileall; compileall.compile_dir (\".\", 0);");  
++                python::exec_string ((char *)"import compileall; compileall.compile_dir (\".\", 0);");  
+                 python::cleanup (); 
+                 exit (0); 
+                 break;
--- /dev/null	2007-11-21 19:06:29.000000000 +0100
+++ files/patch-src_py_callback.cc	2007-11-21 17:54:21.000000000 +0100
@@ -0,0 +1,40 @@
+--- src/py_callback.cc.orig	2007-11-21 17:53:00.000000000 +0100
++++ src/py_callback.cc	2007-11-21 17:54:03.000000000 +0100
+@@ -55,7 +55,7 @@
+ // calls the python function without argument
+ void py_callback::callback_func0 ()
+ {
+-    PyObject *py_arg = arguments ? Py_BuildValue ("(O)",arguments) : NULL;
++    PyObject *py_arg = arguments ? Py_BuildValue ((char *)"(O)",arguments) : NULL;
+     PyObject* val = make_call (py_arg);
+     Py_XDECREF (val);
+ }
+@@ -65,7 +65,7 @@
+ {
+     int retval = 1;
+     
+-    PyObject *py_arg = arguments ? Py_BuildValue ("(O)",arguments) : NULL;
++    PyObject *py_arg = arguments ? Py_BuildValue ((char *)"(O)",arguments) : NULL;
+     PyObject* val = make_call (py_arg);
+ 
+     if (val) retval = PyInt_AsLong (val);
+@@ -79,8 +79,8 @@
+ {
+     PyObject *py_arg;
+ 
+-    if (arguments) py_arg = Py_BuildValue ("(i,O)", arg, arguments);
+-    else py_arg = Py_BuildValue ("(i)", arg);
++    if (arguments) py_arg = Py_BuildValue ((char *)"(i,O)", arg, arguments);
++    else py_arg = Py_BuildValue ((char *)"(i)", arg);
+ 
+     PyObject * val = make_call (py_arg);
+     Py_XDECREF (val);
+@@ -93,7 +93,7 @@
+     
+     // get name of callback function
+     if (function) {
+-	PyObject *p_name = PyObject_GetAttrString (function, "__name__");
++	PyObject *p_name = PyObject_GetAttrString (function, (char *)"__name__");
+     	if (PyString_Check (p_name)) name = PyString_AsString (p_name);
+     	else fprintf (stderr, "*** error: py_callback::put_state: Failed to retrieve callback name!");
+      
--- _adonthell.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1195669078.988>