Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Dec 2013 02:48:56 +0900
From:      KATO Tsuguru <tkato432@yahoo.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/184867: games/xdigger: Fix build with clang
Message-ID:  <20131217024856.2eff951786b2b4c49e6bb008@yahoo.com>
Resent-Message-ID: <201312161810.rBGIAISR016345@freefall.freebsd.org>

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

>Number:         184867
>Category:       ports
>Synopsis:       games/xdigger: Fix build with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 16 18:10:18 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        FreeBSD 8.4-RELEASE-p4 i386
>Organization:
>Environment:
>Description:
- Fix build with clang
- Add DESKTOP_ENTRIES

New file:
files/patch-runleves.c

>How-To-Repeat:
>Fix:

diff -urN /usr/ports/games/xdigger/Makefile games/xdigger/Makefile
--- /usr/ports/games/xdigger/Makefile	2013-11-06 22:01:10.000000000 +0900
+++ games/xdigger/Makefile	2013-12-17 00:00:00.000000000 +0900
@@ -5,8 +5,7 @@
 PORTVERSION=	1.0.10
 PORTREVISION=	2
 CATEGORIES=	games
-MASTER_SITES=	${MASTER_SITE_SUNSITE}
-MASTER_SITE_SUBDIR=	games/arcade
+MASTER_SITES=	SUNSITE/games/arcade
 EXTRACT_SUFX=	.tgz
 
 MAINTAINER=	ports@FreeBSD.org
@@ -14,23 +13,18 @@
 
 USES=		imake
 USE_XORG=	x11 xext
-MAN6=		xdigger.6
 
-NO_STAGE=	yes
+DESKTOP_ENTRIES="XDigger" "" "" "${PORTNAME}" "" ""
+
 .include <bsd.port.options.mk>
 
 post-patch:
 	@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/configure.h
 
 post-install:
-	@${CHMOD} 2755 ${PREFIX}/bin/xdigger
-	@${CHOWN} root:games ${PREFIX}/bin/xdigger
-	@${CHMOD} 664 ${PREFIX}/share/xdigger/xdigger.hiscore
-	@${CHOWN} root:games ${PREFIX}/share/xdigger/xdigger.hiscore
-.if ${PORT_OPTIONS:MDOCS}
-	@${MKDIR} ${DOCSDIR}
-	@${INSTALL_DATA} ${WRKSRC}/ChangeLog ${DOCSDIR}
-	@${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
-.endif
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+.for i in ChangeLog README
+	(cd ${WRKSRC} && ${INSTALL_DATA} ${i} ${STAGEDIR}${DOCSDIR})
+.endfor
 
 .include <bsd.port.mk>
diff -urN /usr/ports/games/xdigger/files/patch-ad games/xdigger/files/patch-ad
--- /usr/ports/games/xdigger/files/patch-ad	2013-11-06 22:01:10.000000000 +0900
+++ games/xdigger/files/patch-ad	2013-12-17 00:00:00.000000000 +0900
@@ -16,7 +16,7 @@
  
  #ifdef SOUND_RPLAY
  RPLAYLIB = -lrplay
-@@ -23,12 +23,10 @@
+@@ -23,15 +23,13 @@
  
  ComplexProgramTarget(xdigger)
  InstallNonExecFile(xdigger.level,XDIGGER_LIB_DIR)
@@ -30,3 +30,9 @@
  /* InstallNonExecFileNoClobber(xdigger.hiscore,XDIGGER_HISCORE_DIR) */
  
  install::
+-	$(MKDIRHIER) XDIGGER_HISCORE_DIR
+-	touch XDIGGER_HISCORE_DIR/xdigger.hiscore
+-	chmod a+w XDIGGER_HISCORE_DIR/xdigger.hiscore
++	$(MKDIRHIER) $(DESTDIR)XDIGGER_HISCORE_DIR
++	touch $(DESTDIR)XDIGGER_HISCORE_DIR/xdigger.hiscore
++	chmod a+w $(DESTDIR)XDIGGER_HISCORE_DIR/xdigger.hiscore
diff -urN /usr/ports/games/xdigger/files/patch-runleves.c games/xdigger/files/patch-runleves.c
--- /usr/ports/games/xdigger/files/patch-runleves.c	1970-01-01 09:00:00.000000000 +0900
+++ games/xdigger/files/patch-runleves.c	2013-12-17 00:00:00.000000000 +0900
@@ -0,0 +1,201 @@
+--- runlevels.c.orig
++++ runlevels.c
+@@ -672,6 +672,20 @@
+     }
+ } /* DiggerHalfStep() */
+ 
++typedef struct
++{
++  unsigned char x, y, id, type;
++} TMerk;
++  
++void Merke(unsigned char type, int x, int y, int *merkidx, TMerk *merk)
++{
++  merk[*merkidx].x = x;
++  merk[*merkidx].y = y;
++  merk[*merkidx].id = field[x][y].id & 7;
++  merk[*merkidx].type = type;
++  *merkidx++;   
++}  
++
+ void StoneDiamondStep()
+ {
+ 
+@@ -680,24 +694,10 @@
+ #define SF_LEFTDOWN  2
+ #define SF_CHANGER   3
+   
+-  typedef struct
+-  {
+-    unsigned char x, y, id, type;
+-  } TMerk;
+-  
+   TMerk merk[140], ghosts_todie[17];
+   int i, x, y, dx, dy, merkidx, ghosts_todie_idx;
+   Bool digger_todie = False;  
+-  
+-  void Merke(unsigned char type)
+-    {
+-      merk[merkidx].x = x;
+-      merk[merkidx].y = y;
+-      merk[merkidx].id = field[x][y].id & 7;
+-      merk[merkidx].type = type;
+-      merkidx++;   
+-    }  
+-  
++
+   /* Schritt 1  (nur markieren) : */
+   merkidx = 0; ghosts_todie_idx = 0;
+   
+@@ -708,19 +708,19 @@
+         (field[x][y].id == ID_IVDIAMOND))
+     {
+       if (field[x][y+1].id == ID_NOTHING)
+-        Merke(SF_DOWN);
++        Merke(SF_DOWN, x, y, &merkidx, merk);
+       else
+         if ((field[x][y+1].id == ID_STONE) ||
+             (field[x][y+1].id == ID_DIAMOND))
+         {
+           if ((field[x-1][y].id == ID_NOTHING) &&
+               (field[x-1][y+1].id == ID_NOTHING))
+-            Merke(SF_LEFTDOWN);
++            Merke(SF_LEFTDOWN, x, y, &merkidx, merk);
+           else
+             if ((field[x+1][y].id == ID_NOTHING) &&
+                 (field[x+1][y+1].id == ID_NOTHING))
+             {          
+-              Merke(SF_RIGHTDOWN);
++              Merke(SF_RIGHTDOWN, x, y, &merkidx, &merk);
+               field[x+1][y+1].id = ID_FSTODMD;
+             }        
+         }
+@@ -729,7 +729,7 @@
+                (field[x][y].id == ID_IVSTONE)) &&
+               (field[x][y+1].id == ID_CHANGER) &&
+               (field[x][y+2].id == ID_NOTHING))
+-            Merke(SF_CHANGER);
++            Merke(SF_CHANGER, x, y, &merkidx, &merk);
+     }
+   merk[merkidx].x = 0;
+   merk[merkidx].y = 0;
+@@ -1573,6 +1573,50 @@
+ 
+ /*---------------------------------------------------------------------------*/
+ 
++void Save_Ghost(int flags, int *id, int *d, unsigned char *file_daten)
++{
++  switch (flags & F_GHOST_TYPEMASK)
++  {
++  case F_GHOST_TYPE180:
++    *id = 3;
++    break;
++  case F_GHOST_TYPEL:
++    *id = 7;
++    break;
++  case F_GHOST_TYPER:
++    *id = 15;
++    break;
++  case F_GHOST_TYPELR:
++    *id = 11;
++    break;
++  }
++  switch (flags & F_GHOST_MOVEMASK)
++  {
++  case F_GHOST_DOWN:
++    *d = 0;
++    break;
++  case F_GHOST_UP:
++    *d = 1;
++    break;
++  case F_GHOST_RIGHT:
++    *d = 2;
++    break;
++  case F_GHOST_LEFT:
++    *d = 3;
++    break;
++  }
++  if (number_ghosts < MAX_GHOSTS)
++  {
++    if (number_ghosts & 1)
++      file_daten[0x94 + number_ghosts/2] =
++        (file_daten[0x94 + number_ghosts/2] & 0xf0) | (*d);
++    else
++      file_daten[0x94 + number_ghosts/2] =
++        (file_daten[0x94 + number_ghosts/2] & 0x0f) | (*d << 4);
++    number_ghosts++;
++  }
++}
++
+ void Edit_SaveLevel(int level_number)
+ {
+ /*   char filename[256]; */
+@@ -1580,50 +1624,6 @@
+   int x, y, id, flags, i, d;
+   FILE *filehandle;
+   
+-  void Save_Ghost()
+-  {
+-    switch (flags & F_GHOST_TYPEMASK)
+-    {
+-    case F_GHOST_TYPE180:
+-      id = 3;
+-      break;
+-    case F_GHOST_TYPEL:
+-      id = 7;
+-      break;
+-    case F_GHOST_TYPER:
+-      id = 15;
+-      break;
+-    case F_GHOST_TYPELR:
+-      id = 11;
+-      break;
+-    }
+-    switch (flags & F_GHOST_MOVEMASK)
+-    {
+-    case F_GHOST_DOWN:
+-      d = 0;
+-      break;
+-    case F_GHOST_UP:
+-      d = 1;
+-      break;
+-    case F_GHOST_RIGHT:
+-      d = 2;
+-      break;
+-    case F_GHOST_LEFT:
+-      d = 3;
+-      break;
+-    }
+-    if (number_ghosts < MAX_GHOSTS)
+-    {
+-      if (number_ghosts & 1)
+-        file_daten[0x94 + number_ghosts/2] =
+-          (file_daten[0x94 + number_ghosts/2] & 0xf0) | (d);
+-      else
+-        file_daten[0x94 + number_ghosts/2] =
+-          (file_daten[0x94 + number_ghosts/2] & 0x0f) | (d << 4);
+-      number_ghosts++;
+-    }
+-  }
+-  
+   bzero(file_daten, sizeof(file_daten));
+   number_ghosts = 0;
+   c = file_daten;
+@@ -1637,7 +1637,7 @@
+             diggerposy = y;
+         }
+         if (id == ID_GHOST)
+-          Save_Ghost();
++          Save_Ghost(flags, &id, &d, file_daten);
+         *c = (*c & 0x0f) | (id << 4);
+ 
+   /* ------------------------------------------------------------------ */
+@@ -1650,7 +1650,7 @@
+             diggerposy = y;
+         }
+         if (id == ID_GHOST)
+-          Save_Ghost();
++          Save_Ghost(flags, &id, &d, file_daten);
+         *c = (*c & 0xf0) | id;
+     }
+   c += 3; 
diff -urN /usr/ports/games/xdigger/pkg-plist games/xdigger/pkg-plist
--- /usr/ports/games/xdigger/pkg-plist	2013-11-06 22:01:10.000000000 +0900
+++ games/xdigger/pkg-plist	2013-12-17 00:00:00.000000000 +0900
@@ -1,10 +1,19 @@
+@mode 2755
+@group games
 bin/xdigger
-%%PORTDOCS%%share/doc/xdigger/ChangeLog
-%%PORTDOCS%%share/doc/xdigger/README
-share/xdigger/diamond.au
-share/xdigger/step.au
-share/xdigger/stone.au
-share/xdigger/xdigger.hiscore
-share/xdigger/xdigger.level
-%%PORTDOCS%%@dirrm share/doc/xdigger
-@dirrm share/xdigger
+@group
+@mode
+man/man6/xdigger.6.gz
+%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%DATADIR%%/diamond.au
+%%DATADIR%%/step.au
+%%DATADIR%%/stone.au
+@mode 644
+@group games
+%%DATADIR%%/xdigger.hiscore
+@group
+@mode
+%%DATADIR%%/xdigger.level
+@dirrm %%DATADIR%%
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
>Release-Note:
>Audit-Trail:
>Unformatted:



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