summaryrefslogtreecommitdiffstats
path: root/audio/mma/Makefile
blob: d27fab0233c53fb504e3e3157b661d7a1a971fcd (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
# Created by: Nicola Vitale <nivit@FreeBSD.org>
# $FreeBSD$

PORTNAME=	mma
PORTVERSION=	15.01
PORTREVISION=	0
CATEGORIES=	audio
MASTER_SITES=	http://www.mellowood.ca/${PORTNAME}/
DISTFILES=	${PORTNAME}-bin-${PORTVERSION}.tar.gz

MAINTAINER=	nivit@FreeBSD.org
COMMENT=	Musical MIDI Accompaniment generator

LICENSE=	GPLv2

RUN_DEPENDS=	aplaymidi:${PORTSDIR}/audio/alsa-utils \
		timidity:${PORTSDIR}/audio/timidity++

MMABIN=	${PREFIX}/bin/mma

OPTIONS_DEFINE=	DOCS EXAMPLES

REINPLACE_ARGS=	-i.bak -E -e 's,/usr(/bin/(aplaymidi|arecord|timidity)),${LOCALBASE}\1,g'

SHEBANG_FILES=	mma.py
SUB_FILES=	mma_g.py
SUB_LIST=	PYTHON_CMD=${PYTHON_CMD}

USES=		python shebangfix

WRKDOC=	${WRKDIR}/${PORTNAME}-pdf-${DISTVERSION:S,a,,}
WRKSRC=	${WRKDIR}/${PORTNAME}-bin-${DISTVERSION}

python_OLD_CMD=	/usr/bin/env python

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOCS}
DISTFILES+=	${PORTNAME}-pdf-${DISTVERSION:S,a,,}.tar.gz
.endif

post-patch:
	@(cd ${WRKSRC} && \
	${REINPLACE_CMD} mma-splitrec util/mma-splitrec.py)

do-build:
	@${PYTHON_CMD} -O -m compileall -f ${WRKSRC}/MMA
	@${PYTHON_CMD} -OO -m compileall -f ${WRKSRC}/MMA

do-install:
	@${MKDIR} ${STAGEDIR}${DATADIR}
	${INSTALL_SCRIPT} ${WRKSRC}/mma.py ${STAGEDIR}${MMABIN}
	cd ${WRKSRC} && ${COPYTREE_SHARE} "lib includes MMA" ${STAGEDIR}${DATADIR} "-not -name *\.bak"
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	(cd ${WRKSRC}/egs && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
	@${MKDIR} ${STAGEDIR}${DOCSDIR}/pdf
	(cd ${WRKDOC} && \
	${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/pdf/ "! -name README")
	(cd ${WRKSRC}/docs/html && \
	${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/html)
	(cd ${WRKSRC}/docs/man && \
	${COPYTREE_SHARE} . ${STAGEDIR}${MANPREFIX}/man/man1/ "! -name mma-libdoc.8" && \
	${INSTALL_MAN} mma-libdoc.8 ${STAGEDIR}${MANPREFIX}/man/man8/)

post-install:
	# update mma library (mma -g) to use ${DATADIR} path
	@(cd ${STAGEDIR}${DATADIR} && \
	${PYTHON_CMD} ${WRKDIR}/mma_g.py)

.include <bsd.port.mk>
OpenPOWER on IntegriCloud