Gentoo Archives: gentoo-commits

From: Nick Sarnie <sarnex@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/wine:master commit in: app-emulation/wine-vanilla/
Date: Sun, 27 May 2018 16:47:02
Message-Id: 1527438169.264b73f0bb3066606baeb1266d47a7413907543b.sarnex@gentoo
1 commit: 264b73f0bb3066606baeb1266d47a7413907543b
2 Author: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 27 16:22:49 2018 +0000
4 Commit: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
5 CommitDate: Sun May 27 16:22:49 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/wine.git/commit/?id=264b73f0
7
8 app-emulation/wine-vanilla: Bump to 3.9
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 app-emulation/wine-vanilla/Manifest | 1 +
13 app-emulation/wine-vanilla/wine-vanilla-3.9.ebuild | 529 +++++++++++++++++++++
14 2 files changed, 530 insertions(+)
15
16 diff --git a/app-emulation/wine-vanilla/Manifest b/app-emulation/wine-vanilla/Manifest
17 index d8ced72..8a92b5b 100644
18 --- a/app-emulation/wine-vanilla/Manifest
19 +++ b/app-emulation/wine-vanilla/Manifest
20 @@ -36,3 +36,4 @@ DIST wine-3.5.tar.xz 19963436 BLAKE2B 83d7c0719a088f8c705f7a9d8a6df6b9ee5e0a5ffa
21 DIST wine-3.6.tar.xz 20005240 BLAKE2B 6dd48180b9aed8a3b69c40b3ed7b2ff5adbebfb591860dda6603d2219f9059bc069df000cd2614c80d34911c451388f0124af3dd8a11b806b227ca8e16659d71 SHA512 31d24cc78734bdb743afcec7df05b641ab0625568361401eaf8cd5e217719c8c51a0ef7ed737a560fe42cb9ecd88f10d35e62a98d9df69b966502a5b0dab5a22
22 DIST wine-3.7.tar.xz 20454036 BLAKE2B 04ac94d5679377c5d0bb37a6d3e8e3ec7c09faa300f8422a09a22b14ef4244d2bb14c80a47cfca5e11526506a8064f0cfa4e28868d7f04669f85ab743dbbb36d SHA512 a699418574dd8f407c064421cf6cdfe3923562c8adf9a7749e716f3853291eab05358ea64f0217c303c26c0f8f59d2116024b7b6978f9a52a055147e689a8694
23 DIST wine-3.8.tar.xz 20473392 BLAKE2B a7873dd15a373491703e16888044cf2ba00121f91a4583fe6dcf687b5179a2d926035cc86c75f70ceca03a508bd4712c58a1662186e0a6e0c139e63e686f8c5d SHA512 387c6bff3eafac7e92030d11c02b3461b4ead059d2aad7f6d903e176f304d2ac0a426132fcd452507868f0d22bb360a30734edf3e73dfd514037458f08406e98
24 +DIST wine-3.9.tar.xz 20508952 BLAKE2B 6fbf22673588963c483b7b31e82287c09e15b579b8f57267e2731768f95a1f986954bb473ee0dfa2428802fe9331b8599a01c782dd1152d36ce2002b6a4e6bde SHA512 4c4e5a741a61b9427c175e015177df5806638736f7dfd92098ed95239d41a373cbab876c054d3c948e1db6a7de359db3babd63bc194edc8c2c3be28b58f75e64
25
26 diff --git a/app-emulation/wine-vanilla/wine-vanilla-3.9.ebuild b/app-emulation/wine-vanilla/wine-vanilla-3.9.ebuild
27 new file mode 100644
28 index 0000000..9bebca2
29 --- /dev/null
30 +++ b/app-emulation/wine-vanilla/wine-vanilla-3.9.ebuild
31 @@ -0,0 +1,529 @@
32 +# Copyright 1999-2018 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=6
36 +
37 +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"
38 +PLOCALE_BACKUP="en"
39 +
40 +inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
41 +
42 +MY_PN="${PN%%-*}"
43 +MY_P="${MY_PN}-${PV}"
44 +
45 +if [[ ${PV} == "9999" ]] ; then
46 + EGIT_REPO_URI="https://source.winehq.org/git/wine.git"
47 + EGIT_BRANCH="master"
48 + inherit git-r3
49 + SRC_URI=""
50 + #KEYWORDS=""
51 +else
52 + MAJOR_V=$(get_version_component_range 1)
53 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
54 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
55 +fi
56 +S="${WORKDIR}/${MY_P}"
57 +
58 +GWP_V="20180120"
59 +PATCHDIR="${WORKDIR}/gentoo-wine-patches"
60 +
61 +DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
62 +HOMEPAGE="https://www.winehq.org/"
63 +SRC_URI="${SRC_URI}
64 + https://dev.gentoo.org/~np-hardass/distfiles/wine/gentoo-wine-patches-${GWP_V}.tar.xz
65 +"
66 +
67 +LICENSE="LGPL-2.1"
68 +SLOT="${PV}"
69 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gssapi gstreamer +jpeg kerberos kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba scanner sdl selinux +ssl test +threads +truetype udev +udisks v4l vulkan +X +xcomposite xinerama +xml"
70 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
71 + X? ( truetype )
72 + elibc_glibc? ( threads )
73 + osmesa? ( opengl )
74 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
75 +
76 +# FIXME: the test suite is unsuitable for us; many tests require net access
77 +# or fail due to Xvfb's opengl limitations.
78 +RESTRICT="test"
79 +
80 +COMMON_DEPEND="
81 + X? (
82 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
83 + x11-libs/libXext[${MULTILIB_USEDEP}]
84 + x11-libs/libXfixes[${MULTILIB_USEDEP}]
85 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
86 + x11-libs/libXi[${MULTILIB_USEDEP}]
87 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
88 + )
89 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
90 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
91 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
92 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
93 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
94 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
95 + gssapi? ( virtual/krb5[${MULTILIB_USEDEP}] )
96 + gstreamer? (
97 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
98 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
99 + )
100 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
101 + kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
102 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
103 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
104 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
105 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
106 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
107 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
108 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
109 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
110 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
111 + opengl? (
112 + virtual/glu[${MULTILIB_USEDEP}]
113 + virtual/opengl[${MULTILIB_USEDEP}]
114 + )
115 + osmesa? ( >=media-libs/mesa-13[osmesa,${MULTILIB_USEDEP}] )
116 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
117 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
118 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
119 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
120 + sdl? ( media-libs/libsdl2:=[haptic,joystick,${MULTILIB_USEDEP}] )
121 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
122 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
123 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
124 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
125 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
126 + vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
127 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
128 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
129 + xml? (
130 + dev-libs/libxml2[${MULTILIB_USEDEP}]
131 + dev-libs/libxslt[${MULTILIB_USEDEP}]
132 + )"
133 +
134 +RDEPEND="${COMMON_DEPEND}
135 + app-emulation/wine-desktop-common
136 + >app-eselect/eselect-wine-0.3
137 + !app-emulation/wine:0
138 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
139 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
140 + mono? ( app-emulation/wine-mono:4.7.1 )
141 + perl? (
142 + dev-lang/perl
143 + dev-perl/XML-Simple
144 + )
145 + pulseaudio? (
146 + realtime? ( sys-auth/rtkit )
147 + )
148 + samba? ( >=net-fs/samba-3.0.25[winbind] )
149 + selinux? ( sec-policy/selinux-wine )
150 + udisks? ( sys-fs/udisks:2 )"
151 +
152 +# tools/make_requests requires perl
153 +DEPEND="${COMMON_DEPEND}
154 + sys-devel/flex
155 + >=sys-kernel/linux-headers-2.6
156 + virtual/pkgconfig
157 + virtual/yacc
158 + X? ( x11-base/xorg-proto )
159 + prelink? ( sys-devel/prelink )
160 + xinerama? ( x11-base/xorg-proto )"
161 +
162 +# These use a non-standard "Wine" category, which is provided by
163 +# /etc/xdg/applications-merged/wine.menu
164 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
165 +usr/share/applications/wine-notepad.desktop
166 +usr/share/applications/wine-uninstaller.desktop
167 +usr/share/applications/wine-winecfg.desktop"
168 +
169 +PATCHES=(
170 + "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
171 + "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
172 + "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
173 + "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
174 +)
175 +PATCHES_BIN=()
176 +
177 +# https://bugs.gentoo.org/show_bug.cgi?id=635222
178 +if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
179 + DEPEND+=" dev-util/patchbin"
180 +fi
181 +
182 +wine_compiler_check() {
183 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
184 +
185 + # GCC-specific bugs
186 + if tc-is-gcc; then
187 + # bug #549768
188 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
189 + ebegin "Checking for gcc-5 ms_abi compiler bug"
190 + $(tc-getCC) -O2 "${PATCHDIR}/files/pr66838.c" -o "${T}"/pr66838 || die
191 + # Run in subshell to prevent "Aborted" message
192 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
193 + if ! eend $?; then
194 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
195 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
196 + eerror "or use gcc-config to select a different compiler version."
197 + eerror "See https://bugs.gentoo.org/549768"
198 + eerror
199 + return 1
200 + fi
201 + fi
202 + # bug #574044
203 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
204 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
205 + # Compile in subshell to prevent "Aborted" message
206 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${PATCHDIR}/files/pr69140.c" -o "${T}"/pr69140 ) >/dev/null 2>&1
207 + if ! eend $?; then
208 + eerror "Wine cannot be built with this version of gcc-5.3"
209 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
210 + eerror "or use gcc-config to select a different compiler version."
211 + eerror "See https://bugs.gentoo.org/574044"
212 + eerror
213 + return 1
214 + fi
215 + fi
216 + fi
217 +
218 + # Ensure compiler support
219 + if use abi_x86_64; then
220 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
221 + # Compile in subshell to prevent "Aborted" message
222 + ( $(tc-getCC) -O2 "${PATCHDIR}/files/builtin_ms_va_list.c" -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
223 + if ! eend $?; then
224 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
225 + eerror
226 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
227 + eerror
228 + return 1
229 + fi
230 + fi
231 +}
232 +
233 +wine_build_environment_check() {
234 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
235 +
236 + if use abi_x86_64; then
237 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
238 + eerror "You need gcc-4.4+ to compile 64-bit wine"
239 + die
240 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
241 + eerror "You need clang-3.8+ to compile 64-bit wine"
242 + die
243 + fi
244 + fi
245 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
246 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
247 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
248 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
249 + fi
250 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
251 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
252 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
253 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
254 + ewarn "See package.env in man 5 portage for more information on how to do this."
255 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
256 + fi
257 + fi
258 +
259 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
260 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
261 + eerror "See https://bugs.gentoo.org/487864 for more details."
262 + eerror
263 + return 1
264 + fi
265 +}
266 +
267 +wine_env_vcs_vars() {
268 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
269 + local pn_live_val="${pn_live_var}"
270 + eval pn_live_val='$'${pn_live_val}
271 + if [[ ! -z ${EGIT_COMMIT} ]]; then
272 + eerror "Commits must now be specified using the environmental variables"
273 + eerror "WINE_COMMIT"
274 + eerror
275 + return 1
276 + fi
277 +}
278 +
279 +pkg_pretend() {
280 + wine_build_environment_check || die
281 +
282 + # Verify OSS support
283 + if use oss && ! use kernel_FreeBSD; then
284 + if ! has_version ">=media-sound/oss-4"; then
285 + eerror "You cannot build wine with USE=oss without having support from a"
286 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
287 + eerror
288 + die
289 + fi
290 + fi
291 +}
292 +
293 +pkg_setup() {
294 + wine_build_environment_check || die
295 + wine_env_vcs_vars || die
296 +
297 + WINE_VARIANT="${PN#wine}-${PV}"
298 + WINE_VARIANT="${WINE_VARIANT#-}"
299 +
300 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
301 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
302 + MY_DATADIR="${MY_DATAROOTDIR}"
303 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
304 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
305 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
306 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
307 + MY_MANDIR="${MY_DATADIR}/man"
308 +}
309 +
310 +src_unpack() {
311 + if [[ ${PV} == "9999" ]] ; then
312 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
313 + fi
314 +
315 + default
316 +
317 + l10n_find_plocales_changes "${S}/po" "" ".po"
318 +}
319 +
320 +src_prepare() {
321 +
322 + eapply_bin(){
323 + local patch
324 + for patch in ${PATCHES_BIN[@]}; do
325 + patchbin --nogit < "${patch}" || die
326 + done
327 + }
328 +
329 + local md5="$(md5sum server/protocol.def)"
330 +
331 + default
332 + eapply_bin
333 + eautoreconf
334 +
335 + # Modification of the server protocol requires regenerating the server requests
336 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
337 + einfo "server/protocol.def was patched; running tools/make_requests"
338 + tools/make_requests || die #432348
339 + fi
340 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
341 + if ! use run-exes; then
342 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
343 + fi
344 +
345 + # Edit wine.desktop to work for specific variant
346 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
347 +
348 + # hi-res default icon, #472990, https://bugs.winehq.org/show_bug.cgi?id=24652
349 + cp "${PATCHDIR}/files/oic_winlogo.ico" dlls/user32/resources/ || die
350 +
351 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
352 +
353 + # Fix manpage generation for locales #469418 and abi_x86_64 #617864
354 +
355 + # Duplicate manpages input files for wine64
356 + local f
357 + for f in loader/*.man.in; do
358 + cp ${f} ${f/wine/wine64} || die
359 + done
360 + # Add wine64 manpages to Makefile
361 + if use abi_x86_64; then
362 + sed -i "/wine.man.in/i \
363 + \\\twine64.man.in \\\\" loader/Makefile.in || die
364 + sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
365 +\164\2/' loader/Makefile.in || die
366 + fi
367 +
368 + rm_man_file(){
369 + local file="${1}"
370 + loc=${2}
371 + sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
372 + }
373 +
374 + while read f; do
375 + l10n_for_each_disabled_locale_do rm_man_file "${f}"
376 + done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
377 +}
378 +
379 +src_configure() {
380 + wine_compiler_check || die
381 +
382 + export LDCONFIG=/bin/true
383 + use custom-cflags || strip-flags
384 +
385 + multilib-minimal_src_configure
386 +}
387 +
388 +multilib_src_configure() {
389 + local myconf=(
390 + --prefix="${MY_PREFIX}"
391 + --datarootdir="${MY_DATAROOTDIR}"
392 + --datadir="${MY_DATADIR}"
393 + --docdir="${MY_DOCDIR}"
394 + --includedir="${MY_INCLUDEDIR}"
395 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
396 + --libexecdir="${MY_LIBEXECDIR}"
397 + --localstatedir="${MY_LOCALSTATEDIR}"
398 + --mandir="${MY_MANDIR}"
399 + --sysconfdir=/etc/wine
400 + $(use_with alsa)
401 + $(use_with capi)
402 + $(use_with lcms cms)
403 + $(use_with cups)
404 + $(use_with ncurses curses)
405 + $(use_with udisks dbus)
406 + $(use_with fontconfig)
407 + $(use_with ssl gnutls)
408 + $(use_enable gecko mshtml)
409 + $(use_with gphoto2 gphoto)
410 + $(use_with gsm)
411 + $(use_with gssapi)
412 + $(use_with gstreamer)
413 + --without-hal
414 + $(use_with jpeg)
415 + $(use_with kerberos krb5)
416 + $(use_with ldap)
417 + $(use_enable mono mscoree)
418 + $(use_with mp3 mpg123)
419 + $(use_with netapi)
420 + $(use_with nls gettext)
421 + $(use_with openal)
422 + $(use_with opencl)
423 + $(use_with opengl)
424 + $(use_with osmesa)
425 + $(use_with oss)
426 + $(use_with pcap)
427 + $(use_with png)
428 + $(use_with pulseaudio pulse)
429 + $(use_with threads pthread)
430 + $(use_with scanner sane)
431 + $(use_with sdl)
432 + $(use_enable test tests)
433 + $(use_with truetype freetype)
434 + $(use_with udev)
435 + $(use_with v4l)
436 + $(use_with vulkan)
437 + $(use_with X x)
438 + $(use_with X xfixes)
439 + $(use_with xcomposite)
440 + $(use_with xinerama)
441 + $(use_with xml)
442 + $(use_with xml xslt)
443 + )
444 +
445 + local PKG_CONFIG AR RANLIB
446 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
447 + # set AR and RANLIB to make QA scripts happy; #483342
448 + tc-export PKG_CONFIG AR RANLIB
449 +
450 + if use amd64; then
451 + if [[ ${ABI} == amd64 ]]; then
452 + myconf+=( --enable-win64 )
453 + else
454 + myconf+=( --disable-win64 )
455 + fi
456 +
457 + # Note: using --with-wine64 results in problems with multilib.eclass
458 + # CC/LD hackery. We're using separate tools instead.
459 + fi
460 +
461 + ECONF_SOURCE=${S} \
462 + econf "${myconf[@]}"
463 + emake depend
464 +}
465 +
466 +multilib_src_test() {
467 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
468 + if [[ ${ABI} == x86 ]]; then
469 + if [[ $(id -u) == 0 ]]; then
470 + ewarn "Skipping tests since they cannot be run under the root user."
471 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
472 + return
473 + fi
474 +
475 + WINEPREFIX="${T}/.wine-${ABI}" \
476 + Xemake test
477 + fi
478 +}
479 +
480 +multilib_src_install_all() {
481 + local DOCS=( ANNOUNCE AUTHORS README )
482 + add_locale_docs() {
483 + local locale_doc="documentation/README.$1"
484 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
485 + }
486 + l10n_for_each_locale_do add_locale_docs
487 +
488 + einstalldocs
489 + prune_libtool_files --all
490 +
491 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
492 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
493 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
494 + fi
495 +
496 + # Remove wineconsole if neither backend is installed #551124
497 + if ! use X && ! use ncurses; then
498 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
499 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
500 + rm_wineconsole() {
501 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
502 + }
503 + multilib_foreach_abi rm_wineconsole
504 + fi
505 +
506 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
507 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
508 +
509 + if use abi_x86_64 && ! use abi_x86_32; then
510 + dosym wine64 "${MY_PREFIX}"/bin/wine # 404331
511 + dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
512 + fi
513 +
514 + # Failglob for binloops, shouldn't be necessary, but including to stay safe
515 + eshopts_push -s failglob #615218
516 + # Make wrappers for binaries for handling multiple variants
517 + # Note: wrappers instead of symlinks because some are shell which use basename
518 + local b
519 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
520 + make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
521 + done
522 + eshopts_pop
523 +}
524 +
525 +pkg_postinst() {
526 + eselect wine register ${P}
527 + if [[ ${PN} == "wine-vanilla" ]]; then
528 + eselect wine register --vanilla ${P} || die
529 + fi
530 +
531 + eselect wine update --all --if-unset || die
532 +
533 + xdg_desktop_database_update
534 +
535 + if ! use gecko; then
536 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
537 + ewarn "implementation of iexplore. Many older windows applications"
538 + ewarn "rely upon the existence of an iexplore implementation, so"
539 + ewarn "you will likely need to install an external one, like via winetricks"
540 + fi
541 + if ! use mono; then
542 + ewarn "Without Wine Mono, wine prefixes will not have a default"
543 + ewarn "implementation of .NET. Many windows applications rely upon"
544 + ewarn "the existence of a .NET implementation, so you will likely need"
545 + ewarn "to install an external one, like via winetricks"
546 + fi
547 +}
548 +
549 +pkg_prerm() {
550 + eselect wine deregister ${P}
551 + if [[ ${PN} == "wine-vanilla" ]]; then
552 + eselect wine deregister --vanilla ${P} || die
553 + fi
554 +
555 + eselect wine update --all --if-unset || die
556 +}
557 +
558 +pkg_postrm() {
559 + xdg_desktop_database_update
560 +}