summaryrefslogtreecommitdiffstats
path: root/audio/ocp/Makefile
blob: cb1c66fc5159c9226e316d1d91880f0d30b1285c (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
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
# New ports collection makefile for:	ocp
# Date created:				22 April 2005
# Whom:					Emanuel Haupt <ehaupt@critical.ch>
#
# $FreeBSD$
#

PORTNAME=	ocp
PORTVERSION=	0.1.13
CATEGORIES=	audio
MASTER_SITES=	http://stian.lunafish.org/ocp/ \
		http://critical.ch/distfiles/ \
		http://energy.critical.ch/distfiles/
DISTNAME=	${PORTNAME}-${DISTVERSION:C/\.rc/_rc/}

MAINTAINER=	ehaupt@FreeBSD.org
COMMENT=	The legendary Open Cubic Player

LIB_DEPENDS=	id3tag.0:${PORTSDIR}/audio/libid3tag \
		mad.2:${PORTSDIR}/audio/libmad \
		vorbis.3:${PORTSDIR}/audio/libvorbis

ONLY_FOR_ARCHS=	i386

GNU_CONFIGURE=	yes
USE_GMAKE=	yes
USE_GCC=	3.4+
USE_LDCONFIG=	yes

CPPFLAGS+=	-I${LOCALBASE}/include -I${X11BASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib -L${X11BASE}/lib
CFLAGS+=	-L${LOCALBASE}/lib -L${X11BASE}/lib
CXXFLAGS+=	-L${LOCALBASE}/lib -L${X11BASE}/lib

CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ENV=	CFLAGS="${CFLAGS} ${CPPFLAGS}" \
		CXXFLAGS="${CXXFLAGS} ${CPPFLAGS}" \
		CPPFLAGS="${CPPFLAGS}" \
		LDFLAGS="${LDFLAGS}"

CONFIGURE_ARGS=	--with-dir-suffix="" \
		--libdir=${LOCALBASE}/lib

TIMIDITY_CFG=	${LOCALBASE}/share/timidity/timidity.cfg

.include <bsd.port.pre.mk>

.if ${OSVERSION} > 500000
LIB_DEPENDS+=	sidplay.1:${PORTSDIR}/audio/libsidplay
PLIST_SUB+=	LIBSIDPLAY=""
.else
PLIST_SUB+=	LIBSIDPLAY="@comment "
.endif

.if exists(${TIMIDITY_CFG}) || !defined(WITHOUT_MIDI)
RUN_DEPENDS+=	${TIMIDITY_CFG}:${PORTSDIR}/audio/eawpats
.endif

.if defined(WITHOUT_X11)
CONFIGURE_ARGS+=	--without-x11
.else
USE_XLIB=	yes
CONFIGURE_ARGS+=	--with-x11=yes
.endif
.if defined(WITH_DEBUG)
CONFIGURE_ARGS+=	--with-debug
.endif
.if defined(WITH_ADPLUG) && ${OSVERSION} > 500000
LIB_DEPENDS+=		adplug-2.0.1.0:${PORTSDIR}/audio/libadplug
CONFIGURE_ARGS+=	--without-x11 --with-adplug
PLIST_SUB+=		ADPLUG=""
.else
PLIST_SUB+=		ADPLUG="@comment "
CONFIGURE_ARGS+=	--without-adplug
.endif

pre-everything::
.if !exists(${TIMIDITY_CFG}) && !defined(WITHOUT_MIDI)
	@${ECHO_MSG} ""
	@${ECHO_MSG} "In order to be able to play MIDI files, audio/eawpats will be installed."
	@${ECHO_MSG} "Define WITHOUT_MIDI if you do not want to install it."
	@${ECHO_MSG} ""
.endif
.if !defined(WITHOUT_X11) && !defined(WITH_ADPLUG)
	@${ECHO_MSG} ""
	@${ECHO_MSG} "If you want to compile without X11 support, hit Ctrl-C right now and"
	@${ECHO_MSG} "define WITHOUT_X11"
	@${ECHO_MSG} ""
.endif

# Hangs on exit
.if defined(WITH_ADPLUG) && !defined(WITHOUT_X11)
	@${ECHO_MSG} ""
	@${ECHO_MSG} "Disabling X11 support. X11 and libadplug usage cannot yet peacefully"
	@${ECHO_MSG} "coexist."
	@${ECHO_MSG} ""
.endif

post-patch:
.if defined(WITH_DEBUG)
	@${REINPLACE_CMD} -e 's|/\*\ \(#define\ LD_DEBUG\ 1\)\ \*/|\1|' \
		${WRKSRC}/config.h.in
.endif
	@${REINPLACE_CMD} -e 's|stdint\.h|inttypes\.h|' ${WRKSRC}/types.h
	@${REINPLACE_CMD} -e 's|/etc/.*\.cfg|${TIMIDITY_CFG}|' \
		${WRKSRC}/playgmi/gmitimidity.c
# conflicts with fnmatch.h from security/heimdal
	@${REINPLACE_CMD} -e 's|<\(fnmatch.h\)>|"/usr/include/\1"|' \
		${WRKSRC}/filesel/adb.c \
		${WRKSRC}/filesel/pfilesel.c

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/ocp ${PREFIX}/bin

	${MKDIR} ${DATADIR}
	${INSTALL_DATA} ${WRKSRC}/ocp.pak ${DATADIR}

	${INSTALL_DATA} ${WRKSRC}/ocp.ini ${PREFIX}/etc/ocp.ini.default
.if !exists(${PREFIX}/etc/ocp.ini)
	${INSTALL_DATA} ${WRKSRC}/ocp.ini ${PREFIX}/etc
.endif

	${MKDIR} ${PREFIX}/lib/ocp
	${INSTALL_DATA} ${WRKSRC}/*.so ${PREFIX}/lib/ocp

.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.for f in AUTHORS BUGS CREDITS Changelog KEYBOARD_REMAPS SUID TODO
	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
.endfor
.endif

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