/[gentoo-x86]/app-emulation/wine/wine-1.7.20-r1.ebuild
Gentoo

Contents of /app-emulation/wine/wine-1.7.20-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Jul 11 07:54:37 2015 UTC (3 years, 9 months ago) by np-hardass
Branch: MAIN
CVS Tags: HEAD
Fixes bugs #548100, #539830, #543446, update to new multilib dependency code, and unify ebuild code/build system

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 18F89C67)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="5"
6
7 AUTOTOOLS_AUTORECONF=1
8 PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
9 PLOCALE_BACKUP="en"
10
11 inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
12
13 if [[ ${PV} == "9999" ]] ; then
14 EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
15 EGIT_BRANCH="master"
16 inherit git-r3
17 SRC_URI=""
18 #KEYWORDS=""
19 else
20 MY_P="${PN}-${PV/_/-}"
21 SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
22 KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
23 S=${WORKDIR}/${MY_P}
24 fi
25
26 GV="2.24"
27 MV="4.5.2"
28 STAGING_P="wine-staging-${PV}"
29 STAGING_DIR="${WORKDIR}/${STAGING_P}"
30 WINE_GENTOO="wine-gentoo-2015.03.07"
31 PULSE_PATCHES="winepulse-patches-1.7.20"
32 DESCRIPTION="Free implementation of Windows(tm) on Unix"
33 HOMEPAGE="http://www.winehq.org/"
34 SRC_URI="${SRC_URI}
35 gecko? (
36 abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
37 abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
38 )
39 mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
40 pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
41 http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
42
43 if [[ ${PV} == "9999" ]] ; then
44 STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
45 else
46 SRC_URI="${SRC_URI}
47 staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
48 fi
49
50 LICENSE="LGPL-2.1"
51 SLOT="0"
52 IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl staging test +threads +truetype +udisks v4l +X +xcomposite xinerama +xml"
53 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
54 test? ( abi_x86_32 )
55 elibc_glibc? ( threads )
56 gstreamer? ( pulseaudio )
57 mono? ( abi_x86_32 )
58 pipelight? ( staging )
59 osmesa? ( opengl )" #286560
60 # winepulse patches needed for gstreamer due to http://bugs.winehq.org/show_bug.cgi?id=30557
61
62 # FIXME: the test suite is unsuitable for us; many tests require net access
63 # or fail due to Xvfb's opengl limitations.
64 RESTRICT="test"
65
66 COMMON_DEPEND="
67 truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
68 capi? ( net-dialup/capi4k-utils )
69 ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
70 udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
71 fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
72 gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
73 openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
74 gstreamer? (
75 media-libs/gstreamer:0.10[${MULTILIB_USEDEP}]
76 media-libs/gst-plugins-base:0.10[${MULTILIB_USEDEP}]
77 )
78 X? (
79 x11-libs/libXcursor[${MULTILIB_USEDEP}]
80 x11-libs/libXext[${MULTILIB_USEDEP}]
81 x11-libs/libXrandr[${MULTILIB_USEDEP}]
82 x11-libs/libXi[${MULTILIB_USEDEP}]
83 x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
84 )
85 xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
86 alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
87 cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
88 opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
89 opengl? (
90 virtual/glu[${MULTILIB_USEDEP}]
91 virtual/opengl[${MULTILIB_USEDEP}]
92 )
93 gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
94 jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
95 ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
96 lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
97 mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
98 netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
99 nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
100 odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
101 osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
102 pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
103 staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
104 xml? (
105 dev-libs/libxml2[${MULTILIB_USEDEP}]
106 dev-libs/libxslt[${MULTILIB_USEDEP}]
107 )
108 scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
109 ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
110 png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
111 v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
112 xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
113 abi_x86_32? (
114 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
115 !<app-emulation/emul-linux-x86-baselibs-20140508-r14
116 !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
117 !<app-emulation/emul-linux-x86-db-20140508-r3
118 !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
119 !<app-emulation/emul-linux-x86-medialibs-20140508-r6
120 !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
121 !<app-emulation/emul-linux-x86-opengl-20140508-r1
122 !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
123 !<app-emulation/emul-linux-x86-sdl-20140508-r1
124 !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
125 !<app-emulation/emul-linux-x86-soundlibs-20140508
126 !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
127 !<app-emulation/emul-linux-x86-xlibs-20140508
128 )"
129
130 RDEPEND="${COMMON_DEPEND}
131 dos? ( games-emulation/dosbox )
132 perl? ( dev-lang/perl dev-perl/XML-Simple )
133 samba? ( >=net-fs/samba-3.0.25 )
134 selinux? ( sec-policy/selinux-wine )
135 udisks? ( sys-fs/udisks:2 )
136 pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
137
138 # tools/make_requests requires perl
139 DEPEND="${COMMON_DEPEND}
140 staging? ( dev-lang/perl dev-perl/XML-Simple )
141 X? (
142 x11-proto/inputproto
143 x11-proto/xextproto
144 x11-proto/xf86vidmodeproto
145 )
146 xinerama? ( x11-proto/xineramaproto )
147 prelink? ( sys-devel/prelink )
148 >=sys-kernel/linux-headers-2.6
149 virtual/pkgconfig
150 virtual/yacc
151 sys-devel/flex"
152
153 # These use a non-standard "Wine" category, which is provided by
154 # /etc/xdg/applications-merged/wine.menu
155 QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
156 usr/share/applications/wine-notepad.desktop
157 usr/share/applications/wine-uninstaller.desktop
158 usr/share/applications/wine-winecfg.desktop"
159
160 wine_build_environment_check() {
161 [[ ${MERGE_TYPE} = "binary" ]] && return 0
162
163 # bug #549768
164 if [[ $(gcc-major-version) = 5 ]]; then
165 eerror "You need gcc-4.x to build wine; see https://bugs.gentoo.org/549768"
166 eerror
167 return 1
168 fi
169
170 if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
171 eerror "You need gcc-4.4+ to build 64-bit wine"
172 eerror
173 return 1
174 fi
175
176 if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
177 eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
178 eerror "See https://bugs.gentoo.org/487864 for more details."
179 eerror
180 return 1
181 fi
182 }
183
184 pkg_pretend() {
185 wine_build_environment_check || die
186 }
187
188 pkg_setup() {
189 wine_build_environment_check || die
190 }
191
192 src_unpack() {
193 if [[ ${PV} == "9999" ]] ; then
194 git-r3_src_unpack
195 if use staging; then
196 EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
197 unset ${PN}_LIVE_REPO;
198 EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
199 fi
200 else
201 unpack ${MY_P}.tar.bz2
202 use staging && unpack "${STAGING_P}.tar.gz"
203 fi
204
205 use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
206 if use staging; then
207 # we use a separate pulseaudio patchset
208 rm -r "${STAGING_DIR}/patches/06-winepulse" || die
209 # ... and need special tools for binary patches
210 mv "${STAGING_DIR}/patches/10-Missing_Fonts" "${T}" || die
211 if ! use pipelight; then
212 rm -r "${STAGING_DIR}/patches/97-Pipelight" || die
213 fi
214 fi
215 unpack "${WINE_GENTOO}.tar.bz2"
216
217 l10n_find_plocales_changes "${S}/po" "" ".po"
218 }
219
220 src_prepare() {
221 local md5="$(md5sum server/protocol.def)"
222 local f
223 local PATCHES=(
224 "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
225 "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
226 "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
227 "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
228 )
229 use pulseaudio && PATCHES+=(
230 "../${PULSE_PATCHES}"/*.patch #421365
231 )
232 if use staging; then
233 ewarn "Applying the unofficial Wine-Staging patchset which is unsupported"
234 ewarn "by Wine developers. Please don't report bugs to Wine bugzilla"
235 ewarn "unless you can reproduce them with USE=-staging"
236
237 PATCHES+=(
238 "${FILESDIR}/wine-1.7.19-makefile-race-cond.patch"
239 "${STAGING_DIR}/patches"/*/*.patch #507950
240 "${STAGING_DIR}/patches/patch-list.patch"
241 )
242 # epatch doesn't support binary patches
243 ebegin "Applying Staging font patches"
244 for f in "${T}/10-Missing_Fonts"/*.patch; do
245 "${STAGING_DIR}/debian/tools/gitapply.sh" < "${f}" || die "Failed to apply Compholio font patches"
246 done
247 eend
248 fi
249 autotools-utils_src_prepare
250
251 # Modification of the server protocol requires regenerating the server requests
252 if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
253 einfo "server/protocol.def was patched; running tools/make_requests"
254 tools/make_requests || die #432348
255 fi
256 sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
257 if ! use run-exes; then
258 sed -i '/^MimeType/d' tools/wine.desktop || die #117785
259 fi
260
261 # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
262 cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
263
264 l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
265 }
266
267 src_configure() {
268 export LDCONFIG=/bin/true
269 use custom-cflags || strip-flags
270
271 multilib-minimal_src_configure
272 }
273
274 multilib_src_configure() {
275 local myconf=(
276 --sysconfdir=/etc/wine
277 $(use_with alsa)
278 $(use_with capi)
279 $(use_with lcms cms)
280 $(use_with cups)
281 $(use_with ncurses curses)
282 $(use_with udisks dbus)
283 $(use_with fontconfig)
284 $(use_with ssl gnutls)
285 $(use_enable gecko mshtml)
286 $(use_with gphoto2 gphoto)
287 $(use_with gsm)
288 $(use_with gstreamer)
289 --without-hal
290 $(use_with jpeg)
291 $(use_with ldap)
292 $(use_enable mono mscoree)
293 $(use_with mp3 mpg123)
294 $(use_with netapi)
295 $(use_with nls gettext)
296 $(use_with openal)
297 $(use_with opencl)
298 $(use_with opengl)
299 $(use_with osmesa)
300 $(use_with oss)
301 $(use_with png)
302 $(use_with threads pthread)
303 $(use_with scanner sane)
304 $(use_enable test tests)
305 $(use_with truetype freetype)
306 $(use_with v4l)
307 $(use_with X x)
308 $(use_with xcomposite)
309 $(use_with xinerama)
310 $(use_with xml)
311 $(use_with xml xslt)
312 )
313
314 use pulseaudio && myconf+=( --with-pulse )
315 use staging && myconf+=( --with-xattr )
316
317 local PKG_CONFIG AR RANLIB
318 # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
319 # set AR and RANLIB to make QA scripts happy; #483342
320 tc-export PKG_CONFIG AR RANLIB
321
322 if use amd64; then
323 if [[ ${ABI} == amd64 ]]; then
324 myconf+=( --enable-win64 )
325 else
326 myconf+=( --disable-win64 )
327 fi
328
329 # Note: using --with-wine64 results in problems with multilib.eclass
330 # CC/LD hackery. We're using separate tools instead.
331 fi
332
333 ECONF_SOURCE=${S} \
334 econf "${myconf[@]}"
335 emake depend
336 }
337
338 multilib_src_test() {
339 # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
340 if [[ ${ABI} == x86 ]]; then
341 if [[ $(id -u) == 0 ]]; then
342 ewarn "Skipping tests since they cannot be run under the root user."
343 ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
344 return
345 fi
346
347 WINEPREFIX="${T}/.wine-${ABI}" \
348 Xemake test
349 fi
350 }
351
352 multilib_src_install_all() {
353 local DOCS=( ANNOUNCE AUTHORS README )
354 local l
355 add_locale_docs() {
356 local locale_doc="documentation/README.$1"
357 [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
358 }
359 l10n_for_each_locale_do add_locale_docs
360
361 einstalldocs
362 prune_libtool_files --all
363
364 emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
365 if use gecko ; then
366 insinto /usr/share/wine/gecko
367 use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
368 use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
369 fi
370 if use mono ; then
371 insinto /usr/share/wine/mono
372 doins "${DISTDIR}"/wine-mono-${MV}.msi
373 fi
374 if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
375 rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
376 fi
377
378 use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
379 use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
380
381 if use abi_x86_64 && ! use abi_x86_32; then
382 dosym /usr/bin/wine{64,} # 404331
383 dosym /usr/bin/wine{64,}-preloader
384 fi
385
386 # respect LINGUAS when installing man pages, #469418
387 for l in de fr pl; do
388 use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
389 done
390 }
391
392 pkg_preinst() {
393 gnome2_icon_savelist
394 }
395
396 pkg_postinst() {
397 gnome2_icon_cache_update
398 fdo-mime_desktop_database_update
399
400 if ! use gecko; then
401 ewarn "Without Wine Gecko, wine prefixes will not have a default"
402 ewarn "implementation of iexplore. Many older windows applications"
403 ewarn "rely upon the existence of an iexplore implementation, so"
404 ewarn "you will likely need to install an external one, like via winetricks"
405 fi
406 if ! use mono; then
407 ewarn "Without Wine Mono, wine prefixes will not have a default"
408 ewarn "implementation of .NET. Many windows applications rely upon"
409 ewarn "the existence of a .NET implementation, so you will likely need"
410 ewarn "to install an external one, like via winetricks"
411 fi
412 }
413
414 pkg_postrm() {
415 gnome2_icon_cache_update
416 fdo-mime_desktop_database_update
417 }

  ViewVC Help
Powered by ViewVC 1.1.20