blob: ff6de1e72e7f348dc1999695d9f555ab528972c1 (
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
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
|
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/xmms-plugin.eclass,v 1.1 2004/10/19 23:02:31 eradicator Exp $
#
# Jeremy Huddleston <eradicator@gentoo.org>
#
# Usage:
# Source Code:
# You have multiple methods with which to specify how we get the source code
# for the patckages.
#
# (1) - Separate tarballs
# If your package provides separate tarballs for the xmms and bmp plugins,
# then specify them in the XMMS_SRC_URI and BMP_SRC_URI variables.
# XMMS_SRC_URI="xmms-plugin.tar.bz2"
# BMP_SRC_URI="bmp-plugin.tar.bz2"
# BASE_SRC_URI="common-stuff.tar.bz2"
#
# (2) - xmms->bmp patch
# If you have a patch to turn an xmms plugin into a bmp plugin, specify it
# in the variable XMMS2BMP_PATCH:
# XMMS2BMP_PATCH="${FILESDIR}/${P}-xmms2bmp.patch"
#
# (3) - automated
# The eclass will try to do some sedage to get the plugin to work with bmp.
#
# Common patches:
# If you have patches that need to apply to both xmms and bmp sources,
# Place them in the PATCHES variable:
# PATCHES="${FILESDIR}/${P}-gcc34.patch ${FILESDIR}/${P}-config.patch"
#
# Source Location:
# By default, we assume a ${S} of ${XMMS_S} or ${BMP_S} for the two packages.
# These default to ${XMMS_WORKDIR}/${P} or ${BMP_WORKDIR}/${P}.
# ${XMMS_WORKDIR} and ${BMP_WORKDIR}/${P} default to ${WORKDIR}/xmms and
# ${WORKDIR}/bmp. You may override ${*_S}, but not the ${*_WORKDIR}.
#
# Documentation:
# Set the DOCS variable to contain the documentation to be dodocd:
# DOCS="ChangeLog AUTHORS README"
inherit eutils libtool gnuconfig
ECLASS=xmms-plugin
INHERITED="${INHERITED} ${ECLASS}"
IUSE="${IUSE} xmms bmp"
DEPEND="bmp? ( >=media-sound/beep-media-player-0.9.7_rc2-r2 )
xmms? ( media-sound/xmms )"
XMMS_WORKDIR="${WORKDIR}/xmms"
BMP_WORKDIR="${WORKDIR}/bmp"
# We don't use ${S}
S="${WORKDIR}"
if [ -z "${XMMS_S}" ]; then
XMMS_S="${XMMS_WORKDIR}/${P}"
fi
if [ -z "${BMP_S}" ]; then
BMP_S="${BMP_WORKDIR}/${P}"
fi
if [ -n "${BMP_SRC_URI}" -a -n "${XMMS_SRC_URI}" ]; then
SRC_URI="${BASE_SRC_URI}
bmp? ( ${BMP_SRC_URI} )
xmms? ( ${XMMS_SRC_URI} )"
fi
xmms-plugin_src_unpack() {
use xmms && mkdir ${XMMS_WORKDIR}
use bmp && mkdir ${BMP_WORKDIR}
if [ -n "${BMP_SRC_URI}" -a -n "${XMMS_SRC_URI}" ]; then
if use xmms; then
cd ${XMMS_WORKDIR}
for f in ${XMMS_SRC_URI} ${BASE_SRC_URI}; do
unpack ${f}
done
fi
if use bmp; then
cd ${BMP_WORKDIR}
for f in ${BMP_SRC_URI} ${BASE_SRC_URI}; do
unpack ${f}
done
fi
else
if use xmms; then
cd ${XMMS_WORKDIR}
unpack ${A}
fi
if use bmp; then
cd ${BMP_WORKDIR}
unpack ${A}
if [ -n "${XMMS2BMP_PATCH}" ]; then
cd ${BMP_S}
epatch ${XMMS2BMP_PATCH}
else
cd ${BMP_S}
xmms2bmp_automate
fi
fi
fi
if [ -n "${PATCHES}" ]; then
if use xmms; then
cd ${XMMS_S}
epatch ${PATCHES}
fi
if use bmp; then
cd ${BMP_S}
epatch ${PATCHES}
fi
fi
if use xmms; then
cd ${XMMS_S}
S="${XMMS_S}"
elibtoolize
gnuconfig_update
fi
if use bmp; then
cd ${BMP_S}
S="${BMP_S}"
elibtoolize
gnuconfig_update
fi
}
xmms-plugin_src_compile() {
myconf="${myconf} --disable-static"
if use xmms; then
cd ${XMMS_S}
econf ${myconf} ${xmms_myconf} || die
emake || die
fi
if use bmp; then
cd ${BMP_S}
export FAKE_XMMS_VERSION=1.2.10
econf ${myconf} ${bmp_myconf}|| die
emake || die
fi
}
xmms-plugin_src_install() {
if use xmms; then
cd ${XMMS_S}
make DESTDIR="${D}" install || die
fi
if use bmp; then
cd ${BMP_S}
make DESTDIR="${D}" install || die
fi
if [ -n "${DOCS}" ]; then
dodoc ${DOCS}
fi
}
xmms2bmp_automate() {
find . -name Makefile -o -name Makefile.in -o -name configure |
xargs sed -i -e 's:xmms-config:beep-config:g' \
-e 's:libdir)/xmms:libdir)/bmp:g'
}
EXPORT_FUNCTIONS src_unpack src_compile src_install
|