aboutsummaryrefslogtreecommitdiff
path: root/audio/wildmidi/Makefile
blob: 9b388c38bef772c0b9f2ec3c4ff0abc509a4f144 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# $FreeBSD$

PORTNAME=	wildmidi
PORTVERSION=	0.4.0
DISTVERSIONPREFIX=	${PORTNAME}-
CATEGORIES=	audio

MAINTAINER=	liangtai.s16@gmail.com
COMMENT=	Simple software midi player and core softsynth library

# player: GPLv3, library: LGPL3
LICENSE=	LGPL3

USE_GITHUB=	yes
GH_ACCOUNT=	Mindwerks

USES=		gmake cmake:outsource
USE_LDCONFIG=	yes

OPTIONS_SUB=	yes
OPTIONS_RADIO=	BACKEND
OPTIONS_RADIO_BACKEND=	ALSA OPENAL OSS
OPTIONS_DEFINE=	PLAYER PLAYERSTATIC STATIC
OPTIONS_DEFAULT=	ALSA PLAYER

STATIC_CMAKE_ON=	-DWANT_STATIC:BOOL=ON
STATIC_CMAKE_OFF=	-DWANT_STATIC:BOOL=OFF

PLAYER_DESC=	Simple player
PLAYERSTATIC_DESC=	Simple player using STATIC libWildMidi
BACKEND_DESC=	Sound system PLAYER and PLAYERSTATIC use
PLAYER_CMAKE_ON=	-DWANT_PLAYER:BOOL=ON
PLAYER_CMAKE_OFF=	-DWANT_PLAYER:BOOL=OFF
PLAYERSTATIC_CMAKE_ON=	-DWANT_PLAYERSTATIC:BOOL=ON
PLAYERSTATIC_CMAKE_OFF=	-DWANT_PLAYERSTATIC:BOOL=OFF
PLAYERSTATIC_IMPLIES=	STATIC
ALSA_CMAKE_ON=	-DWANT_ALSA:BOOL=ON
ALSA_CMAKE_OFF=	-DWANT_ALSA:BOOL=OFF
OPENAL_CMAKE_ON=	-DWANT_OPENAL:BOOL=ON
OPENAL_CMAKE_OFF=	-DWANT_OPENAL:BOOL=OFF
OSS_CMAKE_ON=	-DWANT_OSS:BOOL=ON
OSS_CMAKE_OFF=	-DWANT_OSS:BOOL=OFF

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MPLAYER} || ${PORT_OPTIONS:MPLAYERSTATIC}
LICENSE+=	GPLv3
LICENSE_COMB=	multi
.  if ${PORT_OPTIONS:MOPENAL}
USES+=	openal:al
.  elif ${PORT_OPTIONS:MALSA}
LIB_DEPENDS+=	libasound.so:audio/alsa-lib
.  endif
.endif

post-patch:
	@${GREP} -L ${LOCALBASE} ${WRKSRC}/cfg/wildmidi.cfg | ${XARGS} \
		${REINPLACE_CMD} -e "/^dir \/usr\/share\//{" \
		-e "s|/usr/share/midi/freepats|${LOCALBASE}/share/freepats|;" \
		-e "h; x; s|^|# |; s|freepats|guspat|; H; s|guspat|eawpats|; H;" \
		-e "s|eawpats|eawplus|; H; x;}"
	@${GREP} -L ${LOCALBASE} ${WRKSRC}/docs/man/man1/wildmidi.1 \
		${WRKSRC}/docs/man/man5/wildmidi.cfg.5 \
		${WRKSRC}/CMakeLists.txt | ${XARGS} \
		${REINPLACE_CMD} -e 's@/etc/wildmidi/@${DATADIR}/@' \
		-e 's@/etc/@${DATADIR}/@'
	@${GREP} -l share/man ${WRKSRC}/src/CMakeLists.txt | ${XARGS} \
		${REINPLACE_CMD} '/INSTALL/s@share/man@man@'

pre-install:
	@${RM} ${WRKSRC}/docs/man/man1/wildmidi.1${REINPLACE_ARGS:S/-i//} \
		${WRKSRC}/docs/man/man5/wildmidi.cfg.5${REINPLACE_ARGS:S/-i//}
	${MKDIR} ${STAGEDIR}${DATADIR} ; \
	${CP} ${WRKSRC}/cfg/wildmidi.cfg ${STAGEDIR}${DATADIR}/wildmidi.cfg.sample

.include <bsd.port.mk>