git: e15b84c4c45b - main - games/powder-toy: add -devel counterpart, pet portlint

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Tue, 31 Jan 2023 16:13:21 UTC
The branch main has been updated by amdmi3:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e15b84c4c45b93eb24f6df7a42338528466b7b09

commit e15b84c4c45b93eb24f6df7a42338528466b7b09
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2023-01-30 17:13:16 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2023-01-31 16:12:51 +0000

    games/powder-toy: add -devel counterpart, pet portlint
---
 games/Makefile                                     |  1 +
 games/powder-toy-devel/Makefile                    | 64 ++++++++++++++++++++++
 games/powder-toy-devel/distinfo                    |  3 +
 .../files/patch-resources_meson.build              | 11 ++++
 .../files/patch-resources_powder.template.desktop  |  8 +++
 games/powder-toy-devel/pkg-descr                   | 15 +++++
 games/powder-toy-devel/pkg-plist                   |  8 +++
 games/powder-toy/Makefile                          |  7 ++-
 8 files changed, 114 insertions(+), 3 deletions(-)

diff --git a/games/Makefile b/games/Makefile
index 905ea1bcf05d..6e99c9612207 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -782,6 +782,7 @@
     SUBDIR += popstar
     SUBDIR += powder
     SUBDIR += powder-toy
+    SUBDIR += powder-toy-devel
     SUBDIR += powermanga
     SUBDIR += powwow
     SUBDIR += prboom
diff --git a/games/powder-toy-devel/Makefile b/games/powder-toy-devel/Makefile
new file mode 100644
index 000000000000..8729086021b6
--- /dev/null
+++ b/games/powder-toy-devel/Makefile
@@ -0,0 +1,64 @@
+PORTNAME=	powder-toy
+DISTVERSION=	snapshot-253
+CATEGORIES=	games
+PKGNAMESUFFIX=	-devel
+
+MAINTAINER=	amdmi3@FreeBSD.org
+COMMENT=	'Falling sand' physics sandbox with air pressure and velocity support (snapshot version)
+WWW=		https://powdertoy.co.uk/ \
+		https://github.com/The-Powder-Toy/The-Powder-Toy
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+NOT_FOR_ARCHS=	i386
+
+LIB_DEPENDS=	libfftw3f.so:math/fftw3-float \
+		libfftw3.so:math/fftw3 \
+		libcurl.so:ftp/curl \
+		libpng.so:graphics/png \
+		libjsoncpp.so:devel/jsoncpp
+
+USES=		compiler:c++17-lang luajit:luajit-openresty meson pkgconfig \
+		python:build sdl
+USE_GITHUB=	yes
+GH_ACCOUNT=	The-Powder-Toy
+GH_PROJECT=	The-Powder-Toy
+USE_SDL=	sdl2
+MESON_ARGS=	-Dapp_exe="${PORTNAME}"
+
+CONFLICTS_INSTALL=powder-toy
+
+PORTDOCS=	README.md changelog.txt
+
+OPTIONS_DEFINE=		DOCS SSE
+OPTIONS_DEFAULT_amd64=	SSE
+
+SSE_DESC=		Enable SSE optimizations
+SSE_MESON_ON=		-Dx86_sse=auto
+SSE_MESON_OFF=		-Dx86_sse=none
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|python3|${PYTHON_CMD}|' ${WRKSRC}/meson.build
+
+do-install:
+	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/powder-toy ${STAGEDIR}${PREFIX}/bin/
+	${INSTALL_DATA} ${BUILD_WRKSRC}/resources/powder.desktop ${STAGEDIR}${PREFIX}/share/applications/uk.co.powdertoy.tpt.desktop  # as mentioned in appdata
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/appdata
+	${INSTALL_DATA} ${BUILD_WRKSRC}/resources/appdata.xml ${STAGEDIR}${PREFIX}/share/appdata/powder-toy.appdata.xml
+.for s in 16 24 32 48 256
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps
+.endfor
+	${INSTALL_DATA} ${WRKSRC}/resources/generated_icons/icon_exe_16.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/16x16/apps/powder-toy.png
+	${INSTALL_DATA} ${WRKSRC}/resources/generated_icons/icon_exe_32.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/24x24/apps/powder-toy.png # for e.g. lxpanel
+	${INSTALL_DATA} ${WRKSRC}/resources/generated_icons/icon_exe_32.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/32x32/apps/powder-toy.png
+	${INSTALL_DATA} ${WRKSRC}/resources/generated_icons/icon_exe_48.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/48x48/apps/powder-toy.png
+	${INSTALL_DATA} ${WRKSRC}/resources/generated_icons/icon_exe.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps/powder-toy.png
+
+do-install-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+.for f in ${PORTDOCS}
+	${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/
+.endfor
+
+.include <bsd.port.mk>
diff --git a/games/powder-toy-devel/distinfo b/games/powder-toy-devel/distinfo
new file mode 100644
index 000000000000..c8d4258aae03
--- /dev/null
+++ b/games/powder-toy-devel/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1675089470
+SHA256 (The-Powder-Toy-The-Powder-Toy-snapshot-253_GH0.tar.gz) = ece620808c3fffbe36cbfca6b48d18f366d51ef329a9d0d5355e142552a5a0a5
+SIZE (The-Powder-Toy-The-Powder-Toy-snapshot-253_GH0.tar.gz) = 733793
diff --git a/games/powder-toy-devel/files/patch-resources_meson.build b/games/powder-toy-devel/files/patch-resources_meson.build
new file mode 100644
index 000000000000..8d6c0d5d3829
--- /dev/null
+++ b/games/powder-toy-devel/files/patch-resources_meson.build
@@ -0,0 +1,11 @@
+--- resources/meson.build.orig	2023-01-04 02:02:45 UTC
++++ resources/meson.build
+@@ -68,7 +68,7 @@ elif host_platform == 'darwin'
+ 		output: 'Info.plist',
+ 		configuration: conf_data,
+ 	)
+-elif host_platform == 'linux'
++else
+ 	data_files += to_array.process(rendered_icons['icon_exe'], extra_args: 'icon_exe_png')
+ 	data_files += to_array.process(rendered_icons['icon_cps'], extra_args: 'icon_cps_png')
+ 	data_files += to_array.process('save.xml', extra_args: 'save_xml')
diff --git a/games/powder-toy-devel/files/patch-resources_powder.template.desktop b/games/powder-toy-devel/files/patch-resources_powder.template.desktop
new file mode 100644
index 000000000000..e60b76b7e182
--- /dev/null
+++ b/games/powder-toy-devel/files/patch-resources_powder.template.desktop
@@ -0,0 +1,8 @@
+--- resources/powder.template.desktop.orig	2023-01-04 02:02:45 UTC
++++ resources/powder.template.desktop
+@@ -5,4 +5,4 @@ Comment=@APPCOMMENT@
+ MimeType=application/vnd.powdertoy.save;x-scheme-handler/ptsave;
+ Categories=Game;Simulation;
+ Exec=@APPEXE@ %u
+-Icon=@APPVENDOR@-@APPEXE@
++Icon=@APPEXE@
diff --git a/games/powder-toy-devel/pkg-descr b/games/powder-toy-devel/pkg-descr
new file mode 100644
index 000000000000..3041f96be09e
--- /dev/null
+++ b/games/powder-toy-devel/pkg-descr
@@ -0,0 +1,15 @@
+Have you ever wanted to blow something up? Or maybe you always
+dreamt of operating an atomic power plant? Do you have a will to
+develop your own CPU? The Powder Toy lets you to do all of these,
+and even more!
+
+The Powder Toy is a free physics sandbox game, which simulates air
+pressure and velocity, heat, gravity and a countless number of
+interactions between different substances! The game provides you
+with various building materials, liquids, gases and electronic
+components which can be used to construct complex machines, guns,
+bombs, realistic terrains and almost anything else. You can then
+mine them and watch cool explosions, add intricate wirings, play
+with little stickmen or operate your machine. You can browse and
+play thousands of different saves made by the community or upload
+your own - we welcome your creations!
diff --git a/games/powder-toy-devel/pkg-plist b/games/powder-toy-devel/pkg-plist
new file mode 100644
index 000000000000..c44befb1ae41
--- /dev/null
+++ b/games/powder-toy-devel/pkg-plist
@@ -0,0 +1,8 @@
+bin/powder-toy
+share/appdata/powder-toy.appdata.xml
+share/applications/uk.co.powdertoy.tpt.desktop
+share/icons/hicolor/16x16/apps/powder-toy.png
+share/icons/hicolor/24x24/apps/powder-toy.png
+share/icons/hicolor/256x256/apps/powder-toy.png
+share/icons/hicolor/32x32/apps/powder-toy.png
+share/icons/hicolor/48x48/apps/powder-toy.png
diff --git a/games/powder-toy/Makefile b/games/powder-toy/Makefile
index 2bad8d6cf2ef..9b56dc04ff6d 100644
--- a/games/powder-toy/Makefile
+++ b/games/powder-toy/Makefile
@@ -18,15 +18,16 @@ LIB_DEPENDS=	libfftw3f.so:math/fftw3-float \
 		libpng.so:graphics/png \
 		libjsoncpp.so:devel/jsoncpp
 
+USES=		compiler:c++17-lang desktop-file-utils luajit:luajit-openresty \
+		meson pkgconfig python:build sdl
 USE_GITHUB=	yes
 GH_ACCOUNT=	The-Powder-Toy
 GH_PROJECT=	The-Powder-Toy
-
-USES=		compiler:c++17-lang luajit:luajit-openresty meson pkgconfig \
-		python:build sdl
 USE_SDL=	sdl2
 MESON_ARGS=	-Dapp_exe="${PORTNAME}"
 
+CONFLICTS_INSTALL=powder-toy-devel
+
 PORTDOCS=	README.md changelog.txt
 
 OPTIONS_DEFINE=		DOCS SSE