aboutsummaryrefslogtreecommitdiffstats
path: root/audio/calf/Makefile
blob: 07f39da7207670311d8e9418c80abc5bb857e4a6 (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
77
78
# Created by: <trasz@FreeBSD.org>
# $FreeBSD$

PORTNAME=   calf
PORTVERSION=    0.0.19
PORTREVISION=   2
CATEGORIES= audio
MASTER_SITES=   SF

MAINTAINER= ports@FreeBSD.org
COMMENT=    Audio plug-in pack for LV2 and JACK environments

LICENSE=    GPLv2 LGPL21
LICENSE_COMB=   multi

BUILD_DEPENDS=  fftw3>0:${PORTSDIR}/math/fftw3
LIB_DEPENDS=    libfluidsynth.so:${PORTSDIR}/audio/fluidsynth \
        libjack.so:${PORTSDIR}/audio/jack \
        libfftw3f.so:${PORTSDIR}/math/fftw3-float \
        libexpat.so:${PORTSDIR}/textproc/expat2

USES=       gmake pkgconfig libtool
USE_GNOME=  gtk20
GNU_CONFIGURE=  yes
INSTALLS_ICONS= yes

CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib

OPTIONS_DEFINE=     LASH LV2 DOCS
OPTIONS_DEFAULT=    LASH LV2
OPTIONS_SUB=        yes

LASH_LIB_DEPENDS=   liblash.so:${PORTSDIR}/audio/lash
LASH_CONFIGURE_WITH=    lash
LV2_DESC=       LV2 audio plugin
LV2_BUILD_DEPENDS=  lv2core>0:${PORTSDIR}/audio/lv2core
LV2_RUN_DEPENDS=    lv2core>0:${PORTSDIR}/audio/lv2core
LV2_CONFIGURE_WITH= lv2

.include <bsd.port.options.mk>

post-patch:
    @${FIND} ${BUILD_WRKSRC} -name '*.cpp' | ${XARGS} ${REINPLACE_CMD} -e \
        's|<malloc.h>|<stdlib.h>|'
    @${REINPLACE_CMD} -e \
        '/CXXFLAGS/s|-O3|| ; \
         /CXXFLAGS/s|-finline-functions-called-once||' \
        ${WRKSRC}/configure
    @${REINPLACE_CMD} -e \
        '/AM_CXXFLAGS/s|-finline-limit=80|| ; \
         /calf.so/s|$$(pkglibdir)|../../calf|' \
        ${WRKSRC}/src/Makefile.in
    @${REINPLACE_CMD} -e \
        's|src\.size();|src->size();|' \
        ${WRKSRC}/src/calf/buffer.h
    @${REINPLACE_CMD} -e \
        's|data\[(1<<IntBits)+1\]|data[]|' \
        ${WRKSRC}/src/calf/fixed_point.h

pre-build:
.if ${PORT_OPTIONS:MLV2}
    @${MKDIR} ${WRKDIR}/calfmakerdf
    @(cd ${WRKSRC} && ${PAX} -rw . ${WRKDIR}/calfmakerdf)
    @${REINPLACE_CMD} -e 's|\(PKGLIBDIR\).*|\1 "${STAGEDIR}${DATADIR}"|' \
        ${WRKDIR}/calfmakerdf/config.h
    @(cd ${WRKDIR}/calfmakerdf/src && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
        ${MAKE_FLAGS} ${MAKEFILE} -j${MAKE_JOBS_NUMBER} ${MAKE_ARGS} \
        calfmakerdf)
.endif

post-install:
.if ${PORT_OPTIONS:MLV2}
    @(cd ${WRKDIR}/calfmakerdf/src && ./calfmakerdf -m ttl \
        -p ${STAGEDIR}${PREFIX}/lib/lv2/calf.lv2)
.endif

.include <bsd.port.mk>