summaryrefslogtreecommitdiff
path: root/audio/jamulus/Makefile
blob: c19a0c99203c27455bfc8e06815944828dd32a70 (plain)
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

PORTNAME=	jamulus
DISTVERSIONPREFIX=	r
DISTVERSION=	3_7_0
PORTREVISION=	3
CATEGORIES=	audio

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Internet jam session software

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libjack.so:audio/jack

FLAVORS=	desktop server
FLAVOR?=	${FLAVORS:[1]}
server_PKGNAMESUFFIX=	-server

USES=		compiler:c++11-lang gl pkgconfig qmake qt:5
USE_QT=		concurrent core network xml buildtools_build linguisttools_build
USE_GL=		gl

USE_GITHUB=	yes
GH_ACCOUNT=	jamulussoftware

.if ${FLAVOR:U} == desktop
USE_QT+=	gui widgets
PLIST_FILES=	bin/${PORTNAME} \
		share/applications/${PORTNAME}.desktop \
		share/applications/${PORTNAME}-server.desktop \
		share/pixmaps/${PORTNAME}.png \
		share/pixmaps/${PORTNAME}-server.png
.endif

.if ${FLAVOR:U} == server
COMMENT+=	(headless server)
QMAKE_ARGS=	CONFIG+="headless nosound"
USER=		nobody
SUB_LIST=	USER=${USER}
USE_RC_SUBR=	${PORTNAME}-server
PLIST_FILES=	bin/${PORTNAME}-server
.endif

QMAKE_ARGS+=	CONFIG+="noupcasename"

PORTSCOUT=	limit:^r\d+_ # prevent malformatted tags, like 'latest'

.if ${FLAVOR:U} == desktop
post-install:
	# workaround for https://gitlab.xfce.org/xfce/xfdesktop/-/issues/131
	${MV} ${STAGEDIR}${PREFIX}/share/icons/hicolor/512x512/apps/jamulus.png ${STAGEDIR}${PREFIX}/share/pixmaps/
	${RM} -r ${STAGEDIR}${PREFIX}/share/icons
	# add Jamulus Server menu item which is simply 'jamulus -s' with a special icon
	${CP} ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}.desktop ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}-server.desktop
	${REINPLACE_CMD} -i '' ' \
		s|Name=Jamulus|Name=Jamulus Server| ; \
		s|Comment=Jam Session|Comment=Jam Session Server| ; \
		s|Exec=jamulus|Exec=jamulus -s| ; \
		s|Icon=jamulus|Icon=jamulus-server| ; \
		' ${STAGEDIR}${PREFIX}/share/applications/${PORTNAME}-server.desktop
	${INSTALL_DATA} ${WRKSRC}/src/res/fronticonserver.png ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}-server.png
.endif

.if ${FLAVOR:U} == server
post-install:
	${MV} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-server
.endif

.include <bsd.port.mk>