Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 May 2006 02:30:07 +0100
From:      Shaun Amott <shaun@inerd.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/97866: games/lianliankan: Fix build on 4.x
Message-ID:  <1148520607.3531@charon.picobyte.net>
Resent-Message-ID: <200605250130.k4P1UIVR000572@freefall.freebsd.org>

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

>Number:         97866
>Category:       ports
>Synopsis:       games/lianliankan: Fix build on 4.x
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 25 01:30:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Shaun Amott
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
>Environment:

>Description:

- Fix build on 4.x
- Add USE_GETTEXT

>How-To-Repeat:

>Fix:

--- lianliankan.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/games/lianliankan/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile	21 May 2006 18:58:13 -0000	1.2
+++ Makefile	25 May 2006 01:25:44 -0000
@@ -16,6 +16,7 @@
 COMMENT=	A scarce recreation game
 
 USE_GNOME=	gtk20 esound
+USE_GETTEXT=	yes
 GNU_CONFIGURE=	yes
 USE_GMAKE=	yes
 USE_X_PREFIX=	yes
@@ -24,10 +25,6 @@
 		LDFLAGS="-L${LOCALBASE}/lib"
 
 .include <bsd.port.pre.mk>
-
-.if ${OSVERSION} < 500000
-BROKEN=		does not compile
-.endif
 
 post-install:
 	${MKDIR} ${PREFIX}/share/applications
Index: files/patch-src_main.c
===================================================================
RCS file: files/patch-src_main.c
diff -N files/patch-src_main.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src_main.c	25 May 2006 01:25:44 -0000
@@ -0,0 +1,90 @@
+--- src/main.c.orig	Wed Dec  7 05:15:14 2005
++++ src/main.c	Thu May 25 00:52:58 2006
+@@ -727,9 +727,9 @@
+     /* get and set next card back, and get and set next background picture */
+     ui_pixbuf.cardback_choice = ui_pixbuf.cardback_choice>=5?0:ui_pixbuf.cardback_choice+1;
+     if(pak_info.back_num > 0){
++      gchar bgfilename[30];
+       ui_pixbuf.randomback_choice = ui_pixbuf.randomback_choice>pak_info.back_num-1?1:ui_pixbuf.randomback_choice+1;
+       /* Extract the bg picture and read it to ui_pixbuf.randomback */
+-      gchar bgfilename[30];
+       sprintf(bgfilename,"back%d.jpg",ui_pixbuf.randomback_choice-1);
+       if(!ExtractSingleFile(bgfilename)){g_print(_("Failed to extract file:%s.\n"),bgfilename);}
+       sprintf(bgfilename,"/tmp/llk_back%d.jpg",ui_pixbuf.randomback_choice-1);
+@@ -1200,12 +1200,13 @@
+   struct passwd *user;
+   int result;
+   char path[MAX_PATH_LENGTH];
+-  *message = (gchar *)g_malloc(sizeof(gchar)*100);
+   gchar *return_str;
+   GSList *radio_item_group=NULL;
+   GtkWidget *menu,*menuitem;
+   gint i;
+ 
++  *message = (gchar *)g_malloc(sizeof(gchar)*100);
++
+   /* load ini file,if it do not exist, make a new one */
+   user = getpwuid(getuid());
+   /*user home directory: user->pw_dir*/
+@@ -1352,9 +1353,9 @@
+   ui_pixbuf.mainback   = gdk_pixbuf_new_from_file("/tmp/llk_mainback.jpg",NULL);
+   ui_pixbuf.cardback_choice = g_rand_int_range(ui_rand,0,6); /*begin to end-1*/
+   if(pak_info.back_num > 0){
++    gchar bgfilename[30];
+     ui_pixbuf.randomback_choice = g_rand_int_range(ui_rand,1,pak_info.back_num+1);
+     /* Extract the bg picture and read it to ui_pixbuf.randomback */
+-    gchar bgfilename[30];
+     sprintf(bgfilename,"back%d.jpg",ui_pixbuf.randomback_choice-1);
+     if(!ExtractSingleFile(bgfilename)){g_print(_("Failed to extract file:%s.\n"),bgfilename);}
+     sprintf(bgfilename,"/tmp/llk_back%d.jpg",ui_pixbuf.randomback_choice-1);
+@@ -1474,9 +1475,9 @@
+           ui_pixbuf.mainback   = gdk_pixbuf_new_from_file("/tmp/llk_mainback.jpg",NULL);
+           /* ui_pixbuf.cardback_choice = g_rand_int_range(ui_rand,0,6);*//*Do not change card back choice when change theme*/
+           if(pak_info.back_num > 0){
++              gchar bgfilename[30];
+               ui_pixbuf.randomback_choice = g_rand_int_range(ui_rand,1,pak_info.back_num+1);
+               /* Extract the bg picture and read it to ui_pixbuf.randomback */
+-              gchar bgfilename[30];
+               sprintf(bgfilename,"back%d.jpg",ui_pixbuf.randomback_choice-1);
+               if(!ExtractSingleFile(bgfilename)){g_print(_("Failed to extract file:%s.\n"),bgfilename);}
+               sprintf(bgfilename,"/tmp/llk_back%d.jpg",ui_pixbuf.randomback_choice-1);
+@@ -1640,6 +1641,12 @@
+   gchar path[MAX_PATH_LENGTH];
+   struct ScoreItem *score_list=NULL,*score_item_end=NULL,*score_item_tmp;
+   gint item_num=0;
++
++  GtkWidget *dialog,*tree_view,*button;
++  GtkCellRenderer *renderer;
++  GtkListStore  *store;
++  GtkTreeIter    iter;
++
+   /* load ini file,if it do not exist, make a new one */
+   user = getpwuid(getuid());
+   /*user home directory: user->pw_dir*/
+@@ -1676,6 +1683,7 @@
+   if(!view) /* If not just view the score,then this function must be called by ui_game_over,so add the current player's score
+                into the list,and then write to file if the list is modified,and at last,show the score list on a new window */
+   {
++    time_t t;
+     gint insert_pos=1;
+     for(score_item_tmp = score_list;score_item_tmp!=NULL;score_item_tmp=score_item_tmp->next)
+     {
+@@ -1748,7 +1756,6 @@
+              break;
+     }
+     sprintf(score_item_tmp->level,"%d",algorithm_game.level);
+-    time_t t;
+     time(&t);
+     sprintf(score_item_tmp->time,"%s",asctime(gmtime(&t)));
+     ui_input_string(score_item_tmp->name,score_item_tmp->nick,50);
+@@ -1775,10 +1782,6 @@
+     }
+   }
+   /* Create a new window to show scores. */
+-  GtkWidget *dialog,*tree_view,*button;
+-  GtkCellRenderer *renderer;
+-  GtkListStore  *store;
+-  GtkTreeIter    iter;
+   dialog = gtk_dialog_new();
+   gtk_window_set_title(GTK_WINDOW(dialog),_("Top 10 Heros"));
+   gtk_container_border_width(GTK_CONTAINER(dialog),5);
Index: files/patch-src_pak_pak.c
===================================================================
RCS file: /home/ncvs/ports/games/lianliankan/files/patch-src_pak_pak.c,v
retrieving revision 1.1
diff -u -r1.1 patch-src_pak_pak.c
--- files/patch-src_pak_pak.c	29 Apr 2006 13:18:41 -0000	1.1
+++ files/patch-src_pak_pak.c	25 May 2006 01:25:44 -0000
@@ -1,5 +1,5 @@
---- src/pak/pak.c.orig	Mon Apr  3 21:41:15 2006
-+++ src/pak/pak.c	Mon Apr  3 21:45:37 2006
+--- src/pak/pak.c.orig	Sun Oct 23 04:36:59 2005
++++ src/pak/pak.c	Thu May 25 00:54:16 2006
 @@ -249,11 +249,7 @@
  
      /* Set the position in the PAK file for this file to be written at */
@@ -26,7 +26,25 @@
      fsetpos( ReadStream, &Pos );
  
      /* Loop through the file by it's size and read from the PAK
-@@ -488,11 +480,7 @@
+@@ -453,6 +445,9 @@
+   fpos_t Pos;       /* Offset in to file */
+   guchar  Buffer = 0;    /* A read buffer */
+   guint32 Count;
++
++  gchar tmpstr[40];
++
+   /* Declare a temporary file table node to work from */
+   struct sFileTableEntry* Current;
+ 
+@@ -476,7 +471,6 @@
+   if( !ReadStream )
+     return FALSE;
+   /* Attempt to open the write stream for creating the file */
+-  gchar tmpstr[40];
+   sprintf(tmpstr,"/tmp/llk_%s",Current->szFileName);
+   WriteStream = fopen( tmpstr, "wb" );
+   if( !WriteStream )
+@@ -488,11 +482,7 @@
    /* Set the offset in PAK to the beginning of this particular file
       to be extracted */
  	/* If not GNU system,this should be Pos = Current->dwOffset */
--- lianliankan.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?1148520607.3531>