freebsd-ports/games/openbor/Makefile

110 lines
2.9 KiB
Makefile
Raw Normal View History

# $FreeBSD$
PORTNAME= openbor
# Hint: svn revision is git rev-list --count ${GH_TAGNAME}
PORTVERSION?= 6967
.ifndef PKGNAMESUFFIX
PORTREVISION= 0
.endif
CATEGORIES= games
MAINTAINER= jbeich@FreeBSD.org
COMMENT= 2D side scrolling engine for beat 'em ups, shooters, and more #'
LICENSE= BSD3CLAUSE GPLv2+
.if ${PORTVERSION} >= 4134
LICENSE+= ISCL
.endif
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
.if ${PORTVERSION} >= 4134
LIB_DEPENDS+= libvpx.so:multimedia/libvpx
.endif
.ifdef PKGNAMESUFFIX
PORTSCOUT= ignore:1
.endif
USE_GITHUB= yes
GH_ACCOUNT= DCurrent
GH_TAGNAME?= 02cbdf44
USES+= gmake pkgconfig
.if ${PORTVERSION} < 4433
2017-02-05 04:30:43 +01:00
USE_CSTD= gnu89
.endif
.if ${PORTVERSION} < 4108
USE_SDL= gfx
.elif ${PORTVERSION} < 6639
USE_SDL= gfx2
.else
USE_SDL= sdl2
.endif
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
SUB_FILES= pkg-message
SUB_LIST= PKGBASE=${PKGBASE}
PLIST_FILES= bin/${PKGBASE} \
share/pixmaps/${PKGBASE}.png
DOCSDIR= ${PREFIX}/share/doc/${PKGBASE}
PORTDOCS= README
DESKTOP_ENTRIES="OpenBOR v3.0 Build ${PORTVERSION}" \
"" \
"${PKGBASE}" \
"${PKGBASE}" \
"Game;ArcadeGame;" \
""
OPTIONS_DEFINE= DOCS 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/ -Wno-unused-result//' \
-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
@${REINPLACE_CMD} -e 's/\.openbor/.${PKGBASE}/' \
${WRKSRC}/sdl/sdlport.c
@${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}/' \
${WRKSRC}/version.sh
do-configure:
(cd ${WRKSRC} && ${SH} ./version.sh)
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/OpenBOR.elf \
${STAGEDIR}${PREFIX}/bin/${PKGBASE}
${INSTALL_DATA} ${WRKSRC}/resources/OpenBOR_Icon_128x128.png \
${STAGEDIR}${PREFIX}/share/pixmaps/${PKGBASE}.png
(cd ${WRKSRC} && ${COPYTREE_SHARE} \
"${PORTDOCS}" ${STAGEDIR}${DOCSDIR})
.include <bsd.port.mk>