2015-04-13 15:43:47 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= openbor
|
2017-04-28 00:01:37 +02:00
|
|
|
# Hint: svn revision is git rev-list --count ${GH_TAGNAME}
|
2017-02-06 13:56:58 +01:00
|
|
|
PORTVERSION= 3.0.r4432
|
2016-12-21 06:21:02 +01:00
|
|
|
CATEGORIES= games
|
2015-04-13 15:43:47 +02:00
|
|
|
|
|
|
|
MAINTAINER= jbeich@FreeBSD.org
|
|
|
|
COMMENT= Moddable fighting game engine (aka Beats of Rage)
|
|
|
|
|
2016-12-25 09:31:51 +01:00
|
|
|
LICENSE= BSD3CLAUSE GPLv2+ ISCL
|
2016-12-24 01:37:19 +01:00
|
|
|
LICENSE_COMB= multi
|
|
|
|
LICENSE_FILE_BSD3CLAUSE=${WRKSRC}/LICENSE
|
|
|
|
LICENSE_FILE_GPLv2+ = ${_LICENSE_STORE}/GPLv2 # source/gfxlib/hq2x.c
|
2016-12-25 09:31:51 +01:00
|
|
|
LICENSE_FILE_ISCL= ${WRKSRC}/source/webmlib/nestegg/LICENSE
|
2015-04-13 15:43:47 +02:00
|
|
|
|
2016-03-16 13:58:16 +01:00
|
|
|
LIB_DEPENDS= libpng.so:graphics/png \
|
|
|
|
libvpx.so:multimedia/libvpx
|
2015-04-13 15:43:47 +02:00
|
|
|
|
2017-04-16 14:58:28 +02:00
|
|
|
USE_GITHUB= yes
|
|
|
|
GH_ACCOUNT= DCurrent
|
|
|
|
GH_TAGNAME= ba1eb4f # git v4432 is actually svn r4437
|
|
|
|
|
|
|
|
USES= gmake pkgconfig
|
2017-02-05 04:30:43 +01:00
|
|
|
USE_CSTD= gnu89
|
2015-04-13 15:43:47 +02:00
|
|
|
USE_SDL= gfx2
|
2017-04-16 14:58:28 +02:00
|
|
|
WRKSRC_SUBDIR= engine
|
2015-04-13 15:43:47 +02:00
|
|
|
MAKE_ENV= BUILD_LINUX=1 SDKPATH="${LOCALBASE}" \
|
|
|
|
GCC_TARGET="${CONFIGURE_TARGET:S/amd64/x86_64/}"
|
|
|
|
MAKE_ARGS= CC="${CC}" LIBRARIES="${LOCALBASE}/lib" \
|
|
|
|
TARGET_ARCH=${ARCH:S/i386/x86/} ARCHFLAGS="" \
|
games/openbor: warnings
- With `make -s` only compiler warnings are allowed to break silence
- -Wno-unsued-result is no longer fatal after 9.x EOL
source/gamelib/packfile.c: In function 'packfile_music_read':
source/gamelib/packfile.c:1402:13: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
memset(filelist[i].bgmTracks, 0, 256);
^~~~~~
source/scriptlib/Parser.c: In function 'Parser_Unary_expr':
source/scriptlib/Parser.c:1879:30: warning: may write a terminating nul past the end of the destination [-Wformat-length=]
sprintf(buf, "-%s", pInstruction->theToken->theSource);
~~~^
source/scriptlib/Parser.c:1879:13: note: format output between 2 and 129 bytes into a destination ofsize 128
sprintf(buf, "-%s", pInstruction->theToken->theSource);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source/scriptlib/Parser.c:1906:30: warning: may write a terminating nul past the end of the destination [-Wformat-length=]
sprintf(buf, "!%s", pInstruction->theToken->theSource);
~~~^
source/scriptlib/Parser.c:1906:13: note: format output between 2 and 129 bytes into a destination ofsize 128
sprintf(buf, "!%s", pInstruction->theToken->theSource);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:8224:26: warning: comparison of unsigned expression >= 0 is always true
[-Wtautological-compare]
for(i = len-1; i >= 0; i--)
~ ^ ~
openbor.c:21719:68: warning: using integer absolute value function 'abs' when argument is of floating
point type [-Wabsolute-value]
if(ent->direction == DIRECTION_RIGHT) ent->velocity.x = -1*abs(ent->velocity.x);
^
openbor.c:21719:68: note: use function 'fabsf' instead
if(ent->direction == DIRECTION_RIGHT) ent->velocity.x = -1*abs(ent->velocity.x);
^~~
fabsf
openbor.c:21720:32: warning: using integer absolute value function 'abs' when argument is of floating
point type [-Wabsolute-value]
else ent->velocity.x = abs(ent->velocity.x);
^
openbor.c:21720:32: note: use function 'fabsf' instead
else ent->velocity.x = abs(ent->velocity.x);
^~~
fabsf
openbor.c:25840:9: warning: taking the absolute value of unsigned type 'unsigned int' has no effect
[-Wabsolute-value]
if (abs(rand32()) % 2)
^
openbor.c:25840:9: note: remove the call to 'abs' since unsigned values cannot be negative
if (abs(rand32()) % 2)
^~~
2017-01-15 12:31:24 +01:00
|
|
|
TARGET_FINAL='${TARGET}' BUILD_MMX="" ECHO="${ECHO}"
|
2016-12-14 16:39:30 +01:00
|
|
|
LDFLAGS+= -Wl,--as-needed # ogg, pthread, zlib
|
2015-04-13 15:43:47 +02:00
|
|
|
PLIST_FILES= bin/${PORTNAME} \
|
|
|
|
share/pixmaps/${PORTNAME}.png
|
|
|
|
PORTDOCS= README
|
|
|
|
|
|
|
|
DESKTOP_ENTRIES="OpenBOR" \
|
|
|
|
"" \
|
|
|
|
"${PORTNAME}" \
|
|
|
|
"${PORTNAME}" \
|
|
|
|
"Game;ArcadeGame;" \
|
|
|
|
""
|
|
|
|
|
2015-08-26 23:33:19 +02:00
|
|
|
OPTIONS_DEFINE= TREMOR
|
2016-12-25 01:23:13 +01:00
|
|
|
OPTIONS_DEFAULT= ${MACHINE_CPU:Msoftfp:C/.+/TREMOR/}
|
2015-08-26 23:33:04 +02:00
|
|
|
OPTIONS_DEFINE_i386= MMX
|
|
|
|
OPTIONS_DEFAULT_i386= MMX # runtime detection
|
2015-04-13 15:43:47 +02:00
|
|
|
|
2016-03-16 13:58:16 +01:00
|
|
|
MMX_BUILD_DEPENDS= yasm:devel/yasm
|
2015-08-26 23:33:04 +02:00
|
|
|
MMX_MAKE_ARGS= BUILD_MMX=1
|
2015-04-13 15:43:47 +02:00
|
|
|
|
2016-03-16 13:58:16 +01:00
|
|
|
TREMOR_LIB_DEPENDS= libvorbisidec.so:audio/libtremor
|
2015-08-26 23:33:19 +02:00
|
|
|
TREMOR_MAKE_ARGS= BUILD_TREMOR=1 BUILD_VORBIS=""
|
2016-03-16 13:58:16 +01:00
|
|
|
TREMOR_LIB_DEPENDS_OFF= libvorbisfile.so:audio/libvorbis
|
2015-08-26 23:33:19 +02:00
|
|
|
|
2015-04-13 15:43:47 +02:00
|
|
|
post-patch:
|
|
|
|
@${REINPLACE_CMD} -e 's/ -O[0-9]//; s/ -g//; s/ -Werror//' \
|
|
|
|
-e 's/ -fomit-frame-pointer//' \
|
|
|
|
-e 's/ -freorder-blocks//' \
|
|
|
|
-e 's/ -Wl,-rpath,$$(LIBRARIES)//' \
|
|
|
|
-e '/echo/!s/ @/ /' \
|
games/openbor: warnings
- With `make -s` only compiler warnings are allowed to break silence
- -Wno-unsued-result is no longer fatal after 9.x EOL
source/gamelib/packfile.c: In function 'packfile_music_read':
source/gamelib/packfile.c:1402:13: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
memset(filelist[i].bgmTracks, 0, 256);
^~~~~~
source/scriptlib/Parser.c: In function 'Parser_Unary_expr':
source/scriptlib/Parser.c:1879:30: warning: may write a terminating nul past the end of the destination [-Wformat-length=]
sprintf(buf, "-%s", pInstruction->theToken->theSource);
~~~^
source/scriptlib/Parser.c:1879:13: note: format output between 2 and 129 bytes into a destination ofsize 128
sprintf(buf, "-%s", pInstruction->theToken->theSource);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source/scriptlib/Parser.c:1906:30: warning: may write a terminating nul past the end of the destination [-Wformat-length=]
sprintf(buf, "!%s", pInstruction->theToken->theSource);
~~~^
source/scriptlib/Parser.c:1906:13: note: format output between 2 and 129 bytes into a destination ofsize 128
sprintf(buf, "!%s", pInstruction->theToken->theSource);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openbor.c:8224:26: warning: comparison of unsigned expression >= 0 is always true
[-Wtautological-compare]
for(i = len-1; i >= 0; i--)
~ ^ ~
openbor.c:21719:68: warning: using integer absolute value function 'abs' when argument is of floating
point type [-Wabsolute-value]
if(ent->direction == DIRECTION_RIGHT) ent->velocity.x = -1*abs(ent->velocity.x);
^
openbor.c:21719:68: note: use function 'fabsf' instead
if(ent->direction == DIRECTION_RIGHT) ent->velocity.x = -1*abs(ent->velocity.x);
^~~
fabsf
openbor.c:21720:32: warning: using integer absolute value function 'abs' when argument is of floating
point type [-Wabsolute-value]
else ent->velocity.x = abs(ent->velocity.x);
^
openbor.c:21720:32: note: use function 'fabsf' instead
else ent->velocity.x = abs(ent->velocity.x);
^~~
fabsf
openbor.c:25840:9: warning: taking the absolute value of unsigned type 'unsigned int' has no effect
[-Wabsolute-value]
if (abs(rand32()) % 2)
^
openbor.c:25840:9: note: remove the call to 'abs' since unsigned values cannot be negative
if (abs(rand32()) % 2)
^~~
2017-01-15 12:31:24 +01:00
|
|
|
-e 's/@echo/@$$(ECHO)/' \
|
2015-04-13 15:43:47 +02:00
|
|
|
-e 's/$$(LIBS)/$$(LDFLAGS) &/' \
|
|
|
|
${WRKSRC}/Makefile
|
|
|
|
@${GREP} -Flr 'malloc.h' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \
|
|
|
|
's,malloc\.h,stdlib.h,'
|
|
|
|
@${REINPLACE_CMD} -e 's/^function \(.*\) {/\1() {/' \
|
2017-04-16 14:58:28 +02:00
|
|
|
-e 's/^get_revnum$$/VERSION_BUILD=${PORTVERSION:E:S/^r//}/' \
|
2015-04-13 15:43:47 +02:00
|
|
|
${WRKSRC}/version.sh
|
|
|
|
|
|
|
|
do-configure:
|
|
|
|
(cd ${WRKSRC} && ${SH} ./version.sh)
|
|
|
|
|
|
|
|
do-install:
|
|
|
|
${INSTALL_PROGRAM} ${WRKSRC}/OpenBOR.elf \
|
|
|
|
${STAGEDIR}${PREFIX}/bin/${PORTNAME}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/resources/OpenBOR_Icon_128x128.png \
|
|
|
|
${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.png
|
|
|
|
(cd ${WRKSRC} && ${COPYTREE_SHARE} \
|
|
|
|
"${PORTDOCS}" ${STAGEDIR}${DOCSDIR})
|
|
|
|
|
|
|
|
.include <bsd.port.mk>
|