split Godot into two packages: engine alone (-main) and editor (-tools)

A Godot build with the tools enabled is not really that great to run
standalone games due to the various extra checks that the engine does,
so disable the tools (i.e. the editor) in the -main package, but provide
a -tools package for folks that wants to develop games.

While here use target=release instead of debug_release for the -main
package: comments in the SConstruct file hints that debug_release
enables check useful only for development.

discussed many times with various people, tested by few (thanks!)
ok/improvements from sthen@
This commit is contained in:
op 2022-04-28 22:18:01 +00:00
parent 5c37e54afe
commit 36c4fbb44e
9 changed files with 53 additions and 19 deletions

View File

@ -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

View File

@ -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];

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -0,0 +1 @@
The Godot game engine with the editor (tools) built-in.

View File

@ -0,0 +1,3 @@
@pkgpath games/godot
@bin bin/godot
@man man/man6/godot.6

View File

@ -1,5 +1,5 @@
@bin bin/godot
@man man/man6/godot.6
@conflict godot-<=3.4.4p0
@bin bin/godot-tools
share/applications/org.godotengine.Godot.desktop
share/doc/pkg-readmes/${PKGSTEM}
share/metainfo/