summaryrefslogtreecommitdiff
path: root/audio/baresip/Makefile
blob: cb28968bc5dfefc48a4815055ef3a7b512af162f (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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
PORTNAME=	baresip
DISTVERSIONPREFIX=	v
DISTVERSION=	3.11.0
CATEGORIES=	audio

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Small SIP client
WWW=		https://github.com/baresip

LICENSE=	BSD3CLAUSE
LICENSE_FILE=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	re>=${PORTVERSION:R}:audio/re
RUN_DEPENDS:=	${BUILD_DEPENDS}

USES=		cmake pkgconfig ssl
USE_GITHUB=	yes
GH_ACCOUNT=	baresip

# FIXME values of the next 3 variables taken from source code Makefile
ABI_MAJOR=	15
ABI_AGE=	11
ABI_REV=	0
PLIST_SUB=	ABI_MAJOR=${ABI_MAJOR}
PLIST_SUB+=	ABI_AGE=${ABI_AGE} \
		ABI_REV=${ABI_REV}

OPTIONS_DEFINE=		ALSA AV1 AVCODEC AVFILTER AVFORMAT CTRL_DBUS DOCS \
			EXAMPLES G711 G722 G726 GST MQTT OPUS OPUS_MS PLC \
			PORTAUDIO PULSEAUDIO SDL SNAPSHOT SNDFILE SWSCALE V4L2 \
			VPX X11
OPTIONS_DEFAULT=	DOCS EXAMPLES
OPTIONS_SUB=		yes

ALSA_DESC=		ALSA audio driver
AV1_DESC=		AV1 Video Codec
AVCODEC_DESC=		Video codecs using libavcodec
AVFILTER_DESC=		Video filter using libavfilter
AVFORMAT_DESC=		libavformat media-source
CTRL_DBUS_DESC=		[broken] DBUS interface for baresip
G711_DESC=		G.711 audio codec
G722_DESC=		G.722 audio codec
G726_DESC=		G.726 audio codec
GST_DESC=		Gstreamer audio module
MQTT_DESC=		Message Queue Telemetry Transport (MQTT) client
OPUS_DESC=		Opus audio codec
OPUS_MS_DESC=		Opus Multistream audio codec
PLC_DESC=		Packet Loss Concealment
PORTAUDIO_DESC=		Portaudio audio driver
PULSEAUDIO_DESC=	Pulseaudio audio driver
SDL_DESC=		libSDL2 video output
SNAPSHOT_DESC=		Snapshot video module
SNDFILE_DESC=		sndfile wav dumper
SWSCALE_DESC=		Video filter for scaling and pixel conversion
V4L2_DESC=		Video4Linux2 module
VPX_DESC=		VP8/VP9 video codecs
X11_DESC=		X11 video output

MODULES_LIST:=	account;aubridge;auconv;aufile;auresamp;ausine
MODULES_LIST:=	$(MODULES_LIST);cons;contact;ctrl_tcp
MODULES_LIST:=	$(MODULES_LIST);debug_cmd;dtls_srtp
MODULES_LIST:=	$(MODULES_LIST);ebuacip;echo
MODULES_LIST:=	$(MODULES_LIST);fakevideo;httpd;httpreq;ice;l16
MODULES_LIST:=	$(MODULES_LIST);menu;mixausrc;mixminus;multicast;mwi;natpmp;netroam
MODULES_LIST:=	$(MODULES_LIST);pcp;presence;rtcpsummary
MODULES_LIST:=	$(MODULES_LIST);selfview;serreg;srtp;stdio;stun;syslog
MODULES_LIST:=	$(MODULES_LIST);turn;uuid;vidbridge;vidinfo;vumeter

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MALSA}
ALSA_DEPEND=	${LOCALBASE}/include/alsa/asoundlib.h:audio/alsa-lib
MODULES_LIST:=	$(MODULES_LIST);alsa
.endif

.if ${PORT_OPTIONS:MAV1}
LIB_DEPENDS+=	libaom.so:multimedia/aom
MODULES_LIST:=	$(MODULES_LIST);av1
.endif

.if ${PORT_OPTIONS:MAVCODEC}
AVCODEC_DEPEND=	${LOCALBASE}/include/libavcodec/avcodec.h:multimedia/ffmpeg \
		libdrm>0:graphics/libdrm
MODULES_LIST:=	$(MODULES_LIST);avcodec
.endif

.if ${PORT_OPTIONS:MAVFILTER}
AVFILTER_DEPEND=	${LOCALBASE}/include/libavfilter/avfilter.h:multimedia/ffmpeg
MODULES_LIST:=		$(MODULES_LIST);avfilter
.endif

.if ${PORT_OPTIONS:MAVFORMAT}
AVFORMAT_DEPEND=	${LOCALBASE}/include/libavformat/avformat.h:multimedia/ffmpeg
MODULES_LIST:=		$(MODULES_LIST);avformat
.endif

.if ${PORT_OPTIONS:MG711}
G711_DEPEND=	${LOCALBASE}/include/spandsp/g711.h:comms/spandsp
MODULES_LIST:=	$(MODULES_LIST);g711
.endif

.if ${PORT_OPTIONS:MG722}
G722_DEPEND=	${LOCALBASE}/include/spandsp/g722.h:comms/spandsp
MODULES_LIST:=	$(MODULES_LIST);g722
.endif

.if ${PORT_OPTIONS:MG726}
G726_DEPEND=	${LOCALBASE}/include/spandsp/g726.h:comms/spandsp
MODULES_LIST:=	$(MODULES_LIST);g726
.endif

.if ${PORT_OPTIONS:MGST}
GST_DEPEND=		${LOCALBASE}/include/gstreamer-1.0/gst/gst.h:multimedia/gstreamer1
PORT_OPTIONS+=		GSTREAMER
USES+=			gnome
USE_GNOME+=		glib20
USE_GSTREAMER1+=	yes
.endif

.if ${PORT_OPTIONS:MMQTT}
LIB_DEPENDS+=	libmosquitto.so:net/mosquitto
MODULES_LIST:=	$(MODULES_LIST);mqtt
.endif

.if ${PORT_OPTIONS:MOPUS}
OPUS_DEPEND=	${LOCALBASE}/include/opus/opus.h:audio/opus
MODULES_LIST:=	$(MODULES_LIST);opus
.endif

.if ${PORT_OPTIONS:MOPUS_MS}
OPUS_MS_DEPEND=	${LOCALBASE}/include/opus/opus.h:audio/opus
MODULES_LIST:=	$(MODULES_LIST);opus_multistream
.endif

.if ${PORT_OPTIONS:MPLC}
PLC_DEPEND=	${LOCALBASE}/include/spandsp/plc.h:comms/spandsp
MODULES_LIST:=	$(MODULES_LIST);plc
.endif

.if ${PORT_OPTIONS:MPORTAUDIO}
PORTAUDIO_DEPEND=	${LOCALBASE}/include/portaudio.h:audio/portaudio
MODULES_LIST:=		$(MODULES_LIST);portaudio
.endif

# Port calls it PULSE, standard OPTION is PULSEAUDIO
.if ${PORT_OPTIONS:MPULSEAUDIO}
PORT_OPTIONS+=		PULSE
PULSEAUDIO_DEPEND=	${LOCALBASE}/include/pulse/pulseaudio.h:audio/pulseaudio
MODULES_LIST:=		$(MODULES_LIST);pulse
.endif

.if ${PORT_OPTIONS:MSDL}
USES+=		sdl
USE_SDL=	sdl2
SDLDEPEND=	mesa-libs>0:graphics/mesa-libs
MODULES_LIST:=	$(MODULES_LIST);sdl
.endif

.if ${PORT_OPTIONS:MSNAPSHOT}
LIB_DEPENDS+=	libpng16.so:graphics/png
MODULES_LIST:=	$(MODULES_LIST);snapshot
.endif

.if ${PORT_OPTIONS:MSNDFILE}
SNDFILE_DEPEND=	${LOCALBASE}/include/sndfile.h:audio/libsndfile
MODULES_LIST:=	$(MODULES_LIST);sndfile
.endif

.if ${PORT_OPTIONS:MSWSCALE}
SWSCALE_DEPEND=	${LOCALBASE}/include/libavformat/avformat.h:multimedia/ffmpeg
MODULES_LIST:=	$(MODULES_LIST);swscale
.endif

.if ${PORT_OPTIONS:MV4L2}
V4L2_DEPEND=	${LOCALBASE}/include/libv4l2.h:multimedia/libv4l \
		v4l_compat>0:multimedia/v4l_compat

MODULES_LIST:=	$(MODULES_LIST);v4l2
.endif

.if ${PORT_OPTIONS:MVPX}
VPX_DEPEND=	${LOCALBASE}/include/vpx/vp8.h:multimedia/libvpx
MODULES_LIST:=	$(MODULES_LIST);vp8;vp9
.endif

.if ${PORT_OPTIONS:MX11}
USES+=		xorg
USE_XORG=	x11
USE_XORG+=	ice sm xext
MODULES_LIST:=	$(MODULES_LIST);x11
.endif

.for o in ${PORT_OPTIONS}
BUILD_DEPENDS+=	${$o_DEPEND}
RUN_DEPENDS+=	${$o_DEPEND}
.endfor

CMAKE_ARGS+=	-DMODULES="$(MODULES_LIST)" \
		-DRE_INCLUDE_DIR:STRING="${LOCALBASE}/include/re" \
		-DREM_INCLUDE_DIR:STRING="${LOCALBASE}/include/rem"

post-install:
	${MKDIR} ${STAGEDIR}${DOCSDIR} ${STAGEDIR}${EXAMPLESDIR}
	(cd ${WRKSRC}/docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
	${MV} ${STAGEDIR}${DOCSDIR}/examples/* ${STAGEDIR}${EXAMPLESDIR}
	${RMDIR} ${STAGEDIR}${DOCSDIR}/examples

.include <bsd.port.mk>