aboutsummaryrefslogtreecommitdiffstats
path: root/audio/xmp/Makefile
blob: 941f6226640afca7f5aaf7d14a2a6f30dc427fb2 (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# $FreeBSD$

PORTNAME=   xmp
PORTVERSION=    3.5.0
PORTEPOCH=  1
CATEGORIES= audio
MASTER_SITES=   SF

MAINTAINER= ehaupt@FreeBSD.org
COMMENT=    A player for many different Amiga and PC module formats

LICENSE=    GPLv2

USE_GMAKE=  yes
WANT_GNOME= yes
GNU_CONFIGURE=  yes
CONFIGURE_ENV=  LIBS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc --disable-arts \
        --disable-audacious-plugin

MAN1=       xmp.1

OPTIONS_DEFINE= ALSA BMP ESOUND NAS PULSEAUDIO UNZIP XMMS

BMP_DESC=   Beep media player plugin
XMMS_DESC=  XMMS plugin

OPTIONS_DEFAULT=UNZIP

MAKE_JOBS_SAFE= yes

CFLAGS+=    -I${LOCALBASE}/include

.include <bsd.port.options.mk>

.if !defined(NOPORTDOCS)
PORTDOCS=   *
.endif

.if ${PORT_OPTIONS:MALSA}
LIB_DEPENDS+=   asound:${PORTSDIR}/audio/alsa-lib
RUN_DEPENDS+=   ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:${PORTSDIR}/audio/alsa-plugins
CONFIGURE_ARGS+=    --enable-alsa
.else
CONFIGURE_ARGS+=    --disable-alsa
.endif

.if ${PORT_OPTIONS:MBMP}
LIB_DEPENDS+=   beep:${PORTSDIR}/multimedia/beep-media-player
CONFIGURE_ARGS+=    --enable-bmp-plugin
PLIST_SUB+= BMP=""
.else
CONFIGURE_ARGS+=    --disable-bmp-plugin
PLIST_SUB+= BMP="@comment "
.endif

.if ${PORT_OPTIONS:MESOUND}
USE_GNOME+= esound
CONFIGURE_ARGS+=    --enable-esd
.else
CONFIGURE_ARGS+=    --disable-esd
.endif

.if ${PORT_OPTIONS:MNAS}
LIB_DEPENDS+=   audio:${PORTSDIR}/audio/nas
CONFIGURE_ARGS+=    --enable-nas
.else
CONFIGURE_ARGS+=    --disable-nas
.endif

.if ${PORT_OPTIONS:MPULSEAUDIO}
LIB_DEPENDS+=   pulse-simple:${PORTSDIR}/audio/pulseaudio
CONFIGURE_ARGS+=    --enable-pulseaudio
.else
CONFIGURE_ARGS+=    --disable-pulseaudio
.endif

.if ${PORT_OPTIONS:MUNZIP}
RUN_DEPENDS+=   ${LOCALBASE}/bin/unzip:${PORTSDIR}/archivers/unzip
.else
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-src-misc-load.c
.endif

.if ${PORT_OPTIONS:MXMMS}
LIB_DEPENDS+=   xmms:${PORTSDIR}/multimedia/xmms
CONFIGURE_ARGS+=    --enable-xmms-plugin
PLIST_SUB+= XMMS=""
.else
CONFIGURE_ARGS+=    --disable-xmms-plugin
PLIST_SUB+= XMMS="@comment "
.endif

post-patch: .SILENT
.for f in docs/xmp.1 etc/xmp.conf etc/modules.conf
    ${REINPLACE_CMD} -e "s|/etc/xmp|${ETCDIR}|g" ${WRKSRC}/${f}
.endfor
    ${REINPLACE_CMD} -e \
        '/$$(INSTALL_DATA)/s|\([[:alnum:]]*\.conf\).*$$|&\1.sample|' \
        ${WRKSRC}/etc/Makefile
    @${REINPLACE_CMD} -e \
        's|-Wno-unknown-warning-option -Wno-unused-but-set-variable||' \
        ${WRKSRC}/configure

post-install:   .SILENT
    if  [ ! -f ${ETCDIR}/${PORTNAME}.conf ]; then \
        ${INSTALL_DATA} ${ETCDIR}/${PORTNAME}.conf.sample \
            ${ETCDIR}/${PORTNAME}.conf; \
    fi
    if [ ! -f ${ETCDIR}/modules.conf ]; then \
        ${INSTALL_DATA} ${ETCDIR}/modules.conf.sample \
            ${ETCDIR}/modules.conf; \
    fi

.if !defined(NOPORTDOCS)
    ${ECHO_MSG} Installing documentation in ${DOCSDIR}
    ( cd ${WRKSRC}/docs && ${COPYTREE_SHARE} \* \
        ${DOCSDIR} '! ( -name Makefile -or -name xmp.1 \
        -or -name *.bak -or -name *.orig )' )
.endif

.include <bsd.port.mk>