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