Tuesday, April 26, 2022

Re: games/godot: split the editor in a subpackage

Stuart Henderson <stu@spacehopper.org> wrote:
> On 2022/04/25 22:11, Omar Polo wrote:
> > PKGNAME = godot-${V}
> > -REVISION = 0
> > +REVISION-main = 1
>
> right
>
> > Index: pkg/DESCR-editor
> > ===================================================================
> > RCS file: pkg/DESCR-editor
> > diff -N pkg/DESCR-editor
> > --- /dev/null 1 Jan 1970 00:00:00 -0000
> > +++ pkg/DESCR-editor 19 Apr 2022 10:25:53 -0000
> > @@ -0,0 +1,3 @@
> > +Godot is an advanced, feature-packed, multi-platform 2D and 3D open source
> > +game engine. It provides a huge set of common tools, so you can just focus
> > +on making your game without reinventing the wheel.
> > Index: pkg/DESCR-main
> > ===================================================================
> > RCS file: pkg/DESCR-main
> > diff -N pkg/DESCR-main
> > --- /dev/null 1 Jan 1970 00:00:00 -0000
> > +++ pkg/DESCR-main 27 Apr 2018 07:32:53 -0000
> > @@ -0,0 +1,3 @@
> > +Godot is an advanced, feature-packed, multi-platform 2D and 3D open source
> > +game engine. It provides a huge set of common tools, so you can just focus
> > +on making your game without reinventing the wheel.
>
> The two DESCRs are the same; better to distinguish them

Agreed! (I thought I did that, but I just forgot)

> > RCS file: pkg/PLIST-editor
> > diff -N pkg/PLIST-editor
> > --- /dev/null 1 Jan 1970 00:00:00 -0000
> > +++ pkg/PLIST-editor 19 Apr 2022 10:22:56 -0000
> > @@ -0,0 +1,9 @@
>
> needs an @conflict on the old version

I haven't thought about this. I've added the @conflict and the
@pkgpath, thanks for reminding me

> > +@bin bin/godot-editor
> > +@man man/man6/godot.6
>
> manual should go in -main shouldn't it?

good catch! yes, the manpage should go in -main

> > +share/applications/org.godotengine.Godot.desktop
> > +share/doc/pkg-readmes/${PKGSTEM}
>
> should the readme also go in -main? how about the other files?

No, the README is only about the editor, same for the other files: only
a build with the editor is meant to be run from a graphical menu. If
you run godot compiled without tools (i.e. the -main package) without
--main-pack or not in a directory with a project.godot file it just pops
up an error window.

> > +share/metainfo/
> > +share/metainfo/org.godotengine.Godot.appdata.xml
> > +share/pixmaps/
> > +share/pixmaps/godot.svg
> > +@tag update-desktop-database
> > Index: pkg/PLIST-main
> > ===================================================================
> > RCS file: pkg/PLIST-main
> > diff -N pkg/PLIST-main
> > --- /dev/null 1 Jan 1970 00:00:00 -0000
> > +++ pkg/PLIST-main 19 Apr 2022 10:22:55 -0000
> > @@ -0,0 +1 @@
> > +@bin bin/godot
>
> needs @pkgpath games/godot

added, thanks!

Here's an updated diff.

I've also renamed the -editor subpackage to -tools: i still think that
-editor sounds better, but -tools follows the upstream documentation,
and freebsd has a similar package (devel/godot-tools).

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/games/godot/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- Makefile 15 Apr 2022 20:23:19 -0000 1.34
+++ Makefile 26 Apr 2022 14:22:35 -0000
@@ -1,25 +1,33 @@
BROKEN-powerpc = fails at runtime, the UI is totally blank

-COMMENT = 2D and 3D game engine
+COMMENT-main = 2D and 3D game engine
+COMMENT-tools= 2D and 3D game engine (with tools)

V = 3.4.4
GODOTSTEAM_V = g34-s152-gs311
DISTNAME = godot-${V}-stable
PKGNAME = godot-${V}
-REVISION = 0
+REVISION-main = 1
+
CATEGORIES = games
+
HOMEPAGE = https://godotengine.org/
+
MAINTAINER = Omar Polo <op@omarpolo.com>

# MIT
PERMIT_PACKAGE = Yes

+MULTI_PACKAGES = -main -tools
+
WANTLIB += ${COMPILER_LIBCXX} BulletCollision BulletDynamics BulletSoftBody
WANTLIB += LinearMath GL X11 Xau Xcursor Xdmcp Xext Xfixes Xi Xinerama Xrandr
WANTLIB += Xrender c enet execinfo freetype intl m mbedtls mbedcrypto
WANTLIB += mbedx509 mpcdec ogg opus opusfile png sndio steam_api theora
WANTLIB += theoradec usbhid vorbis vorbisfile webp xcb z pcre2-32 vpx zstd

+WANTLIB-tools = ${WANTLIB}
+
# C++14
COMPILER = base-clang ports-gcc

@@ -58,7 +66,6 @@ MODSCONS_FLAGS = CC="${CC}" \
custom_modules=${WRKDIR}/GodotSteam-${GODOTSTEAM_V}/godotsteam \
progress=no \
pulseaudio=no \
- target=release_debug \
verbose=yes \
warnings=extra \
werror=no
@@ -83,7 +90,8 @@ LIB_DEPENDS = archivers/zstd \
multimedia/libvpx \
net/enet \
security/polarssl
-RUN_DEPENDS = devel/desktop-file-utils
+
+RUN_DEPENDS-tools = devel/desktop-file-utils

DEBUG_PACKAGES = ${BUILD_PACKAGES}
NO_TEST = Yes
@@ -103,15 +111,21 @@ post-extract:
${WRKDIST}/platform/x11/

pre-configure:
- ${SUBST_CMD} ${WRKSRC}/drivers/unix/os_unix.cpp
+ ${SUBST_CMD} ${WRKSRC}/misc/dist/linux/*.desktop
sed -E -i 's/ISteamHTMLSurface:://g' \
${WRKDIR}/GodotSteam-${GODOTSTEAM_V}/godotsteam/godotsteam.cpp
sed -E -i 's/Connection_DEPRECATED/Connection/g' \
${WRKDIR}/GodotSteam-${GODOTSTEAM_V}/godotsteam/godotsteam.cpp

+do-build:
+ @${MODSCONS_BUILD_TARGET} tools=no target=release
+ @${MODSCONS_BUILD_TARGET} tools=yes target=release_debug
+
do-install:
- ${INSTALL_PROGRAM} ${WRKBUILD}/bin/godot* \
+ ${INSTALL_PROGRAM} ${WRKBUILD}/bin/godot.x11.opt.[36]* \
${PREFIX}/bin/godot
+ ${INSTALL_PROGRAM} ${WRKBUILD}/bin/godot.x11.opt.tools.* \
+ ${PREFIX}/bin/godot-tools
${INSTALL_MAN_DIR} ${PREFIX}/man/man6
${INSTALL_MAN} ${WRKSRC}/misc/dist/linux/godot.6 \
${PREFIX}/man/man6
Index: patches/patch-drivers_unix_os_unix_cpp
===================================================================
RCS file: /home/cvs/ports/games/godot/patches/patch-drivers_unix_os_unix_cpp,v
retrieving revision 1.8
diff -u -p -r1.8 patch-drivers_unix_os_unix_cpp
--- patches/patch-drivers_unix_os_unix_cpp 11 Mar 2022 19:04:30 -0000 1.8
+++ patches/patch-drivers_unix_os_unix_cpp 25 Apr 2022 17:51:42 -0000
@@ -1,14 +1,16 @@
-hardcode executable path
-
Index: drivers/unix/os_unix.cpp
--- drivers/unix/os_unix.cpp.orig
+++ drivers/unix/os_unix.cpp
-@@ -485,7 +485,7 @@ String OS_Unix::get_executable_path() const {
+@@ -483,11 +483,7 @@ String OS_Unix::get_executable_path() const {
+ }
+ return b;
#elif defined(__OpenBSD__) || defined(__NetBSD__)
- char resolved_path[MAXPATHLEN];
-
+- char resolved_path[MAXPATHLEN];
+-
- realpath(OS::get_executable_path().utf8().get_data(), resolved_path);
-+ realpath("${PREFIX}/bin/godot", resolved_path);
-
- return String(resolved_path);
+-
+- return String(resolved_path);
++ return OS::get_executable_path();
#elif defined(__FreeBSD__)
+ int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
+ char buf[MAXPATHLEN];
Index: patches/patch-misc_dist_linux_org_godotengine_Godot_desktop
===================================================================
RCS file: patches/patch-misc_dist_linux_org_godotengine_Godot_desktop
diff -N patches/patch-misc_dist_linux_org_godotengine_Godot_desktop
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-misc_dist_linux_org_godotengine_Godot_desktop 26 Apr 2022 14:24:43 -0000
@@ -0,0 +1,12 @@
+Index: misc/dist/linux/org.godotengine.Godot.desktop
+--- misc/dist/linux/org.godotengine.Godot.desktop.orig
++++ misc/dist/linux/org.godotengine.Godot.desktop
+@@ -2,7 +2,7 @@
+ Name=Godot Engine
+ GenericName=Libre game engine
+ Comment=Multi-platform 2D and 3D game engine with a feature-rich editor
+-Exec=godot %f
++Exec=${TRUEPREFIX}/bin/godot-tools %f
+ Icon=godot
+ Terminal=false
+ PrefersNonDefaultGPU=true
Index: pkg/DESCR
===================================================================
RCS file: pkg/DESCR
diff -N pkg/DESCR
--- pkg/DESCR 27 Apr 2018 07:32:53 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,3 +0,0 @@
-Godot is an advanced, feature-packed, multi-platform 2D and 3D open source
-game engine. It provides a huge set of common tools, so you can just focus
-on making your game without reinventing the wheel.
Index: pkg/DESCR-main
===================================================================
RCS file: pkg/DESCR-main
diff -N pkg/DESCR-main
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-main 26 Apr 2022 13:53:59 -0000
@@ -0,0 +1,5 @@
+Godot is an advanced, feature-packed, multi-platform 2D and 3D open
+source game engine. It provides a huge set of common tools, so you can
+just focus on making your game without reinventing the wheel.
+
+This package contains only the game engine.
Index: pkg/DESCR-tools
===================================================================
RCS file: pkg/DESCR-tools
diff -N pkg/DESCR-tools
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-tools 26 Apr 2022 13:58:24 -0000
@@ -0,0 +1 @@
+The Godot game engine with the editor (tools) built-in.
Index: pkg/PLIST
===================================================================
RCS file: pkg/PLIST
diff -N pkg/PLIST
--- pkg/PLIST 8 Mar 2022 16:48:16 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,9 +0,0 @@
-@bin bin/godot
-@man man/man6/godot.6
-share/applications/org.godotengine.Godot.desktop
-share/doc/pkg-readmes/${PKGSTEM}
-share/metainfo/
-share/metainfo/org.godotengine.Godot.appdata.xml
-share/pixmaps/
-share/pixmaps/godot.svg
-@tag update-desktop-database
Index: pkg/PLIST-main
===================================================================
RCS file: pkg/PLIST-main
diff -N pkg/PLIST-main
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-main 26 Apr 2022 13:39:37 -0000
@@ -0,0 +1,3 @@
+@pkgpath games/godot
+@bin bin/godot
+@man man/man6/godot.6
Index: pkg/PLIST-tools
===================================================================
RCS file: pkg/PLIST-tools
diff -N pkg/PLIST-tools
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-tools 26 Apr 2022 14:24:59 -0000
@@ -0,0 +1,9 @@
+@conflict godot-<=3.4.4p0
+@bin bin/godot-tools
+share/applications/org.godotengine.Godot.desktop
+share/doc/pkg-readmes/${PKGSTEM}
+share/metainfo/
+share/metainfo/org.godotengine.Godot.appdata.xml
+share/pixmaps/
+share/pixmaps/godot.svg
+@tag update-desktop-database
Index: pkg/README
===================================================================
RCS file: pkg/README
diff -N pkg/README
--- pkg/README 11 Mar 2022 19:04:30 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-+-------------------------------------------------------------------------------
-| Running ${PKGSTEM} on OpenBSD
-+-------------------------------------------------------------------------------
-
-Modules
-=======
-
-Note that this version includes the module "GodotSteam" in its namespace which
-is not part of the default Godot install. This is mainly for compatibility with
-runtime of prepackaged games. It communicates with games/goldberg_emulator, not
-an official Steam client. Making use of the Steam.* namespace for development
-may lead to unexpected behavior, so use at your own risk.
Index: pkg/README-tools
===================================================================
RCS file: pkg/README-tools
diff -N pkg/README-tools
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/README-tools 12 Mar 2022 10:06:25 -0000
@@ -0,0 +1,12 @@
++-------------------------------------------------------------------------------
+| Running ${PKGSTEM} on OpenBSD
++-------------------------------------------------------------------------------
+
+Modules
+=======
+
+Note that this version includes the module "GodotSteam" in its namespace which
+is not part of the default Godot install. This is mainly for compatibility with
+runtime of prepackaged games. It communicates with games/goldberg_emulator, not
+an official Steam client. Making use of the Steam.* namespace for development
+may lead to unexpected behavior, so use at your own risk.

No comments:

Post a Comment