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