aboutsummaryrefslogtreecommitdiff
path: root/audio/picard-plugins/Makefile
blob: a9a8eb39ab3ca25bf49acbbc7238b8d179a5cc89 (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
# $FreeBSD$

PORTNAME=	picard-plugins
PORTVERSION=	2.0.20200605
CATEGORIES=	audio python

MAINTAINER=	jhale@FreeBSD.org
COMMENT=	Plugins for Picard tagger

LICENSE=	GPLv2+ GPLv3+ MIT WTFPL
LICENSE_COMB=	multi

USES=		python:3.5+

USE_GITHUB=	yes
GH_ACCOUNT=	metabrainz
GH_TAGNAME=	d8137c5

PORTSCOUT=	limit:^2\.

NO_ARCH=	yes
SUB_FILES=	pkg-message
SUB_LIST=	GCC_VER=${GCC_DEFAULT:S/.//}

BUILD_WRKSRC=	${WRKSRC}/build
PLUGINSDIR=	${PYTHON_SITELIBDIR}/picard/plugins

OPTIONS_DEFINE=		ALBUM_COLUMN BPM MOODBAR
OPTIONS_GROUP=		REPLAYGAIN
OPTIONS_GROUP_REPLAYGAIN=	FLAC MP3 VORBIS WAVPACK
OPTIONS_SUB=		yes

ALBUM_COLUMN_DESC=	Adds album column to main window (can't be disabled)

BPM_DESC=		Beats per minute
BPM_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}aubio>=0.4.5:audio/py-aubio@${PY_FLAVOR}

MOODBAR_DESC=		Generate moodbar files
MOODBAR_RUN_DEPENDS=	moodbar:audio/moodbar

REPLAYGAIN_DESC=	ReplayGain audio normalization
FLAC_RUN_DEPENDS=	metaflac:audio/flac
MP3_RUN_DEPENDS=	mp3gain:audio/mp3gain
VORBIS_RUN_DEPENDS=	vorbisgain:audio/vorbisgain
WAVPACK_RUN_DEPENDS=	wvgain:audio/wavpack

do-build:
# Plugins that include a separate UI (those with an __init__.py) must
# be installed into their own subdirectories under PLUGINSDIR. Plugins
# written as a single .py file must be installed directly in PLUGINSDIR.
# We copy them into the correct hierarchy and compile them here.
	@${MKDIR} ${BUILD_WRKSRC}
	@(cd ${WRKSRC}/plugins; \
	   for dir in *; \
	   do \
	      if [ -f $${dir}/__init__.py ]; \
		 then ${CP} -R $${dir} ${BUILD_WRKSRC}; \
		 else ${CP} -R $${dir}/* ${BUILD_WRKSRC}; \
	      fi; \
	   done;)
	${FIND} ${BUILD_WRKSRC} -type f \( -name '.*' -o -name '*.bak' -o -name '*.orig' \) -exec ${RM} {} \;
	${PYTHON_CMD} -m compileall ${BUILD_WRKSRC}
	${PYTHON_CMD} -O -m compileall ${BUILD_WRKSRC}

do-install:
	@${MKDIR} ${STAGEDIR}${PLUGINSDIR}
	(cd ${BUILD_WRKSRC}; ${COPYTREE_SHARE} . ${STAGEDIR}${PLUGINSDIR})

post-install-ALBUM_COLUMN-off:
	@${RM} -r ${STAGEDIR}${PLUGINSDIR}/add_album_column

post-install-BPM-off:
	@${RM} -r ${STAGEDIR}${PLUGINSDIR}/bpm

.include <bsd.port.mk>