update to checkout from 2022-03-22, rework Makefile with input from sthen to avoid SUBST_CMD and use c++ correctly for the build, correctly replace EnableHeartbeats() with SetAdvertiseServerActive()

This commit is contained in:
thfr 2023-01-04 03:05:36 +00:00
parent 5dd8aa7f2a
commit b15e18ff24
4 changed files with 30 additions and 51 deletions

View File

@ -1,36 +1,30 @@
COMMENT = Steam API wrapper for Hashlink
V = 1.0pl0
DISTNAME = hlsteam-${V}
DISTNAME = hlsteam-1.0pl1
GH_ACCOUNT = HeapsIO
GH_PROJECT = hlsteam
GH_COMMIT = 24265f62c0499a0c4f37d42b33548c24061c2bd7
REVISION = 0
# checkout from 2022-03-22
GH_COMMIT = f774d8ea2b7255a3067254fde8d18063455dec24
CATEGORIES = games
MAINTAINER = Thomas Frohwein <thfr@openbsd.org>
# MIT
PERMIT_PACKAGE = Yes
COMPILER = base-clang ports-gcc
COMPILER_LANGS = c
WANTLIB += ${COMPILER_LIBCXX} hl m steam_api
WANTLIB += hl steam_api
FIX_CRLF_FILES = Makefile \
native/gameserver.cpp \
native/steamwrap.h
FIX_CRLF_FILES = Makefile native/gameserver.cpp
COMPILER = base-clang ports-gcc
LIB_DEPENDS = games/goldberg_emulator \
lang/hashlink
USE_GMAKE = Yes
NO_TEST = Yes
CFLAGS += -I${LOCALBASE}/include/goldberg_emulator
SUBST_VARS += CFLAGS LDFLAGS
do-gen:
${SUBST_CMD} ${WRKSRC}/Makefile
MAKE_ENV = LDFLAGS="-L${LOCALBASE}/lib" \
CXX="${CXX}"
CFLAGS += -I${LOCALBASE}/include \
-I${LOCALBASE}/include/goldberg_emulator
do-install:
${INSTALL_DATA} ${WRKSRC}/steam.hdll ${PREFIX}/lib/

View File

@ -1,2 +1,2 @@
SHA256 (hlsteam-1.0pl0-24265f62.tar.gz) = AzfGgc4mR3nRskvK9EBaUuLOk3MXGUT04efMcb7rBkI=
SIZE (hlsteam-1.0pl0-24265f62.tar.gz) = 58084
SHA256 (hlsteam-1.0pl0-f774d8ea.tar.gz) = XjxgNqBhvAoTEPp2644MpND7RdA3qeTdPaqm+yr0Ih0=
SIZE (hlsteam-1.0pl0-f774d8ea.tar.gz) = 58494

View File

@ -1,51 +1,37 @@
honor CFLAGS, LDFLAGS, and LOCALBASE
use parentheses to not clash with SUBST_CMD
remove -lstdc++ (not needed)
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -1,30 +1,12 @@
-LBITS := $(shell getconf LONG_BIT)
+CFLAGS = ${CFLAGS} -Wall -I src -I native/include -fPIC -I ../sdk/public -I${LOCALBASE}/include
+#LFLAGS = ${LDFLAGS} -lhl -lsteam_api -lstdc++ -L${LOCALBASE}/lib
+LFLAGS = ${LDFLAGS} -lhl -lsteam_api -L${LOCALBASE}/lib
@@ -2,7 +2,7 @@ LBITS := $(shell getconf LONG_BIT)
UNAME := $(shell uname)
-UNAME := $(shell uname)
-
-CFLAGS = -Wall -O3 -I src -I native/include -fPIC -I ../sdk/public
-
-ifndef ARCH
- ARCH = $(LBITS)
-endif
-
-LIBARCH=$(ARCH)
-ifeq ($(UNAME),Darwin)
-OS=osx
-# universal lib in osx32 dir
-LIBARCH=32
-else
-OS=linux
-CFLAGS += -std=c++0x
-endif
-
+CFLAGS += -Wall -I src -I native/include -fPIC -I ../sdk/public
ifndef ARCH
ARCH = $(LBITS)
@@ -18,13 +18,13 @@ OS=linux
CFLAGS += -std=c++0x
endif
-LFLAGS = -lhl -lsteam_api -lstdc++ -L native/lib/$(OS)$(LIBARCH) -L ../sdk/redistributable_bin/$(OS)$(ARCH)
-
+LFLAGS = ${LDFLAGS} -lhl -lsteam_api
SRC = native/cloud.o native/common.o native/controller.o native/friends.o native/gameserver.o \
native/matchmaking.o native/networking.o native/stats.o native/ugc.o
all: ${SRC}
- ${CC} ${CFLAGS} -shared -o steam.hdll ${SRC} ${LFLAGS}
+ $(CC) $(CFLAGS) -shared -o steam.hdll ${SRC} $(LFLAGS)
+ ${CXX} ${CFLAGS} -shared -o steam.hdll ${SRC} ${LFLAGS}
install:
cp steam.hdll /usr/lib
@@ -33,7 +15,7 @@ install:
@@ -33,7 +33,7 @@ install:
.SUFFIXES : .cpp .o
.cpp.o :
- ${CC} ${CFLAGS} -o $@ -c $<
+ $(CC) $(CFLAGS) -o $@ -c $<
+ ${CXX} ${CFLAGS} -o $@ -c $<
clean_o:
rm -f ${SRC}

View File

@ -1,6 +1,5 @@
stub EnableHeartbeats; changing function names and anyway not
implemented in goldberg_emulator
GetPublicIP returns a struct; return its IPv4 member as int cast
EnableHeartbeats is now the same function with the name SetAdvertiseServerActive
Index: native/gameserver.cpp
--- native/gameserver.cpp.orig
@ -10,7 +9,7 @@ Index: native/gameserver.cpp
void HL_NAME(gameserver_enable_heartbeats)( bool b ) {
- SteamGameServer()->EnableHeartbeats(b);
+ /* empty; not implemented in goldberg_emulator anyway */
+ SteamGameServer()->SetAdvertiseServerActive(b);
}
void HL_NAME(gameserver_config)( char *modDir, char *product, char *desc ) {