aboutsummaryrefslogtreecommitdiffstats
path: root/audio/portaudio/Makefile
blob: bc5417ba480f6b6f4996c68881367f96b2449217 (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
# Created by: michaelnottebrock@gmx.net and lioux@FreeBSD.org
# $FreeBSD$

PORTNAME=   portaudio
PORTVERSION=    18.1
PORTREVISION=   3
CATEGORIES= audio
MASTER_SITES=   http://www.portaudio.com/archives/
DISTNAME=   ${PORTNAME}_v${PORTVERSION:S/./_/}

MAINTAINER= nemysis@gmx.ch
COMMENT=    Portable cross-platform Audio API

LICENSE=    MIT

USES=       gmake
USE_ZIP=    yes
GNU_CONFIGURE=  yes
USE_DOS2UNIX=   yes
USE_LDCONFIG=   yes

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

PLIST_SUB+= SHLIB_VERSION=${SHLIB_VERSION}
SHLIB_VERSION=  0

PORTDOCS=   *

DOCSRCDIR1= ${WRKSRC}
DOC_FILES1= README.txt index.html

DOCSRCDIR2= ${WRKSRC}/docs
DOCSDIR2=   ${DOCSDIR}/docs
DOC_FILES2= *.html *.txt *.pdf

OPTIONS_DEFINE=     PATEST
OPTIONS_DEFAULT=    PATEST

PATEST_DESC=    PortAudio Test Programs

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MPATEST}
PLIST_SUB+= PATEST=""
.else
PLIST_SUB+= PATEST="@comment "
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|#include <malloc.h>|#include <stdlib.h>|' ${WRKSRC}/pa_unix_oss/pa_unix.h
    @${REINPLACE_CMD} -e 's|machine/soundcard.h|sys/soundcard.h|' ${WRKSRC}/pa_unix_oss/pa_unix_oss.c
    @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure ${WRKSRC}/configure.in \
        ${WRKSRC}/pa_unix_oss/Makefile

pre-configure:
    @${CHMOD} +x ${WRKSRC}/configure

post-install:
    @${LN} -sf libportaudio.so \
        ${PREFIX}/lib/libportaudio.so.${SHLIB_VERSION}
.if ${PORT_OPTIONS:MPATEST}
    ${INSTALL_SCRIPT} ${WRKSRC}/bin/* ${PREFIX}/bin
.endif
.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${DOC_FILES1:S|^|${DOCSRCDIR1}/|} ${DOCSDIR}
    ${MKDIR} ${DOCSDIR2}
    ${INSTALL_DATA} ${DOC_FILES2:S|^|${DOCSRCDIR2}/|} ${DOCSDIR2}
.endif

.include <bsd.port.mk>