Skip to content

Commit

Permalink
games/toppler: update 1.1.6 → 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Mar 4, 2022
1 parent ff5d56b commit 2df6f2a
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 63 deletions.
40 changes: 30 additions & 10 deletions games/toppler/Makefile
@@ -1,33 +1,53 @@
# Created by: Dom Mitchell <dom@happygiraffe.net>

PORTNAME= toppler
PORTVERSION= 1.1.6
PORTVERSION= 1.3
CATEGORIES= games
MASTER_SITES= SF

MAINTAINER= amdmi3@FreeBSD.org
COMMENT= Climb a tower and avoid monsters

LICENSE= GPLv2+
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING

USES= gmake localbase sdl
USE_SDL= mixer sdl
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --localstatedir=/var/games
LIB_DEPENDS= libpng.so:graphics/png
BUILD_DEPENDS= gimp:graphics/gimp-app \
povray:graphics/povray-meta \
convert:graphics/ImageMagick7

SCOREFILE= /var/games/toppler/toppler.hsc
USES= gmake sdl pkgconfig
USE_GITLAB= yes
GL_ACCOUNT= roever
GL_COMMIT= 5e3e581bb7b58098f54df9b634c7bd4a23ba66b5
USE_SDL= sdl2 image2 mixer2

PORTDOCS= *
PORTDATA= *

OPTIONS_DEFINE= DOCS NLS
OPTIONS_SUB= yes

NLS_CONFIGURE_ENABLE= nls
NLS_LIBS= -L${LOCALBASE}/lib -lintl
NLS_USES= gettext
NLS_USES_OFF= gettext-tools

post-extract:
@${MV} ${WRKSRC}/src/version ${WRKSRC}

post-patch-NLS-off:
@${REINPLACE_CMD} -e 's|ENABLE_NLS=1|ENABLE_NLS=0|' ${WRKSRC}/Makefile

post-install:
@${MV} ${STAGEDIR}${SCOREFILE} ${STAGEDIR}${SCOREFILE}.sample
@${MKDIR} ${STAGEDIR}/var/games/toppler
@${TOUCH} ${STAGEDIR}/var/games/toppler/toppler.hsc.sample
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/toppler
${INSTALL_DATA} ${WRKSRC}/dist/toppler.xpm ${STAGEDIR}${PREFIX}/share/pixmaps
@${SED} -e 's|@prefix@|${PREFIX}|' \
< ${WRKSRC}/dist/toppler.desktop.in \
> ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}.desktop

post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/AUTHORS ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}/

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions games/toppler/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1485788372
SHA256 (toppler-1.1.6.tar.gz) = 7dbc2905389c2adba0f8c459f3319cf04045ba53ed407e273a50a3a67564cc45
SIZE (toppler-1.1.6.tar.gz) = 2117137
TIMESTAMP = 1644266275
SHA256 (roever-toppler-5e3e581bb7b58098f54df9b634c7bd4a23ba66b5_GL0.tar.gz) = 1e42d91af1f7a47b92532bc02da7d768dfcfe8cefa699ba4827356f198752c14
SIZE (roever-toppler-5e3e581bb7b58098f54df9b634c7bd4a23ba66b5_GL0.tar.gz) = 3600621
55 changes: 55 additions & 0 deletions games/toppler/files/patch-Makefile
@@ -0,0 +1,55 @@
--- Makefile.orig 2022-02-06 08:35:59 UTC
+++ Makefile
@@ -18,10 +18,10 @@
# along with this program; if not, write to the Free Software
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA

-PREFIX = /usr
+PREFIX ?= /usr
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
-STATEDIR = /var/toppler
+STATEDIR = /var/games/toppler
LOCALEDIR = $(DATADIR)/locale
MANDIR = $(DATADIR)/man
PKGDATADIR = $(DATADIR)/toppler
@@ -29,9 +29,9 @@ DESTDIR =
CROSS =

CONVERT = convert
-CXX = $(CROSS)$(CXX_NATIVE)
-CXX_NATIVE = g++
-CXXFLAGS = -Wall -Wextra -g -O2 -std=c++17
+CXX_NATIVE = $(CXX)
+CXXFLAGS ?= -g -O2
+CXXFLAGS += -Wall -Wextra -std=c++17
EXEEXT = $(if $(filter %-w64-mingw32.static-,$(CROSS)),.exe,)
INSTALL = install
LDFLAGS =
@@ -50,7 +50,7 @@ MSGID_BUGS_ADDRESS := roever@users.sf.net
.PHONY: default
default: all

-VERSION := $(shell cat src/version)
+VERSION := $(shell cat version)
ALL_SOURCES := $(wildcard src/*)

PKGS += SDL2_mixer
@@ -63,7 +63,7 @@ PKGS_NATIVE += libpng
PKGS_NATIVE += SDL2_image

PKG_CFLAGS_NATIVE = $$($(PKG_CONFIG_NATIVE) --cflags $(PKGS_NATIVE))
-PKG_LIBS_NATIVE = $$($(PKG_CONFIG_NATIVE) --libs $(PKGS_NATIVE))
+PKG_LIBS_NATIVE = $$($(PKG_CONFIG_NATIVE) --libs $(PKGS_NATIVE)) -lintl

DEFS += -DVERSION='"$(VERSION)"'
DEFS += -DTOP_DATADIR='"$(PKGDATADIR)"'
@@ -75,7 +75,7 @@ FILES_H := $(wildcard src/*.h)
FILES_CPP := $(wildcard src/*.cc)
FILES_O := $(patsubst src/%,_build/$(CROSS)/%.o,$(FILES_CPP))
.SECONDARY: $(FILES_O)
-_build/$(CROSS)/%.o: src/% src/version $(FILES_H)
+_build/$(CROSS)/%.o: src/% version $(FILES_H)
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $$($(PKG_CONFIG) --cflags $(PKGS)) $(DEFS) -c -o $@ $<

26 changes: 0 additions & 26 deletions games/toppler/files/patch-Makefile.in

This file was deleted.

16 changes: 16 additions & 0 deletions games/toppler/files/patch-dist_toppler.desktop.in
@@ -0,0 +1,16 @@
--- dist/toppler.desktop.in.orig 2022-02-06 08:35:59 UTC
+++ dist/toppler.desktop.in
@@ -2,11 +2,11 @@
Encoding=UTF-8
Categories=Application;Game;ArcadeGame;
X-Desktop-File-Install-Version=0.2
-Name=@FULLNAME@
+Name=Tower Toppler
Comment=A clone of the 'Nebulus' game on old 8 and 16 bit machines.
Comment[de]=Klon des alten Spiels 'Nebulus'
Comment[cs]=Klon hry 'Nebulus' z dob 8 a 16 bitovÜch počítačů.
-Icon=@prefix@/pixmaps/@PACKAGE@.xpm
+Icon=@prefix@/share/pixmaps/toppler.xpm
Exec=@prefix@/bin/toppler
Terminal=0
Type=Application
10 changes: 0 additions & 10 deletions games/toppler/files/patch-highscore.cc

This file was deleted.

12 changes: 0 additions & 12 deletions games/toppler/files/patch-main.cc

This file was deleted.

14 changes: 14 additions & 0 deletions games/toppler/files/patch-src_decl.cc
@@ -0,0 +1,14 @@
--- src/decl.cc.orig 2022-02-06 08:35:59 UTC
+++ src/decl.cc
@@ -119,9 +119,9 @@ static void checkdir(void) {

if (!d) {
mkdir(n.c_str(), S_IRWXU);
+ } else {
+ closedir(d);
}
-
- closedir(d);
#endif

}
25 changes: 25 additions & 0 deletions games/toppler/files/patch-src_highscore.cc
@@ -0,0 +1,25 @@
--- src/highscore.cc.orig 2022-02-06 08:35:59 UTC
+++ src/highscore.cc
@@ -22,6 +22,7 @@

#include <cstdio>
#include <unistd.h>
+#include <sys/stat.h>

#ifndef _WIN32
#include <fcntl.h>
@@ -221,12 +222,12 @@ void hsc_init(void) {
}
else
{
- debugprintf(2, "could not open create the lock file, no write access to global hiscore directory\n", fname);
+ debugprintf(2, "could not open create the lock file, no write access to global hiscore directory\n", fname.c_str());
}
}
else
{
- debugprintf(2, "could not open global highscore file %s\n", fname);
+ debugprintf(2, "could not open global highscore file %s\n", fname.c_str());
}

#else
11 changes: 11 additions & 0 deletions games/toppler/files/patch-src_main.cc
@@ -0,0 +1,11 @@
--- src/main.cc.orig 2022-02-06 08:35:59 UTC
+++ src/main.cc
@@ -33,6 +33,8 @@
#include <dirent.h>
#endif

+#include <time.h>
+
static void printhelp(void) {
printf(_("\n\tOptions:\n\n -f\tEnable fullscreen mode\n -s\tSilence, disable all sound\n -dX\tSet debug level to X (default: %i)\n").c_str(), config.debug_level());
}
2 changes: 1 addition & 1 deletion games/toppler/pkg-descr
Expand Up @@ -12,4 +12,4 @@ The only weapon of defence you have is to throw a little snowball. But
most of the other creatures just don't care about this. So you must
avoid them.

WWW: http://toppler.sourceforge.net/
WWW: https://gitlab.com/roever/toppler/
2 changes: 1 addition & 1 deletion games/toppler/pkg-plist
@@ -1,6 +1,6 @@
@(,games,2555) bin/toppler
man/man6/toppler.6.gz
share/applications/toppler.desktop
share/man/man6/toppler.6.gz
%%NLS%%share/locale/cs/LC_MESSAGES/toppler.mo
%%NLS%%share/locale/de/LC_MESSAGES/toppler.mo
%%NLS%%share/locale/eu/LC_MESSAGES/toppler.mo
Expand Down

0 comments on commit 2df6f2a

Please sign in to comment.