summaryrefslogtreecommitdiff
path: root/audio/zynaddsubfx/Makefile
blob: ce846daa06c121a78c5ef778b6ec8f4bd5dd08b0 (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# New ports collection makefile for:	zynaddsubfx
# Date created:		2007-01-25
# Whom:			trasz <trasz@pin.if.uz.zgora.pl>
#
# $FreeBSD$
#

PORTNAME=	zynaddsubfx
PORTVERSION=	2.4.1
PORTREVISION=	1
CATEGORIES=	audio
MASTER_SITES=	SF
DISTNAME=	ZynAddSubFX-${PORTVERSION}

MAINTAINER=	mva@FreeBSD.org
COMMENT=	A realtime software synthesizer

LIB_DEPENDS=	dssialsacompat.0:${PORTSDIR}/audio/libdssialsacompat \
		fftw3:${PORTSDIR}/math/fftw3 \
		expat.6:${PORTSDIR}/textproc/expat2
BUILD_DEPENDS=	${LOCALBASE}/include/mxml.h:${PORTSDIR}/textproc/mxml

WRKSRC=		${WRKDIR}/${DISTNAME}/src

USE_BZIP2=	yes
USE_GMAKE=	yes
CXXFLAGS+=	-I${LOCALBASE}/include
MAKE_JOBS_UNSAFE=	yes

OPTIONS=	ALSAMIDI	"Enable midi input through ALSA" off \
		GUI		"Enable graphical front-end" on \
		JACK		"Enable sound output through JackAudio" off \
		PORTAUDIO	"Enable sound output through PortAudio" off

.include <bsd.port.pre.mk>

.if defined(WITH_ALSAMIDI)
LIB_DEPENDS+=	asound.2:${PORTSDIR}/audio/alsa-lib
.endif

.if (defined(WITH_JACK) && defined(WITH_PORTAUDIO))
BROKEN=		only one output type can be chosen
.endif

.if defined(WITH_JACK)
LIB_DEPENDS+=	jack.0:${PORTSDIR}/audio/jack
.endif

.if defined(WITH_PORTAUDIO)
LIB_DEPENDS+=	portaudio.0:${PORTSDIR}/audio/portaudio
.endif

.if !defined(WITHOUT_GUI)
LIB_DEPENDS+=	fltk.1:${PORTSDIR}/x11-toolkits/fltk
.endif

.if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
BROKEN=		Does not compile on ia64, powerpc, or sparc64: invokes i386 asm
.endif

post-patch:
	${REINPLACE_CMD} -e \
		's|CXXFLAGS= -O2 -Wall -g -fPIC|CXXFLAGS=${CXXFLAGS}|g' \
		${WRKSRC}/Makefile
	${REINPLACE_CMD} -e \
		's|LIBS= -lm  -lmxml -lz|LIBS= -lm  -lmxml -lz -L${LOCALBASE}/lib|g' \
		${WRKSRC}/Makefile

.if !defined(WITH_ALSAMIDI)
	${REINPLACE_CMD} -e 's|LINUX_MIDIIN=ALSA|LINUX_MIDIIN=OSS|g' \
		${WRKSRC}/Makefile.inc
.endif
.if defined(WITH_JACK)
	${REINPLACE_CMD} -e 's|LINUX_AUDIOOUT=OSS|LINUX_AUDIOOUT=OSS_AND_JACK|g' \
		${WRKSRC}/Makefile.inc
.endif
.if defined(WITH_PORTAUDIO)
	${REINPLACE_CMD} -e 's|LINUX_AUDIOOUT=OSS|LINUX_AUDIOOUT=PA|g' \
		${WRKSRC}/Makefile.inc
.endif
.if defined(WITHOUT_GUI)
	${REINPLACE_CMD} -e 's|DISABLE_GUI=NO|DISABLE_GUI=YES|g' \
		${WRKSRC}/Makefile.inc
.endif

do-install:
		${INSTALL_PROGRAM} ${WRKSRC}/zynaddsubfx ${PREFIX}/bin
		${MKDIR} ${DATADIR}
		${MKDIR} ${DATADIR}/banks
		cd ${WRKDIR}/${DISTNAME}/banks && ${FIND} . -type d -exec ${MKDIR} ${DATADIR}/banks/{} \;
		cd ${WRKDIR}/${DISTNAME}/banks && ${FIND} . -type f \
			-exec ${INSTALL_DATA} {} ${DATADIR}/banks/{} \;

.include <bsd.port.post.mk>