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