1 |
# Copyright 1999-2013 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-1.5.7.ebuild,v 1.7 2013/02/06 05:51:38 tetromino Exp $ |
4 |
|
5 |
EAPI="5" |
6 |
|
7 |
inherit autotools eutils flag-o-matic multilib pax-utils |
8 |
|
9 |
if [[ ${PV} == "9999" ]] ; then |
10 |
EGIT_REPO_URI="git://source.winehq.org/git/wine.git" |
11 |
inherit git-2 |
12 |
SRC_URI="" |
13 |
#KEYWORDS="" |
14 |
else |
15 |
MY_P="${PN}-${PV/_/-}" |
16 |
SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2" |
17 |
KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" |
18 |
S=${WORKDIR}/${MY_P} |
19 |
fi |
20 |
|
21 |
GV="1.6" |
22 |
MV="0.0.4" |
23 |
PULSE_PATCH="winepulse-2012.06.15.patch" |
24 |
DESCRIPTION="Free implementation of Windows(tm) on Unix" |
25 |
HOMEPAGE="http://www.winehq.org/" |
26 |
SRC_URI="${SRC_URI} |
27 |
gecko? ( |
28 |
mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi |
29 |
win64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi ) |
30 |
) |
31 |
mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi ) |
32 |
http://source.winehq.org/patches/data/87234 -> ${PULSE_PATCH}" |
33 |
|
34 |
LICENSE="LGPL-2.1" |
35 |
SLOT="0" |
36 |
IUSE="alsa capi cups custom-cflags elibc_glibc fontconfig +gecko gnutls gphoto2 gsm gstreamer jpeg lcms ldap +mono mp3 ncurses nls odbc openal opencl +opengl +oss +perl png +prelink pulseaudio samba scanner selinux ssl test +threads +truetype udisks v4l +win32 +win64 +X xcomposite xinerama xml" |
37 |
REQUIRED_USE="elibc_glibc? ( threads ) |
38 |
mono? ( || ( win32 !win64 ) )" #286560 |
39 |
RESTRICT="test" #72375 |
40 |
|
41 |
MLIB_DEPS="amd64? ( |
42 |
truetype? ( >=app-emulation/emul-linux-x86-xlibs-2.1 ) |
43 |
X? ( |
44 |
>=app-emulation/emul-linux-x86-xlibs-2.1 |
45 |
>=app-emulation/emul-linux-x86-soundlibs-2.1 |
46 |
) |
47 |
mp3? ( app-emulation/emul-linux-x86-soundlibs ) |
48 |
odbc? ( app-emulation/emul-linux-x86-db ) |
49 |
openal? ( app-emulation/emul-linux-x86-sdl ) |
50 |
opengl? ( app-emulation/emul-linux-x86-opengl ) |
51 |
scanner? ( app-emulation/emul-linux-x86-medialibs ) |
52 |
v4l? ( app-emulation/emul-linux-x86-medialibs ) |
53 |
app-emulation/emul-linux-x86-baselibs |
54 |
>=sys-kernel/linux-headers-2.6 |
55 |
)" |
56 |
RDEPEND="truetype? ( >=media-libs/freetype-2.0.0 media-fonts/corefonts ) |
57 |
perl? ( dev-lang/perl dev-perl/XML-Simple ) |
58 |
capi? ( net-dialup/capi4k-utils ) |
59 |
ncurses? ( >=sys-libs/ncurses-5.2:= ) |
60 |
fontconfig? ( media-libs/fontconfig:= ) |
61 |
gphoto2? ( media-libs/libgphoto2:= ) |
62 |
openal? ( media-libs/openal:= ) |
63 |
udisks? ( |
64 |
sys-apps/dbus |
65 |
sys-fs/udisks:2 |
66 |
) |
67 |
gnutls? ( net-libs/gnutls:= ) |
68 |
gstreamer? ( media-libs/gstreamer:0.10 media-libs/gst-plugins-base:0.10 ) |
69 |
X? ( |
70 |
x11-libs/libXcursor |
71 |
x11-libs/libXrandr |
72 |
x11-libs/libXi |
73 |
x11-libs/libXmu |
74 |
x11-libs/libXxf86vm |
75 |
) |
76 |
xinerama? ( x11-libs/libXinerama ) |
77 |
alsa? ( media-libs/alsa-lib ) |
78 |
cups? ( net-print/cups:= ) |
79 |
opencl? ( virtual/opencl ) |
80 |
opengl? ( |
81 |
virtual/glu |
82 |
virtual/opengl |
83 |
) |
84 |
gsm? ( media-sound/gsm:= ) |
85 |
jpeg? ( virtual/jpeg:= ) |
86 |
ldap? ( net-nds/openldap:= ) |
87 |
lcms? ( media-libs/lcms:0= ) |
88 |
mp3? ( >=media-sound/mpg123-1.5.0 ) |
89 |
nls? ( sys-devel/gettext ) |
90 |
odbc? ( dev-db/unixODBC:= ) |
91 |
pulseaudio? ( media-sound/pulseaudio ) |
92 |
samba? ( >=net-fs/samba-3.0.25 ) |
93 |
selinux? ( sec-policy/selinux-wine ) |
94 |
xml? ( dev-libs/libxml2 dev-libs/libxslt ) |
95 |
scanner? ( media-gfx/sane-backends:= ) |
96 |
ssl? ( dev-libs/openssl:0= ) |
97 |
png? ( media-libs/libpng:0= ) |
98 |
v4l? ( media-libs/libv4l ) |
99 |
!win64? ( ${MLIB_DEPS} ) |
100 |
win32? ( ${MLIB_DEPS} ) |
101 |
xcomposite? ( x11-libs/libXcomposite )" |
102 |
DEPEND="${RDEPEND} |
103 |
X? ( |
104 |
x11-proto/inputproto |
105 |
x11-proto/xextproto |
106 |
x11-proto/xf86vidmodeproto |
107 |
) |
108 |
xinerama? ( x11-proto/xineramaproto ) |
109 |
prelink? ( sys-devel/prelink ) |
110 |
virtual/pkgconfig |
111 |
virtual/yacc |
112 |
sys-devel/flex" |
113 |
|
114 |
src_unpack() { |
115 |
if use win64 ; then |
116 |
[[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]] \ |
117 |
&& die "you need gcc-4.4+ to build 64bit wine" |
118 |
fi |
119 |
|
120 |
if use win32 && use opencl; then |
121 |
[[ x$(eselect opencl show) = "xintel" ]] && |
122 |
die "Cannot build wine[opencl,win32]: intel-ocl-sdk is 64-bit only" # 403947 |
123 |
fi |
124 |
|
125 |
if [[ ${PV} == "9999" ]] ; then |
126 |
git-2_src_unpack |
127 |
else |
128 |
unpack ${MY_P}.tar.bz2 |
129 |
fi |
130 |
} |
131 |
|
132 |
src_prepare() { |
133 |
local md5="$(md5sum server/protocol.def)" |
134 |
epatch "${FILESDIR}"/${PN}-1.1.15-winegcc.patch #260726 |
135 |
epatch "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615 |
136 |
epatch "${DISTDIR}/${PULSE_PATCH}" #421365 |
137 |
epatch_user #282735 |
138 |
if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then |
139 |
einfo "server/protocol.def was patched; running tools/make_requests" |
140 |
tools/make_requests || die #432348 |
141 |
fi |
142 |
eautoreconf |
143 |
sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die |
144 |
sed -i '/^MimeType/d' tools/wine.desktop || die #117785 |
145 |
} |
146 |
|
147 |
do_configure() { |
148 |
local builddir="${WORKDIR}/wine$1" |
149 |
mkdir -p "${builddir}" |
150 |
pushd "${builddir}" >/dev/null |
151 |
|
152 |
ECONF_SOURCE=${S} \ |
153 |
econf \ |
154 |
--sysconfdir=/etc/wine \ |
155 |
$(use_with alsa) \ |
156 |
$(use_with capi) \ |
157 |
$(use_with lcms cms) \ |
158 |
$(use_with cups) \ |
159 |
$(use_with ncurses curses) \ |
160 |
$(use_with udisks dbus) \ |
161 |
$(use_with fontconfig) \ |
162 |
$(use_with gnutls) \ |
163 |
$(use_with gphoto2 gphoto) \ |
164 |
$(use_with gsm) \ |
165 |
$(use_with gstreamer) \ |
166 |
--without-hal \ |
167 |
$(use_with jpeg) \ |
168 |
$(use_with ldap) \ |
169 |
$(use_with mp3 mpg123) \ |
170 |
$(use_with nls gettext) \ |
171 |
$(use_with openal) \ |
172 |
$(use_with opencl) \ |
173 |
$(use_with opengl) \ |
174 |
$(use_with ssl openssl) \ |
175 |
$(use_with oss) \ |
176 |
$(use_with png) \ |
177 |
$(use_with threads pthread) \ |
178 |
$(use_with pulseaudio pulse) \ |
179 |
$(use_with scanner sane) \ |
180 |
$(use_enable test tests) \ |
181 |
$(use_with truetype freetype) \ |
182 |
$(use_with v4l) \ |
183 |
$(use_with X x) \ |
184 |
$(use_with xcomposite) \ |
185 |
$(use_with xinerama) \ |
186 |
$(use_with xml) \ |
187 |
$(use_with xml xslt) \ |
188 |
$2 |
189 |
|
190 |
emake -j1 depend |
191 |
|
192 |
popd >/dev/null |
193 |
} |
194 |
|
195 |
src_configure() { |
196 |
export LDCONFIG=/bin/true |
197 |
use custom-cflags || strip-flags |
198 |
|
199 |
if use win64 ; then |
200 |
do_configure 64 --enable-win64 |
201 |
use win32 && ABI=x86 do_configure 32 --with-wine64=../wine64 |
202 |
else |
203 |
ABI=x86 do_configure 32 --disable-win64 |
204 |
fi |
205 |
} |
206 |
|
207 |
src_compile() { |
208 |
local b |
209 |
for b in 64 32 ; do |
210 |
local builddir="${WORKDIR}/wine${b}" |
211 |
[[ -d ${builddir} ]] || continue |
212 |
emake -C "${builddir}" all |
213 |
done |
214 |
} |
215 |
|
216 |
src_install() { |
217 |
local b |
218 |
for b in 64 32 ; do |
219 |
local builddir="${WORKDIR}/wine${b}" |
220 |
[[ -d ${builddir} ]] || continue |
221 |
emake -C "${builddir}" install DESTDIR="${D}" |
222 |
done |
223 |
dodoc ANNOUNCE AUTHORS README |
224 |
if use gecko ; then |
225 |
insinto /usr/share/wine/gecko |
226 |
doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi |
227 |
use win64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi |
228 |
fi |
229 |
if use mono ; then |
230 |
insinto /usr/share/wine/mono |
231 |
doins "${DISTDIR}"/wine-mono-${MV}.msi |
232 |
fi |
233 |
if ! use perl ; then |
234 |
rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die |
235 |
fi |
236 |
|
237 |
if use win32 || ! use win64; then |
238 |
pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055 |
239 |
fi |
240 |
use win64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader} |
241 |
|
242 |
if use win64 && ! use win32; then |
243 |
dosym /usr/bin/wine{64,} # 404331 |
244 |
dosym /usr/bin/wine{64,}-preloader |
245 |
fi |
246 |
} |