freebsd-ports/devel/allegro/Makefile
Mathieu Arnold 4e1b79a0a6 Remove ${PORTSDIR}/ from dependencies, categories d, e, f, and g.
With hat:	portmgr
Sponsored by:	Absolight
2016-04-01 14:00:51 +00:00

121 lines
4 KiB
Makefile

# Created by: Jimmy Olgeni <olgeni@FreeBSD.org>
# $FreeBSD$
PORTNAME= allegro
DISTVERSION= 4.4.2
PORTREVISION= 5
CATEGORIES= devel
MASTER_SITES= SF/alleg/allegro/${PORTVERSION}
DISTFILES= ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}
DIST_SUBDIR= ${PORTNAME}
EXTRACT_ONLY= ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}
MAINTAINER= koalative@gmail.com
COMMENT= Cross-platform library for games and multimedia programming
LIB_DEPENDS+= libpng.so:graphics/png \
libvorbis.so:audio/libvorbis
USES= cmake gmake makeinfo pkgconfig
USE_XORG= x11 xpm xext xcursor xxf86vm xxf86dga
USE_GL= glu
USE_LDCONFIG= yes
INFO= allegro
PORTDOCS= *
PORTEXAMPLES= *
PLIST_SUB+= SHLIB_VER="${SHLIB_VER}"
CMAKE_ARGS+= -DDOCDIR="${DOCSDIR}"
SHLIB_VER= ${PORTVERSION}
# Wrong versioning upstream
PORTSCOUT= ignore:1
OPTIONS_DEFINE= ALSA JACK OGG DOCS
OPTIONS_GROUP= DEMOS_EXAMPLES
OPTIONS_GROUP_DEMOS_EXAMPLES= DEMOS EXAMPLES
OPTIONS_DEFAULT= ALSA DEMOS OGG
DEMOS_DESC= Install Demos programs, requires EXAMPLES
DOCSRCDIR1= ${WRKSRC}
DOC_FILES1= AUTHORS CHANGES THANKS readme.txt
DOCSRCDIR2= ${WRKSRC}/docs
DOCSDIR2= ${DOCSDIR}/docs
OPTIONS_SUB= yes
EXAMPLES_CMAKE_ON= -DWANT_EXAMPLES=on
EXAMPLES_CMAKE_OFF= -DWANT_EXAMPLES=off
ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib
ALSA_CMAKE_ON= -DWANT_ALSA=on
ALSA_CMAKE_OFF= -DWANT_ALSA=off
JACK_LIB_DEPENDS= libjack.so:audio/jack
JACK_CMAKE_ON= -DWANT_JACK=on
JACK_CMAKE_OFF= -DWANT_JACK=off
OGG_LIB_DEPENDS= libogg.so:audio/libogg
OGG_CMAKE_ON= -DWANT_LOGG=on
OGG_CMAKE_OFF= -DWANT_LOGG=of
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MALSA}
CFLAGS+= -L${LOCALBASE}/lib
.endif
.if ${PORT_OPTIONS:MDEMOS} && ${PORT_OPTIONS:MEXAMPLES}
SUB_FILES+= shooter skater skater_agl \
pkg-message
MASTER_SITES+= SF/nemysisfreebsdp/${CATEGORIES}/${PORTNAME}/:icons
DISTFILES+= shooter.png:icons \
skater.png:icons
DESKTOP_ENTRIES+="Shooter" "In a distant corner of the galaxy" "shooter" \
"shooter" "Game;ArcadeGame;" false
DESKTOP_ENTRIES+="Skater" "Allegro's next demo game" "skater" \
"skater" "Game;ArcadeGame;" false
DESKTOP_ENTRIES+="Skater AGL" "Allegro's next demo game" "skater" \
"skater_agl" "Game;ArcadeGame;" false
.endif
post-patch:
@${REINPLACE_CMD} -e 's|/allegro-$${ALLEGRO_VERSION}||' \
${WRKSRC}/docs/CMakeLists.txt
@${REINPLACE_CMD} -e 's|<X11/extensions/xf86dga.h>|<X11/extensions/Xxf86dga.h>|' \
${WRKSRC}/src/x/xdga2.c
.if ${PORT_OPTIONS:MJACK}
@${REINPLACE_CMD} -e 's|jack_client = jack_client_new(jack_client_name);|jack_client = jack_client_open(jack_client_name, (jack_options_t)0, NULL);|' \
${WRKSRC}/src/unix/jack.c
.endif
post-install:
@${INSTALL_MAN} ${WRKSRC}/docs/man/*.3 ${STAGEDIR}${MAN3PREFIX}/man/man3/
.if ${PORT_OPTIONS:MEXAMPLES}
@(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
. for l in ex12bit ex3buf ex3d exaccel exalpha exbitmap exblend excamera excolmap \
exconfig excustom exdata exdbuf exexedat exfixed exflame exflip exfont \
exgui exhello exjoy exkeys exlights exmem exmidi exmouse expackf expal \
expat exquat exrgbhsv exrotscl exsample exscale exscn3d exscroll exshade \
exspline exsprite exstars exstream exswitch exsyscur extimer extrans \
extrans2 extruec exunicod exupdate exxfade exzbuf
@${CHMOD} u+w ${STAGEDIR}${EXAMPLESDIR}/${l}
${STRIP_CMD} ${STAGEDIR}${EXAMPLESDIR}/${l}
@${CHMOD} u-w ${STAGEDIR}${EXAMPLESDIR}/${l}
. endfor
.endif
.if ${PORT_OPTIONS:MDEMOS} && ${PORT_OPTIONS:MEXAMPLES}
@(cd ${WRKSRC} && ${COPYTREE_SHARE} demos ${STAGEDIR}${EXAMPLESDIR})
${INSTALL_SCRIPT} ${WRKDIR}/shooter ${STAGEDIR}${PREFIX}/bin/
${INSTALL_DATA} ${_DISTDIR}/shooter.png ${STAGEDIR}${PREFIX}/share/pixmaps/
@(cd ${STAGEDIR}${EXAMPLESDIR}/demos/shooter && ${CHMOD} 755 shooter)
${INSTALL_SCRIPT} ${WRKDIR}/skater* ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${_DISTDIR}/skater.png ${STAGEDIR}${PREFIX}/share/pixmaps/
@(cd ${STAGEDIR}${EXAMPLESDIR}/demos/skater && ${CHMOD} 755 skater*)
${STRIP_CMD} ${STAGEDIR}${EXAMPLESDIR}/demos/shooter/shooter
${STRIP_CMD} ${STAGEDIR}${EXAMPLESDIR}/demos/skater/skater*
.endif
.include <bsd.port.mk>