From 36c4fbb44ede3f69ad631a54ae608308398b5f3c Mon Sep 17 00:00:00 2001 From: op Date: Thu, 28 Apr 2022 22:18:01 +0000 Subject: [PATCH] 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@ --- games/godot/Makefile | 26 ++++++++++++++----- .../patches/patch-drivers_unix_os_unix_cpp | 18 +++++++------ ...c_dist_linux_org_godotengine_Godot_desktop | 12 +++++++++ games/godot/pkg/DESCR | 3 --- games/godot/pkg/DESCR-main | 5 ++++ games/godot/pkg/DESCR-tools | 1 + games/godot/pkg/PLIST-main | 3 +++ games/godot/pkg/{PLIST => PLIST-tools} | 4 +-- games/godot/pkg/{README => README-tools} | 0 9 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 games/godot/patches/patch-misc_dist_linux_org_godotengine_Godot_desktop delete mode 100644 games/godot/pkg/DESCR create mode 100644 games/godot/pkg/DESCR-main create mode 100644 games/godot/pkg/DESCR-tools create mode 100644 games/godot/pkg/PLIST-main rename games/godot/pkg/{PLIST => PLIST-tools} (82%) rename games/godot/pkg/{README => README-tools} (100%) diff --git a/games/godot/Makefile b/games/godot/Makefile index 342cc25d3fc..778d0ae1b58 100644 --- a/games/godot/Makefile +++ b/games/godot/Makefile @@ -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 # 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 diff --git a/games/godot/patches/patch-drivers_unix_os_unix_cpp b/games/godot/patches/patch-drivers_unix_os_unix_cpp index 9a01e4ba874..9572fa175de 100644 --- a/games/godot/patches/patch-drivers_unix_os_unix_cpp +++ b/games/godot/patches/patch-drivers_unix_os_unix_cpp @@ -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]; diff --git a/games/godot/patches/patch-misc_dist_linux_org_godotengine_Godot_desktop b/games/godot/patches/patch-misc_dist_linux_org_godotengine_Godot_desktop new file mode 100644 index 00000000000..ee028afdee3 --- /dev/null +++ b/games/godot/patches/patch-misc_dist_linux_org_godotengine_Godot_desktop @@ -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 diff --git a/games/godot/pkg/DESCR b/games/godot/pkg/DESCR deleted file mode 100644 index 1973d682567..00000000000 --- a/games/godot/pkg/DESCR +++ /dev/null @@ -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. diff --git a/games/godot/pkg/DESCR-main b/games/godot/pkg/DESCR-main new file mode 100644 index 00000000000..ff778ad8f96 --- /dev/null +++ b/games/godot/pkg/DESCR-main @@ -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. diff --git a/games/godot/pkg/DESCR-tools b/games/godot/pkg/DESCR-tools new file mode 100644 index 00000000000..73c13b9f0cb --- /dev/null +++ b/games/godot/pkg/DESCR-tools @@ -0,0 +1 @@ +The Godot game engine with the editor (tools) built-in. diff --git a/games/godot/pkg/PLIST-main b/games/godot/pkg/PLIST-main new file mode 100644 index 00000000000..87592175403 --- /dev/null +++ b/games/godot/pkg/PLIST-main @@ -0,0 +1,3 @@ +@pkgpath games/godot +@bin bin/godot +@man man/man6/godot.6 diff --git a/games/godot/pkg/PLIST b/games/godot/pkg/PLIST-tools similarity index 82% rename from games/godot/pkg/PLIST rename to games/godot/pkg/PLIST-tools index 0f686d5c6ba..91452226bc3 100644 --- a/games/godot/pkg/PLIST +++ b/games/godot/pkg/PLIST-tools @@ -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/ diff --git a/games/godot/pkg/README b/games/godot/pkg/README-tools similarity index 100% rename from games/godot/pkg/README rename to games/godot/pkg/README-tools