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