aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorpawel <pawel@FreeBSD.org>2013-12-21 01:03:44 +0800
committerpawel <pawel@FreeBSD.org>2013-12-21 01:03:44 +0800
commit9c0434a54f0fe309b6b1f7f1bc8e29f4b74156d1 (patch)
tree73e38f63998914757dc58b752452ee26b56621ea /games
parent4f8b1731a291cf7a5276d5328c0c7078d1068c04 (diff)
downloadfreebsd-ports-gnome-9c0434a54f0fe309b6b1f7f1bc8e29f4b74156d1.tar.gz
freebsd-ports-gnome-9c0434a54f0fe309b6b1f7f1bc8e29f4b74156d1.tar.zst
freebsd-ports-gnome-9c0434a54f0fe309b6b1f7f1bc8e29f4b74156d1.zip
- Fix build with clang
- Add desktop entry file - Support staging PR: ports/184867 Submitted by: KATO Tsuguru <tkato432@yahoo.com>
Diffstat (limited to 'games')
-rw-r--r--games/xdigger/Makefile22
-rw-r--r--games/xdigger/files/patch-ad8
-rw-r--r--games/xdigger/files/patch-runleves.c201
-rw-r--r--games/xdigger/pkg-plist27
4 files changed, 233 insertions, 25 deletions
diff --git a/games/xdigger/Makefile b/games/xdigger/Makefile
index 0f6ca5e068a7..96111fde29bd 100644
--- a/games/xdigger/Makefile
+++ b/games/xdigger/Makefile
@@ -3,10 +3,9 @@
PORTNAME= xdigger
PORTVERSION= 1.0.10
-PORTREVISION= 2
+PORTREVISION= 3
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,16 @@ COMMENT= Boulderdash-like KC85 Digger for X Window System
USES= imake
USE_XORG= x11 xext
-MAN6= xdigger.6
-NO_STAGE= yes
-.include <bsd.port.options.mk>
+DESKTOP_ENTRIES="XDigger" "" "" "${PORTNAME}" "" ""
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 --git a/games/xdigger/files/patch-ad b/games/xdigger/files/patch-ad
index 02b3e2bc2d95..d50bef608ae3 100644
--- a/games/xdigger/files/patch-ad
+++ b/games/xdigger/files/patch-ad
@@ -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 --git a/games/xdigger/files/patch-runleves.c b/games/xdigger/files/patch-runleves.c
new file mode 100644
index 000000000000..8c2e06c95499
--- /dev/null
+++ b/games/xdigger/files/patch-runleves.c
@@ -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 --git a/games/xdigger/pkg-plist b/games/xdigger/pkg-plist
index 7afd8d4c4d90..835b65a6b3f7 100644
--- a/games/xdigger/pkg-plist
+++ b/games/xdigger/pkg-plist
@@ -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%%