diff --git a/games/toppler/Makefile b/games/toppler/Makefile index 2375f5d5d34c..c2c4aba19e74 100644 --- a/games/toppler/Makefile +++ b/games/toppler/Makefile @@ -1,33 +1,53 @@ # Created by: Dom Mitchell 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 diff --git a/games/toppler/distinfo b/games/toppler/distinfo index cebda3038a0f..dce5390757ed 100644 --- a/games/toppler/distinfo +++ b/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 diff --git a/games/toppler/files/patch-Makefile b/games/toppler/files/patch-Makefile new file mode 100644 index 000000000000..3b33e7dfd760 --- /dev/null +++ b/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 $@ $< + diff --git a/games/toppler/files/patch-Makefile.in b/games/toppler/files/patch-Makefile.in deleted file mode 100644 index 483a2cc60b63..000000000000 --- a/games/toppler/files/patch-Makefile.in +++ /dev/null @@ -1,26 +0,0 @@ ---- Makefile.in.orig 2011-03-06 20:00:43 UTC -+++ Makefile.in -@@ -359,7 +359,7 @@ - dist_pixmaps_DATA = $(PACKAGE).xpm - applications_DATA = $(PACKAGE).desktop - dist_man_MANS = toppler.6 --dist_pkgdoc_DATA = AUTHORS COPYING ChangeLog NEWS README -+dist_pkgdoc_DATA = AUTHORS ChangeLog README - dist_pkgdata_DATA = \ - toppler.dat toppler.ogg \ - m1.ttm m2.ttm ball1.ttm ball2.ttm ball3.ttm abc.ttm pasi2.ttm david1.ttm -@@ -1086,14 +1086,12 @@ - install-dist_pkgdataDATA install-dist_pkgdocDATA \ - install-dist_pkglocalstateDATA install-man - @$(NORMAL_INSTALL) -- $(MAKE) $(AM_MAKEFLAGS) install-data-hook - install-dvi: install-dvi-recursive - - install-dvi-am: - - install-exec-am: install-binPROGRAMS - @$(NORMAL_INSTALL) -- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook - install-html: install-html-recursive - - install-html-am: diff --git a/games/toppler/files/patch-dist_toppler.desktop.in b/games/toppler/files/patch-dist_toppler.desktop.in new file mode 100644 index 000000000000..ff9eebcec29e --- /dev/null +++ b/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 diff --git a/games/toppler/files/patch-highscore.cc b/games/toppler/files/patch-highscore.cc deleted file mode 100644 index e926fce62381..000000000000 --- a/games/toppler/files/patch-highscore.cc +++ /dev/null @@ -1,10 +0,0 @@ ---- highscore.cc.orig 2009-10-11 08:46:06.000000000 +0900 -+++ highscore.cc 2009-11-16 01:09:40.000000000 +0900 -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - - #ifdef __QNXNTO__ diff --git a/games/toppler/files/patch-main.cc b/games/toppler/files/patch-main.cc deleted file mode 100644 index fcf7d9921954..000000000000 --- a/games/toppler/files/patch-main.cc +++ /dev/null @@ -1,12 +0,0 @@ ---- main.cc.orig 2012-12-22 11:02:06 UTC -+++ main.cc -@@ -96,7 +96,8 @@ int main(int argc, char *argv[]) { - - DIR *dir = opendir("locale"); - bindtextdomain("toppler", dir == NULL ? LOCALEDIR : "locale"); -- closedir(dir); -+ if (dir) -+ closedir(dir); - textdomain("toppler"); - #endif - diff --git a/games/toppler/files/patch-src_decl.cc b/games/toppler/files/patch-src_decl.cc new file mode 100644 index 000000000000..cb8fa8694596 --- /dev/null +++ b/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 + + } diff --git a/games/toppler/files/patch-src_highscore.cc b/games/toppler/files/patch-src_highscore.cc new file mode 100644 index 000000000000..bc1055a1c9d0 --- /dev/null +++ b/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 + #include ++#include + + #ifndef _WIN32 + #include +@@ -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 diff --git a/games/toppler/files/patch-src_main.cc b/games/toppler/files/patch-src_main.cc new file mode 100644 index 000000000000..774fcaa28c0c --- /dev/null +++ b/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 + #endif + ++#include ++ + 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()); + } diff --git a/games/toppler/pkg-descr b/games/toppler/pkg-descr index b2d1ff2d9008..4e20a27a3eb9 100644 --- a/games/toppler/pkg-descr +++ b/games/toppler/pkg-descr @@ -1,15 +1,15 @@ The target of the game is to reach the target door of each of the 8 towers in currently 2 missions with this little green animal. This door is usually at the very top of the tower. But finding the way by using elevators and walking trough a maze of doors and platforms is not the only problem you have to solve. There is a bunch of other creatures living on the tower that will hinder you to reach your target by pushing you over the edge of the platforms. 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/ diff --git a/games/toppler/pkg-plist b/games/toppler/pkg-plist index 76ed8264859d..ddcadec6f1f7 100644 --- a/games/toppler/pkg-plist +++ b/games/toppler/pkg-plist @@ -1,14 +1,14 @@ @(,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 %%NLS%%share/locale/fi/LC_MESSAGES/toppler.mo %%NLS%%share/locale/fr/LC_MESSAGES/toppler.mo %%NLS%%share/locale/pt/LC_MESSAGES/toppler.mo %%NLS%%share/locale/ro/LC_MESSAGES/toppler.mo %%NLS%%share/locale/sv/LC_MESSAGES/toppler.mo share/pixmaps/toppler.xpm @sample(,games,664) /var/games/toppler/toppler.hsc.sample @dir(,games,775) /var/games/toppler