freebsd-ports/games/openbor/Makefile

84 lines
2.4 KiB
Makefile
Raw Normal View History

# $FreeBSD$
PORTNAME= openbor
# Hint: svn revision is git rev-list --count ${GH_TAGNAME}
PORTVERSION= 3.0.r4432
CATEGORIES= games
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
LIB_DEPENDS= libpng.so:graphics/png \
libvpx.so:multimedia/libvpx
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
USE_SDL= gfx2
WRKSRC_SUBDIR= engine
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}"
LDFLAGS+= -Wl,--as-needed # ogg, pthread, zlib
PLIST_FILES= bin/${PORTNAME} \
share/pixmaps/${PORTNAME}.png
PORTDOCS= README
DESKTOP_ENTRIES="OpenBOR" \
"" \
"${PORTNAME}" \
"${PORTNAME}" \
"Game;ArcadeGame;" \
""
OPTIONS_DEFINE= TREMOR
2016-12-25 01:23:13 +01:00
OPTIONS_DEFAULT= ${MACHINE_CPU:Msoftfp:C/.+/TREMOR/}
OPTIONS_DEFINE_i386= MMX
OPTIONS_DEFAULT_i386= MMX # runtime detection
MMX_BUILD_DEPENDS= yasm:devel/yasm
MMX_MAKE_ARGS= BUILD_MMX=1
TREMOR_LIB_DEPENDS= libvorbisidec.so:audio/libtremor
TREMOR_MAKE_ARGS= BUILD_TREMOR=1 BUILD_VORBIS=""
TREMOR_LIB_DEPENDS_OFF= libvorbisfile.so:audio/libvorbis
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)/' \
-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() {/' \
-e 's/^get_revnum$$/VERSION_BUILD=${PORTVERSION:E:S/^r//}/' \
${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>