Gentoo Archives: gentoo-commits

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