Now against HEAD... sorry.

On Mon, Oct 18, 2021 at 01:19:52PM -0600, Thomas Frohwein wrote:
> 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...
> 
> 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?
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/games/godot/Makefile,v
> retrieving revision 1.25
> diff -u -p -r1.25 Makefile
> --- Makefile  31 Aug 2021 11:59:56 -0000      1.25
> +++ Makefile  18 Oct 2021 18:53:50 -0000
> @@ -5,9 +5,11 @@ BROKEN-powerpc64 =   Unknown ISA
>  
>  COMMENT =    2D and 3D game engine
>  
> -V =          3.3.3
> +V =          3.3.4
[...]

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/godot/Makefile,v
retrieving revision 1.26
diff -u -p -r1.26 Makefile
--- Makefile    5 Oct 2021 07:00:08 -0000       1.26
+++ Makefile    18 Oct 2021 19:32:54 -0000
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.26 2021/10/05 07:00:08 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
@@ -6,8 +6,10 @@ BROKEN-powerpc64 =     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 <o...@omarpolo.com>
@@ -18,14 +20,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
@@ -33,7 +39,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 \
@@ -51,6 +57,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 \
@@ -63,6 +70,7 @@ LIB_DEPENDS =         archivers/zstd \
                        audio/opusfile \
                        devel/gettext,-runtime \
                        devel/pcre2 \
+                       games/goldberg_emulator \
                        graphics/libwebp \
                        graphics/png \
                        multimedia/libtheora \
@@ -84,6 +92,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    18 Oct 2021 19:32:54 -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

Reply via email to