aboutsummaryrefslogtreecommitdiff
path: root/audio/cmus/Makefile
blob: ce90a4184f5a691331604ca8830f8de49ff748bf (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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
PORTNAME=	cmus
DISTVERSIONPREFIX=	v
DISTVERSION=	2.10.0
PORTREVISION=	8
CATEGORIES=	audio

PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES+=	7d3116962bd8.patch:-p1 # https://github.com/cmus/cmus/pull/1221
PATCHFILES+=	07ce2dc7082a.patch:-p1 # https://github.com/cmus/cmus/pull/1254
PATCHFILES+=	0e07ddc14234.patch:-p1 # https://github.com/cmus/cmus/pull/1269

MAINTAINER=	eduardo@FreeBSD.org
COMMENT=	Console-based music player with really cool features
WWW=		https://cmus.github.io/

LICENSE=	GPLv2+
LICENSE_FILE=	${WRKSRC}/COPYING

USES=		compiler:c11 cpe gmake iconv ncurses pkgconfig
USE_GITHUB=	yes

HAS_CONFIGURE=	yes
CONFIGURE_ARGS=	prefix=${PREFIX} mandir=${PREFIX}/share/man \
		exampledir=${EXAMPLESDIR}
# So the build does not use gcc for compiling ttman
CONFIGURE_ARGS+=	HOSTCC=${CC}

# Verbose build makes it easier to spot problems
MAKE_ARGS=	ICONV_CFLAGS="-I${ICONV_INCLUDE_PATH}" \
		ICONV_LIBS="-L${ICONV_PREFIX}/lib ${ICONV_LIB}" \
		V=2

# Disable all configure options first.  These will be overwritten by
# enabled port options later.  The args to cmus' configure script
# follow shell value semantics i.e. later assignments overwrite
# previous assignments.  The options here appear in the same order as
# ${WRKSRC}/configure --help.  Please keep it that way.
_CMUS_CONFIGURE_OPTS=	AAC ALSA AO ARTS CDDB CDIO COREAUDIO CUE DISCID	\
	FFMPEG FLAC JACK MAD MIKMOD BASS MODPLUG MP4 MPC MPRIS OPUS OSS	\
	PULSE ROAR SAMPLERATE SNDIO SUN TREMOR VORBIS VTX WAVEOUT	\
	WAVPACK WAV
.for opt in ${_CMUS_CONFIGURE_OPTS}
CONFIGURE_ARGS+=	CONFIG_${opt}=n
.endfor

# AAC, FLAC, MP4, OPUS, VORBIS and WAV handled by FFMPEG
# MPRIS (BASU) error:	https://github.com/cmus/cmus/issues/1124
#			https://github.com/cmus/cmus/issues/609

OPTIONS_DEFINE=		BASU EXAMPLES
OPTIONS_DEFAULT=	BASU FFMPEG MODPLUG OSS SNDIO
OPTIONS_SUB=	yes

OPTIONS_GROUP=	OUT IN
OPTIONS_GROUP_OUT=	AO JACK OSS PULSEAUDIO SNDIO
OPTIONS_GROUP_IN=	AAC CDDB CDIO CUE DISCID FFMPEG FLAC MAD MIKMOD	\
			MODPLUG MP4 MUSEPACK OPUS SAMPLERATE TREMOR	\
			VORBIS WAV WAVPACK

BASU_DESC=	MPRIS protocol support via basu
DISCID_DESC=	libdiscid CDDA identification support
IN_DESC=	Input plugins
OUT_DESC=	Output plugins

AAC_CONFIGURE_ON=	CONFIG_AAC=y
AAC_LIB_DEPENDS=	libfaad.so:audio/faad

AO_CONFIGURE_ON=	CONFIG_AO=y
AO_LIB_DEPENDS=	libao.so:audio/libao

BASU_CONFIGURE_ON=	CONFIG_MPRIS=y
BASU_LIB_DEPENDS=	libbasu.so:devel/basu

CDDB_CONFIGURE_ON=	CONFIG_CDDB=y
CDDB_LIB_DEPENDS=	libcddb.so:audio/libcddb

CDIO_CONFIGURE_ON=	CONFIG_CDIO=y
CDIO_LIB_DEPENDS=	libcdio_cdda.so:sysutils/libcdio-paranoia \
			libcdio.so:sysutils/libcdio

CUE_CONFIGURE_ON=	CONFIG_CUE=y
CUE_LIB_DEPENDS=	libcue.so:textproc/libcue

DISCID_CONFIGURE_ON=	CONFIG_DISCID=y
DISCID_LIB_DEPENDS=	libdiscid.so:audio/libdiscid

FFMPEG_LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
FFMPEG_CONFIGURE_ON=	CONFIG_FFMPEG=y

FLAC_CONFIGURE_ON=	CONFIG_FLAC=y
FLAC_LIB_DEPENDS=	libFLAC.so:audio/flac

JACK_CONFIGURE_ON=	CONFIG_JACK=y
JACK_LIB_DEPENDS=	libjack.so:audio/jack

MAD_CONFIGURE_ON=	CONFIG_MAD=y
MAD_LIB_DEPENDS=	libmad.so:audio/libmad

MIKMOD_CONFIGURE_ON=	CONFIG_MIKMOD=y
MIKMOD_LIB_DEPENDS=	libmikmod.so:audio/libmikmod

MODPLUG_CONFIGURE_ON=	CONFIG_MODPLUG=y
MODPLUG_LIB_DEPENDS=	libmodplug.so:audio/libmodplug

MP4_CONFIGURE_ON=	CONFIG_MP4=y
MP4_LIB_DEPENDS=	libfaad.so:audio/faad \
			libmp4v2.so:multimedia/mp4v2

MUSEPACK_CONFIGURE_ON=	CONFIG_MPC=y
MUSEPACK_LIB_DEPENDS=	libmpcdec.so:audio/musepack

OPUS_CONFIGURE_ON=	CONFIG_OPUS=y
OPUS_LIB_DEPENDS=	libopusfile.so:audio/opusfile

OSS_CONFIGURE_ON=	CONFIG_OSS=y

PULSEAUDIO_CONFIGURE_ON=	CONFIG_PULSE=y
PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio

# Requires a port of RoarAudio
#ROAR_CONFIGURE_ON=	CONFIG_ROAR=y
#ROAR_LIB_DEPENDS=	????:????

SAMPLERATE_IMPLIES=	JACK
SAMPLERATE_CONFIGURE_ON=	CONFIG_SAMPLERATE=y
SAMPLERATE_LIB_DEPENDS=	libsamplerate.so:audio/libsamplerate

SNDIO_CONFIGURE_ON=	CONFIG_SNDIO=y
SNDIO_LIB_DEPENDS=	libsndio.so:audio/sndio

TREMOR_IMPLIES=	VORBIS
TREMOR_CONFIGURE_ON=	CONFIG_TREMOR=y
TREMOR_LIB_DEPENDS=	libvorbisidec.so:audio/libtremor

VORBIS_CONFIGURE_ON=	CONFIG_VORBIS=y
VORBIS_LIB_DEPENDS=	libvorbisfile.so:audio/libvorbis

# VTX requires libayemu which isn't ported yet
#VTX_CONFIGURE_ON=	CONFIG_VTX=y
#VTX_LIB_DEPENDS=	libayemu.so:?????

WAV_CONFIGURE_ON=	CONFIG_WAV=y

WAVPACK_CONFIGURE_ON=	CONFIG_WAVPACK=y
WAVPACK_LIB_DEPENDS=	libwavpack.so:audio/wavpack

post-patch:
# Doc/cmus.txt is used to generate the man pages.  Fix paths to point
# to the correct directories.
	@${REINPLACE_CMD} \
		-e 's,/usr/share/doc/cmus/examples,${EXAMPLESDIR},g' \
		-e 's,/usr/share/cmus,${DATADIR},g' \
		${WRKSRC}/Doc/cmus.txt

post-configure:
# Prevent passing wrong flags from devel/ncurses' pkg-config file to the build
	@${REINPLACE_CMD} -e 's|-D_POSIX_C_SOURCE=200112L||g; s|-D_XOPEN_SOURCE=600||g' \
		${WRKSRC}/config.mk

post-install:
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/cmus*
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/cmus/[io]p/*.so
# Install bash and zsh completion files
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d
	${INSTALL_DATA} ${WRKSRC}/contrib/cmus.bash-completion \
		${STAGEDIR}${PREFIX}/etc/bash_completion.d/_cmus.bash
	${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions
	${INSTALL_DATA} ${WRKSRC}/contrib/_cmus \
		${STAGEDIR}${PREFIX}/share/zsh/site-functions/_cmus

.include <bsd.port.mk>