On Mon, Oct 25, 2021 at 06:13:35PM +0200, Omar Polo wrote:
> Sorry for replying this late
>
> Thomas Frohwein <[email protected]> writes:
>
> > Hi,
> >
> > I've been experimenting with running commercial games with our Godot
> > port and a substantial number refuse to run because they can't find
> > Steam in Godot's namespace. Those games seem to be built with a module
> > "GodotSteam" added during compile time.
> >
> > This diff below adds said module to the port. It allows running some
> > more (indie) games on OpenBSD. I know of "Nightfall Hacker", "SJ-19
> > Learns to Love!", and "Cruelty Squad" that I've been able to run with
> > this change. There are probably more...
> >
> > This diff just adds it to the existing port, but as it leads to a
> > deviation from "vanilla" Godot, it might be preferrable to make this a
> > flavor, maybe godot-godotsteam? Or 2 separate ports that are based on
> > the same Makefile.inc? Of course, maintenance would likely be easier
> > without adding such complexity...
>
> The additions from the GodotStream API seems to be limited to a single
> namespace, so I'm not opposed to bundling them into the shipped Godot.
> It's a deviation from vanilla Godot for sure, but it's small and done to
> help making more games available.
>
> I'm OK with bundling this in the current Godot port as your (updated)
> diff does, but we should document it somewhere (be it with a message or
> a README) to not lure users into thinking that these are official API.
>
> I'm also fine with a flavor, but given how small the impact of bundling
> this library is, I tend to prefer avoiding splitting in multiple flavors
> or subpackages.
Below an updated diff that includes a README. Does that look ok?
> > You can test that the namespace now exists in Godot by opening a
> > project in the editor and adding a script, then starting to enter
> > something from the Steam namespace like 'Steam.getAchievement' into the
> > code and seeing this show up in the auto completion. All this works
> > through the Goldberg emulator library, so some Steam functionality may
> > be stubbed or not return what you expect if used for actual development.
> >
> > comments or oks?
>
> the updated patch is fine for me :)
>
> (the CVS marker is the updated diff is wrong, as it changes the revision
> from 1.26 to 1.25 when the latest is 1.27, but I don't think it's a
> problem in practice ;-)
>
> I checked that the wantlib is correct and that the APIs exists. Godot
> doesn't crash when calling stuff under Steam.*, but I don't have an
> account anymore so I can't do further runtime testing.
Index: Makefile
===================================================================
RCS file: /cvs/ports/games/godot/Makefile,v
retrieving revision 1.27
diff -u -p -r1.27 Makefile
--- Makefile 14 Oct 2021 14:33:29 -0000 1.27
+++ Makefile 29 Oct 2021 18:56:57 -0000
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.27 2021/10/14 14:33:29 thfr Exp $
+# $OpenBSD: Makefile,v 1.25 2021/08/31 11:59:56 kirby Exp $
BROKEN-powerpc = fails at runtime, the UI is totally blank
BROKEN-powerpc64 = Unknown ISA
@@ -8,8 +8,10 @@ BROKEN-mips64 = Unknown ISA
COMMENT = 2D and 3D game engine
V = 3.3.4
+GODOTSTEAM_V = g333-s151-g397
DISTNAME = godot-${V}-stable
PKGNAME = godot-${V}
+REVISION = 0
CATEGORIES = games
HOMEPAGE = https://godotengine.org/
MAINTAINER = Omar Polo <[email protected]>
@@ -20,14 +22,18 @@ PERMIT_PACKAGE = Yes
WANTLIB += ${COMPILER_LIBCXX}
WANTLIB += 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 theora theoradec
-WANTLIB += vorbis vorbisfile webp xcb z pcre2-32 vpx zstd
+WANTLIB += mbedx509 mpcdec ogg opus opusfile png sndio steam_api theora
+WANTLIB += theoradec vorbis vorbisfile webp xcb z pcre2-32 vpx zstd
# C++14
COMPILER = base-clang ports-gcc
MASTER_SITES = https://downloads.tuxfamily.org/godotengine/${V}/
+MASTER_SITES0 = https://github.com/Gramps/GodotSteam/archive/refs/tags/
+DISTFILES = ${DISTNAME}${EXTRACT_SUFX} \
+ ${GODOTSTEAM_V}.tar.gz:0
EXTRACT_SUFX = .tar.xz
+DIST_SUBDIR = ${PKGNAME}
MODULES = devel/scons
# Can't disable builtin_bullet until devel/bullet has been updated to 2.88
@@ -35,7 +41,7 @@ MODULES = devel/scons
# sharedlib_ext in modules/mono/config.py to '.so.1.0'
MODSCONS_FLAGS = CC="${CC}" \
CXX="${CXX}" \
- CFLAGS="${CFLAGS}" \
+ CFLAGS="${CFLAGS}
-I${LOCALBASE}/include/goldberg_emulator/sdk_includes" \
CXXFLAGS="${CXXFLAGS} -Wno-deprecated-register" \
LINKFLAGS="${LDFLAGS} -lintl -lmpcdec" \
builtin_enet=no \
@@ -53,6 +59,7 @@ MODSCONS_FLAGS = CC="${CC}" \
builtin_pcre2=no \
builtin_zlib=no \
builtin_zstd=no \
+
custom_modules=${WRKDIR}/GodotSteam-${GODOTSTEAM_V}/godotsteam \
progress=no \
pulseaudio=no \
target=release_debug \
@@ -65,6 +72,7 @@ LIB_DEPENDS = archivers/zstd \
audio/opusfile \
devel/gettext,-runtime \
devel/pcre2 \
+ games/goldberg_emulator \
graphics/libwebp \
graphics/png \
multimedia/libtheora \
@@ -86,6 +94,12 @@ post-extract:
pre-configure:
${SUBST_CMD} ${WRKSRC}/drivers/unix/os_unix.cpp
+ sed -E -i 's/ISteamHTMLSurface:://g' \
+ ${WRKDIR}/GodotSteam-${GODOTSTEAM_V}/godotsteam/godotsteam.cpp
+ sed -E -i 's/steam\/steam_api\.h/steam_api.h/g' \
+
${WRKDIR}/GodotSteam-${GODOTSTEAM_V}/godotsteam/godotsteam.{h,cpp}
+ sed -E -i
's,CPPPATH=.*,CPPPATH=["${LOCALBASE}/include/goldberg_emulator/sdk_includes"]),g'
\
+ ${WRKDIR}/GodotSteam-${GODOTSTEAM_V}/godotsteam/SCsub
do-install:
${INSTALL_PROGRAM} ${WRKBUILD}/bin/godot* \
Index: distinfo
===================================================================
RCS file: /cvs/ports/games/godot/distinfo,v
retrieving revision 1.9
diff -u -p -r1.9 distinfo
--- distinfo 5 Oct 2021 07:00:08 -0000 1.9
+++ distinfo 29 Oct 2021 18:56:57 -0000
@@ -1,2 +1,4 @@
-SHA256 (godot-3.3.4-stable.tar.xz) =
n1On1tY/Tp15PEGtG++JUYYZ8+Hw3dCJplIfLV7cWFk=
-SIZE (godot-3.3.4-stable.tar.xz) = 20682120
+SHA256 (godot-3.3.4/g333-s151-g397.tar.gz) =
Wqzzcwh+u0r5PZZd5WgJCZ3dFhdJs8ZCbNNS5Ln5V9w=
+SHA256 (godot-3.3.4/godot-3.3.4-stable.tar.xz) =
n1On1tY/Tp15PEGtG++JUYYZ8+Hw3dCJplIfLV7cWFk=
+SIZE (godot-3.3.4/g333-s151-g397.tar.gz) = 149576
+SIZE (godot-3.3.4/godot-3.3.4-stable.tar.xz) = 20682120
Index: pkg/README
===================================================================
RCS file: pkg/README
diff -N pkg/README
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/README 29 Oct 2021 18:56:57 -0000
@@ -0,0 +1,14 @@
+$OpenBSD: README.template,v 1.7 2019/05/09 17:45:05 ajacoutot Exp $
+
++-------------------------------------------------------------------------------
+| 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.