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 May 2018 16:56:19
Message-Id: 1527440158.9860643c957be4b186b7638ae8d7c1335cd0fa6f.sarnex@gentoo
1 commit: 9860643c957be4b186b7638ae8d7c1335cd0fa6f
2 Author: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 27 16:49:55 2018 +0000
4 Commit: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
5 CommitDate: Sun May 27 16:55:58 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9860643c
7
8 app-emulation/wine-vanilla: Sync with ::wine
9
10 Bump to 3.9
11 Bump stable to 3.0.1
12
13 Package-Manager: Portage-2.3.40, Repoman-2.3.9
14
15 app-emulation/wine-vanilla/Manifest | 2 +
16 .../wine-vanilla/wine-vanilla-3.0.1.ebuild | 525 ++++++++++++++++++++
17 app-emulation/wine-vanilla/wine-vanilla-3.9.ebuild | 529 +++++++++++++++++++++
18 3 files changed, 1056 insertions(+)
19
20 diff --git a/app-emulation/wine-vanilla/Manifest b/app-emulation/wine-vanilla/Manifest
21 index 0bf1872f137..bf8e5897dbc 100644
22 --- a/app-emulation/wine-vanilla/Manifest
23 +++ b/app-emulation/wine-vanilla/Manifest
24 @@ -4,7 +4,9 @@ DIST wine-2.0.2.tar.xz 18854952 BLAKE2B ae55b6a31e4d36b367a84e0e5fa7bea8c39a61ec
25 DIST wine-2.0.3.tar.xz 18864648 BLAKE2B 0503a11e7545d5af805bfc3c2f614b6e35e39b7b532ee45dd9947e1a9a53eb788a304e744c683e42bf84f0e67e2c046ea5f839b6bbad1cf73b9996eaae5c30c1 SHA512 e20dbcb3a48ecb3526eba075d4baebab2529dfc50b7a6d5e18294704470f61db386013f457118c270274b911f9643d203110f46558d23e84e6a6c2d78e237dbb
26 DIST wine-2.0.4.tar.xz 18898148 BLAKE2B a21c920e1cf15e064bc6b37067a11a5568f8d1906783c200236456b73947bbd24212208ab1bcc2ca526ed40d8b2e80a2dc5d95db1a8d356a484213afb6897f59 SHA512 8fccb93e5ebe482ed81e948e3b7f87d4fe5b1f838a10f9cdcafa9561de4ef54b7d5acdc292bf28ad3aaf44be34c5ad8452ebbfc39f49f95fcbe9f9d0fcfc862c
27 DIST wine-2.0.tar.bz2 23662707 BLAKE2B 1d485c1359ce8a0395a9f6378c1f8be33ea2836b80390d1eb1095057a0acedd21708daab16e1851a315391b9f9b0a360879b9d98c73bcc8371c5023e9a8037f5 SHA512 b0a57ba8202d9fc396e5bfb7a7718d6bababbed8f3351e7fdc36afa37f35a871e04903757618f73427aeb71a52b2d323977d79e48f8b38d636f23fd404441186
28 +DIST wine-3.0.1.tar.xz 19722444 BLAKE2B e042d280c3f4c2df64c2d426cdebdb65e9c7263034961b1916bc9c6206bf9c107aefaf8cee166d9f1a2ea21dfa57db0d3641ca5e8025f70520f11aa24d20ca60 SHA512 3d59f08a87da1d2ee280954a4c91e861b6994048b36eff1ac8df67dbab08a792d391b23ced66ea99f8503a979b3ec26cd35558b71c4d29d68775a5d484bf7d00
29 DIST wine-3.0.tar.xz 19712932 BLAKE2B 4478c6781bb171ecca426d1fdc85e0d0bbe13b62b6c983933de55e2abdd0bda7a01cbf251c021824b00129ea6230d1d4e718a64b7d919bb5c07a106b8771adb6 SHA512 a51f41b66f4805e09b223528eff6670e94b9c0c0c947be647507baf9d8d9afe7c3fdc88684c2c8d3573b4739d9a086ab929a744a8594d3c8f6ceb52070f43f0a
30 DIST wine-3.6.tar.xz 20005240 BLAKE2B 6dd48180b9aed8a3b69c40b3ed7b2ff5adbebfb591860dda6603d2219f9059bc069df000cd2614c80d34911c451388f0124af3dd8a11b806b227ca8e16659d71 SHA512 31d24cc78734bdb743afcec7df05b641ab0625568361401eaf8cd5e217719c8c51a0ef7ed737a560fe42cb9ecd88f10d35e62a98d9df69b966502a5b0dab5a22
31 DIST wine-3.7.tar.xz 20454036 BLAKE2B 04ac94d5679377c5d0bb37a6d3e8e3ec7c09faa300f8422a09a22b14ef4244d2bb14c80a47cfca5e11526506a8064f0cfa4e28868d7f04669f85ab743dbbb36d SHA512 a699418574dd8f407c064421cf6cdfe3923562c8adf9a7749e716f3853291eab05358ea64f0217c303c26c0f8f59d2116024b7b6978f9a52a055147e689a8694
32 DIST wine-3.8.tar.xz 20473392 BLAKE2B a7873dd15a373491703e16888044cf2ba00121f91a4583fe6dcf687b5179a2d926035cc86c75f70ceca03a508bd4712c58a1662186e0a6e0c139e63e686f8c5d SHA512 387c6bff3eafac7e92030d11c02b3461b4ead059d2aad7f6d903e176f304d2ac0a426132fcd452507868f0d22bb360a30734edf3e73dfd514037458f08406e98
33 +DIST wine-3.9.tar.xz 20508952 BLAKE2B 6fbf22673588963c483b7b31e82287c09e15b579b8f57267e2731768f95a1f986954bb473ee0dfa2428802fe9331b8599a01c782dd1152d36ce2002b6a4e6bde SHA512 4c4e5a741a61b9427c175e015177df5806638736f7dfd92098ed95239d41a373cbab876c054d3c948e1db6a7de359db3babd63bc194edc8c2c3be28b58f75e64
34
35 diff --git a/app-emulation/wine-vanilla/wine-vanilla-3.0.1.ebuild b/app-emulation/wine-vanilla/wine-vanilla-3.0.1.ebuild
36 new file mode 100644
37 index 00000000000..0fc72130806
38 --- /dev/null
39 +++ b/app-emulation/wine-vanilla/wine-vanilla-3.0.1.ebuild
40 @@ -0,0 +1,525 @@
41 +# Copyright 1999-2018 Gentoo Foundation
42 +# Distributed under the terms of the GNU General Public License v2
43 +
44 +EAPI=6
45 +
46 +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"
47 +PLOCALE_BACKUP="en"
48 +
49 +inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
50 +
51 +MY_PN="${PN%%-*}"
52 +MY_P="${MY_PN}-${PV}"
53 +
54 +if [[ ${PV} == "9999" ]] ; then
55 + EGIT_REPO_URI="https://source.winehq.org/git/wine.git"
56 + EGIT_BRANCH="master"
57 + inherit git-r3
58 + SRC_URI=""
59 + #KEYWORDS=""
60 +else
61 + MAJOR_V=$(get_version_component_range 1)
62 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.0/${MY_P}.tar.xz"
63 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
64 +fi
65 +S="${WORKDIR}/${MY_P}"
66 +
67 +GWP_V="20180120"
68 +PATCHDIR="${WORKDIR}/gentoo-wine-patches"
69 +
70 +DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
71 +HOMEPAGE="https://www.winehq.org/"
72 +SRC_URI="${SRC_URI}
73 + https://dev.gentoo.org/~np-hardass/distfiles/wine/gentoo-wine-patches-${GWP_V}.tar.xz
74 +"
75 +
76 +LICENSE="LGPL-2.1"
77 +SLOT="${PV}"
78 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm 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 selinux +ssl test +threads +truetype udev +udisks v4l +X +xcomposite xinerama +xml"
79 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
80 + X? ( truetype )
81 + elibc_glibc? ( threads )
82 + osmesa? ( opengl )
83 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
84 +
85 +# FIXME: the test suite is unsuitable for us; many tests require net access
86 +# or fail due to Xvfb's opengl limitations.
87 +RESTRICT="test"
88 +
89 +COMMON_DEPEND="
90 + X? (
91 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
92 + x11-libs/libXext[${MULTILIB_USEDEP}]
93 + x11-libs/libXfixes[${MULTILIB_USEDEP}]
94 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
95 + x11-libs/libXi[${MULTILIB_USEDEP}]
96 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
97 + )
98 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
99 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
100 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
101 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
102 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
103 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
104 + gstreamer? (
105 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
106 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
107 + )
108 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
109 + kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
110 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
111 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
112 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
113 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
114 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
115 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
116 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
117 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
118 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
119 + opengl? (
120 + virtual/glu[${MULTILIB_USEDEP}]
121 + virtual/opengl[${MULTILIB_USEDEP}]
122 + )
123 + osmesa? ( >=media-libs/mesa-13[osmesa,${MULTILIB_USEDEP}] )
124 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
125 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
126 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
127 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
128 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
129 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
130 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
131 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
132 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
133 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
134 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
135 + xml? (
136 + dev-libs/libxml2[${MULTILIB_USEDEP}]
137 + dev-libs/libxslt[${MULTILIB_USEDEP}]
138 + )"
139 +
140 +RDEPEND="${COMMON_DEPEND}
141 + app-emulation/wine-desktop-common
142 + >app-eselect/eselect-wine-0.3
143 + !app-emulation/wine:0
144 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
145 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
146 + mono? ( app-emulation/wine-mono:4.7.1 )
147 + perl? (
148 + dev-lang/perl
149 + dev-perl/XML-Simple
150 + )
151 + pulseaudio? (
152 + realtime? ( sys-auth/rtkit )
153 + )
154 + samba? ( >=net-fs/samba-3.0.25[winbind] )
155 + selinux? ( sec-policy/selinux-wine )
156 + udisks? ( sys-fs/udisks:2 )"
157 +
158 +# tools/make_requests requires perl
159 +DEPEND="${COMMON_DEPEND}
160 + sys-devel/flex
161 + >=sys-kernel/linux-headers-2.6
162 + virtual/pkgconfig
163 + virtual/yacc
164 + X? ( x11-base/xorg-proto )
165 + prelink? ( sys-devel/prelink )
166 + xinerama? ( x11-base/xorg-proto )"
167 +
168 +# These use a non-standard "Wine" category, which is provided by
169 +# /etc/xdg/applications-merged/wine.menu
170 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
171 +usr/share/applications/wine-notepad.desktop
172 +usr/share/applications/wine-uninstaller.desktop
173 +usr/share/applications/wine-winecfg.desktop"
174 +
175 +PATCHES=(
176 + "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
177 + "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
178 + "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
179 + "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
180 + "${PATCHDIR}/patches/${MY_PN}-2.0-rearrange-manpages.patch" #469418 #617864
181 +)
182 +PATCHES_BIN=()
183 +
184 +# https://bugs.gentoo.org/show_bug.cgi?id=635222
185 +if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
186 + DEPEND+=" dev-util/patchbin"
187 +fi
188 +
189 +wine_compiler_check() {
190 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
191 +
192 + # GCC-specific bugs
193 + if tc-is-gcc; then
194 + # bug #549768
195 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
196 + ebegin "Checking for gcc-5 ms_abi compiler bug"
197 + $(tc-getCC) -O2 "${PATCHDIR}/files/pr66838.c" -o "${T}"/pr66838 || die
198 + # Run in subshell to prevent "Aborted" message
199 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
200 + if ! eend $?; then
201 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
202 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
203 + eerror "or use gcc-config to select a different compiler version."
204 + eerror "See https://bugs.gentoo.org/549768"
205 + eerror
206 + return 1
207 + fi
208 + fi
209 + # bug #574044
210 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
211 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
212 + # Compile in subshell to prevent "Aborted" message
213 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${PATCHDIR}/files/pr69140.c" -o "${T}"/pr69140 ) >/dev/null 2>&1
214 + if ! eend $?; then
215 + eerror "Wine cannot be built with this version of gcc-5.3"
216 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
217 + eerror "or use gcc-config to select a different compiler version."
218 + eerror "See https://bugs.gentoo.org/574044"
219 + eerror
220 + return 1
221 + fi
222 + fi
223 + fi
224 +
225 + # Ensure compiler support
226 + if use abi_x86_64; then
227 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
228 + # Compile in subshell to prevent "Aborted" message
229 + ( $(tc-getCC) -O2 "${PATCHDIR}/files/builtin_ms_va_list.c" -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
230 + if ! eend $?; then
231 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
232 + eerror
233 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
234 + eerror
235 + return 1
236 + fi
237 + fi
238 +}
239 +
240 +wine_build_environment_check() {
241 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
242 +
243 + if use abi_x86_64; then
244 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
245 + eerror "You need gcc-4.4+ to compile 64-bit wine"
246 + die
247 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
248 + eerror "You need clang-3.8+ to compile 64-bit wine"
249 + die
250 + fi
251 + fi
252 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
253 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
254 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
255 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
256 + fi
257 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
258 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
259 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
260 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
261 + ewarn "See package.env in man 5 portage for more information on how to do this."
262 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
263 + fi
264 + fi
265 +
266 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
267 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
268 + eerror "See https://bugs.gentoo.org/487864 for more details."
269 + eerror
270 + return 1
271 + fi
272 +}
273 +
274 +wine_env_vcs_vars() {
275 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
276 + local pn_live_val="${pn_live_var}"
277 + eval pn_live_val='$'${pn_live_val}
278 + if [[ ! -z ${EGIT_COMMIT} ]]; then
279 + eerror "Commits must now be specified using the environmental variables"
280 + eerror "WINE_COMMIT"
281 + eerror
282 + return 1
283 + fi
284 +}
285 +
286 +pkg_pretend() {
287 + wine_build_environment_check || die
288 +
289 + # Verify OSS support
290 + if use oss && ! use kernel_FreeBSD; then
291 + if ! has_version ">=media-sound/oss-4"; then
292 + eerror "You cannot build wine with USE=oss without having support from a"
293 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
294 + eerror
295 + die
296 + fi
297 + fi
298 +}
299 +
300 +pkg_setup() {
301 + wine_build_environment_check || die
302 + wine_env_vcs_vars || die
303 +
304 + WINE_VARIANT="${PN#wine}-${PV}"
305 + WINE_VARIANT="${WINE_VARIANT#-}"
306 +
307 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
308 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
309 + MY_DATADIR="${MY_DATAROOTDIR}"
310 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
311 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
312 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
313 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
314 + MY_MANDIR="${MY_DATADIR}/man"
315 +}
316 +
317 +src_unpack() {
318 + if [[ ${PV} == "9999" ]] ; then
319 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
320 + fi
321 +
322 + default
323 +
324 + l10n_find_plocales_changes "${S}/po" "" ".po"
325 +}
326 +
327 +src_prepare() {
328 +
329 + eapply_bin(){
330 + local patch
331 + for patch in ${PATCHES_BIN[@]}; do
332 + patchbin --nogit < "${patch}" || die
333 + done
334 + }
335 +
336 + local md5="$(md5sum server/protocol.def)"
337 +
338 + default
339 + eapply_bin
340 + eautoreconf
341 +
342 + # Modification of the server protocol requires regenerating the server requests
343 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
344 + einfo "server/protocol.def was patched; running tools/make_requests"
345 + tools/make_requests || die #432348
346 + fi
347 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
348 + if ! use run-exes; then
349 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
350 + fi
351 +
352 + # Edit wine.desktop to work for specific variant
353 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
354 +
355 + # hi-res default icon, #472990, https://bugs.winehq.org/show_bug.cgi?id=24652
356 + cp "${PATCHDIR}/files/oic_winlogo.ico" dlls/user32/resources/ || die
357 +
358 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
359 +
360 + # Fix manpage generation for locales #469418 and abi_x86_64 #617864
361 + # Requires wine-2.0-rearrange-manpages.patch
362 +
363 + # Duplicate manpages input files for wine64
364 + local f
365 + for f in loader/*.man.in; do
366 + cp ${f} ${f/wine/wine64} || die
367 + done
368 + # Add wine64 manpages to Makefile
369 + if use abi_x86_64; then
370 + sed -i "/wine.man.in/i \
371 + \\\twine64.man.in \\\\" loader/Makefile.in || die
372 + sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
373 +\164\2/' loader/Makefile.in || die
374 + fi
375 +
376 + rm_man_file(){
377 + local file="${1}"
378 + loc=${2}
379 + sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
380 + }
381 +
382 + while read f; do
383 + l10n_for_each_disabled_locale_do rm_man_file "${f}"
384 + done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
385 +}
386 +
387 +src_configure() {
388 + wine_compiler_check || die
389 +
390 + export LDCONFIG=/bin/true
391 + use custom-cflags || strip-flags
392 +
393 + multilib-minimal_src_configure
394 +}
395 +
396 +multilib_src_configure() {
397 + local myconf=(
398 + --prefix="${MY_PREFIX}"
399 + --datarootdir="${MY_DATAROOTDIR}"
400 + --datadir="${MY_DATADIR}"
401 + --docdir="${MY_DOCDIR}"
402 + --includedir="${MY_INCLUDEDIR}"
403 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
404 + --libexecdir="${MY_LIBEXECDIR}"
405 + --localstatedir="${MY_LOCALSTATEDIR}"
406 + --mandir="${MY_MANDIR}"
407 + --sysconfdir=/etc/wine
408 + $(use_with alsa)
409 + $(use_with capi)
410 + $(use_with lcms cms)
411 + $(use_with cups)
412 + $(use_with ncurses curses)
413 + $(use_with udisks dbus)
414 + $(use_with fontconfig)
415 + $(use_with ssl gnutls)
416 + $(use_enable gecko mshtml)
417 + $(use_with gphoto2 gphoto)
418 + $(use_with gsm)
419 + $(use_with gstreamer)
420 + --without-hal
421 + $(use_with jpeg)
422 + $(use_with kerberos krb5)
423 + $(use_with ldap)
424 + $(use_enable mono mscoree)
425 + $(use_with mp3 mpg123)
426 + $(use_with netapi)
427 + $(use_with nls gettext)
428 + $(use_with openal)
429 + $(use_with opencl)
430 + $(use_with opengl)
431 + $(use_with osmesa)
432 + $(use_with oss)
433 + $(use_with pcap)
434 + $(use_with png)
435 + $(use_with pulseaudio pulse)
436 + $(use_with threads pthread)
437 + $(use_with scanner sane)
438 + $(use_enable test tests)
439 + $(use_with truetype freetype)
440 + $(use_with udev)
441 + $(use_with v4l)
442 + $(use_with X x)
443 + $(use_with X xfixes)
444 + $(use_with xcomposite)
445 + $(use_with xinerama)
446 + $(use_with xml)
447 + $(use_with xml xslt)
448 + )
449 +
450 + local PKG_CONFIG AR RANLIB
451 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
452 + # set AR and RANLIB to make QA scripts happy; #483342
453 + tc-export PKG_CONFIG AR RANLIB
454 +
455 + if use amd64; then
456 + if [[ ${ABI} == amd64 ]]; then
457 + myconf+=( --enable-win64 )
458 + else
459 + myconf+=( --disable-win64 )
460 + fi
461 +
462 + # Note: using --with-wine64 results in problems with multilib.eclass
463 + # CC/LD hackery. We're using separate tools instead.
464 + fi
465 +
466 + ECONF_SOURCE=${S} \
467 + econf "${myconf[@]}"
468 + emake depend
469 +}
470 +
471 +multilib_src_test() {
472 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
473 + if [[ ${ABI} == x86 ]]; then
474 + if [[ $(id -u) == 0 ]]; then
475 + ewarn "Skipping tests since they cannot be run under the root user."
476 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
477 + return
478 + fi
479 +
480 + WINEPREFIX="${T}/.wine-${ABI}" \
481 + Xemake test
482 + fi
483 +}
484 +
485 +multilib_src_install_all() {
486 + local DOCS=( ANNOUNCE AUTHORS README )
487 + add_locale_docs() {
488 + local locale_doc="documentation/README.$1"
489 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
490 + }
491 + l10n_for_each_locale_do add_locale_docs
492 +
493 + einstalldocs
494 + prune_libtool_files --all
495 +
496 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
497 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
498 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
499 + fi
500 +
501 + # Remove wineconsole if neither backend is installed #551124
502 + if ! use X && ! use ncurses; then
503 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
504 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
505 + rm_wineconsole() {
506 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
507 + }
508 + multilib_foreach_abi rm_wineconsole
509 + fi
510 +
511 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
512 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
513 +
514 + if use abi_x86_64 && ! use abi_x86_32; then
515 + dosym wine64 "${MY_PREFIX}"/bin/wine # 404331
516 + dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
517 + fi
518 +
519 + # Failglob for binloops, shouldn't be necessary, but including to stay safe
520 + eshopts_push -s failglob #615218
521 + # Make wrappers for binaries for handling multiple variants
522 + # Note: wrappers instead of symlinks because some are shell which use basename
523 + local b
524 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
525 + make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
526 + done
527 + eshopts_pop
528 +}
529 +
530 +pkg_postinst() {
531 + eselect wine register ${P}
532 + if [[ ${PN} == "wine-vanilla" ]]; then
533 + eselect wine register --vanilla ${P} || die
534 + fi
535 +
536 + eselect wine update --all --if-unset || die
537 +
538 + xdg_desktop_database_update
539 +
540 + if ! use gecko; then
541 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
542 + ewarn "implementation of iexplore. Many older windows applications"
543 + ewarn "rely upon the existence of an iexplore implementation, so"
544 + ewarn "you will likely need to install an external one, like via winetricks"
545 + fi
546 + if ! use mono; then
547 + ewarn "Without Wine Mono, wine prefixes will not have a default"
548 + ewarn "implementation of .NET. Many windows applications rely upon"
549 + ewarn "the existence of a .NET implementation, so you will likely need"
550 + ewarn "to install an external one, like via winetricks"
551 + fi
552 +}
553 +
554 +pkg_prerm() {
555 + eselect wine deregister ${P}
556 + if [[ ${PN} == "wine-vanilla" ]]; then
557 + eselect wine deregister --vanilla ${P} || die
558 + fi
559 +
560 + eselect wine update --all --if-unset || die
561 +}
562 +
563 +pkg_postrm() {
564 + xdg_desktop_database_update
565 +}
566
567 diff --git a/app-emulation/wine-vanilla/wine-vanilla-3.9.ebuild b/app-emulation/wine-vanilla/wine-vanilla-3.9.ebuild
568 new file mode 100644
569 index 00000000000..9bebca2da60
570 --- /dev/null
571 +++ b/app-emulation/wine-vanilla/wine-vanilla-3.9.ebuild
572 @@ -0,0 +1,529 @@
573 +# Copyright 1999-2018 Gentoo Foundation
574 +# Distributed under the terms of the GNU General Public License v2
575 +
576 +EAPI=6
577 +
578 +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"
579 +PLOCALE_BACKUP="en"
580 +
581 +inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
582 +
583 +MY_PN="${PN%%-*}"
584 +MY_P="${MY_PN}-${PV}"
585 +
586 +if [[ ${PV} == "9999" ]] ; then
587 + EGIT_REPO_URI="https://source.winehq.org/git/wine.git"
588 + EGIT_BRANCH="master"
589 + inherit git-r3
590 + SRC_URI=""
591 + #KEYWORDS=""
592 +else
593 + MAJOR_V=$(get_version_component_range 1)
594 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
595 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
596 +fi
597 +S="${WORKDIR}/${MY_P}"
598 +
599 +GWP_V="20180120"
600 +PATCHDIR="${WORKDIR}/gentoo-wine-patches"
601 +
602 +DESCRIPTION="Free implementation of Windows(tm) on Unix, without external patchsets"
603 +HOMEPAGE="https://www.winehq.org/"
604 +SRC_URI="${SRC_URI}
605 + https://dev.gentoo.org/~np-hardass/distfiles/wine/gentoo-wine-patches-${GWP_V}.tar.xz
606 +"
607 +
608 +LICENSE="LGPL-2.1"
609 +SLOT="${PV}"
610 +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 vulkan +X +xcomposite xinerama +xml"
611 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
612 + X? ( truetype )
613 + elibc_glibc? ( threads )
614 + osmesa? ( opengl )
615 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
616 +
617 +# FIXME: the test suite is unsuitable for us; many tests require net access
618 +# or fail due to Xvfb's opengl limitations.
619 +RESTRICT="test"
620 +
621 +COMMON_DEPEND="
622 + X? (
623 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
624 + x11-libs/libXext[${MULTILIB_USEDEP}]
625 + x11-libs/libXfixes[${MULTILIB_USEDEP}]
626 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
627 + x11-libs/libXi[${MULTILIB_USEDEP}]
628 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
629 + )
630 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
631 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
632 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
633 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
634 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
635 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
636 + gssapi? ( virtual/krb5[${MULTILIB_USEDEP}] )
637 + gstreamer? (
638 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
639 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
640 + )
641 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
642 + kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
643 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
644 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
645 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
646 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
647 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
648 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
649 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
650 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
651 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
652 + opengl? (
653 + virtual/glu[${MULTILIB_USEDEP}]
654 + virtual/opengl[${MULTILIB_USEDEP}]
655 + )
656 + osmesa? ( >=media-libs/mesa-13[osmesa,${MULTILIB_USEDEP}] )
657 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
658 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
659 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
660 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
661 + sdl? ( media-libs/libsdl2:=[haptic,joystick,${MULTILIB_USEDEP}] )
662 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
663 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
664 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
665 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
666 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
667 + vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
668 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
669 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
670 + xml? (
671 + dev-libs/libxml2[${MULTILIB_USEDEP}]
672 + dev-libs/libxslt[${MULTILIB_USEDEP}]
673 + )"
674 +
675 +RDEPEND="${COMMON_DEPEND}
676 + app-emulation/wine-desktop-common
677 + >app-eselect/eselect-wine-0.3
678 + !app-emulation/wine:0
679 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
680 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
681 + mono? ( app-emulation/wine-mono:4.7.1 )
682 + perl? (
683 + dev-lang/perl
684 + dev-perl/XML-Simple
685 + )
686 + pulseaudio? (
687 + realtime? ( sys-auth/rtkit )
688 + )
689 + samba? ( >=net-fs/samba-3.0.25[winbind] )
690 + selinux? ( sec-policy/selinux-wine )
691 + udisks? ( sys-fs/udisks:2 )"
692 +
693 +# tools/make_requests requires perl
694 +DEPEND="${COMMON_DEPEND}
695 + sys-devel/flex
696 + >=sys-kernel/linux-headers-2.6
697 + virtual/pkgconfig
698 + virtual/yacc
699 + X? ( x11-base/xorg-proto )
700 + prelink? ( sys-devel/prelink )
701 + xinerama? ( x11-base/xorg-proto )"
702 +
703 +# These use a non-standard "Wine" category, which is provided by
704 +# /etc/xdg/applications-merged/wine.menu
705 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
706 +usr/share/applications/wine-notepad.desktop
707 +usr/share/applications/wine-uninstaller.desktop
708 +usr/share/applications/wine-winecfg.desktop"
709 +
710 +PATCHES=(
711 + "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
712 + "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
713 + "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
714 + "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
715 +)
716 +PATCHES_BIN=()
717 +
718 +# https://bugs.gentoo.org/show_bug.cgi?id=635222
719 +if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
720 + DEPEND+=" dev-util/patchbin"
721 +fi
722 +
723 +wine_compiler_check() {
724 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
725 +
726 + # GCC-specific bugs
727 + if tc-is-gcc; then
728 + # bug #549768
729 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
730 + ebegin "Checking for gcc-5 ms_abi compiler bug"
731 + $(tc-getCC) -O2 "${PATCHDIR}/files/pr66838.c" -o "${T}"/pr66838 || die
732 + # Run in subshell to prevent "Aborted" message
733 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
734 + if ! eend $?; then
735 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
736 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
737 + eerror "or use gcc-config to select a different compiler version."
738 + eerror "See https://bugs.gentoo.org/549768"
739 + eerror
740 + return 1
741 + fi
742 + fi
743 + # bug #574044
744 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
745 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
746 + # Compile in subshell to prevent "Aborted" message
747 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${PATCHDIR}/files/pr69140.c" -o "${T}"/pr69140 ) >/dev/null 2>&1
748 + if ! eend $?; then
749 + eerror "Wine cannot be built with this version of gcc-5.3"
750 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
751 + eerror "or use gcc-config to select a different compiler version."
752 + eerror "See https://bugs.gentoo.org/574044"
753 + eerror
754 + return 1
755 + fi
756 + fi
757 + fi
758 +
759 + # Ensure compiler support
760 + if use abi_x86_64; then
761 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
762 + # Compile in subshell to prevent "Aborted" message
763 + ( $(tc-getCC) -O2 "${PATCHDIR}/files/builtin_ms_va_list.c" -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
764 + if ! eend $?; then
765 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
766 + eerror
767 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
768 + eerror
769 + return 1
770 + fi
771 + fi
772 +}
773 +
774 +wine_build_environment_check() {
775 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
776 +
777 + if use abi_x86_64; then
778 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
779 + eerror "You need gcc-4.4+ to compile 64-bit wine"
780 + die
781 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
782 + eerror "You need clang-3.8+ to compile 64-bit wine"
783 + die
784 + fi
785 + fi
786 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
787 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
788 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
789 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
790 + fi
791 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
792 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
793 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
794 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
795 + ewarn "See package.env in man 5 portage for more information on how to do this."
796 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
797 + fi
798 + fi
799 +
800 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
801 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
802 + eerror "See https://bugs.gentoo.org/487864 for more details."
803 + eerror
804 + return 1
805 + fi
806 +}
807 +
808 +wine_env_vcs_vars() {
809 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
810 + local pn_live_val="${pn_live_var}"
811 + eval pn_live_val='$'${pn_live_val}
812 + if [[ ! -z ${EGIT_COMMIT} ]]; then
813 + eerror "Commits must now be specified using the environmental variables"
814 + eerror "WINE_COMMIT"
815 + eerror
816 + return 1
817 + fi
818 +}
819 +
820 +pkg_pretend() {
821 + wine_build_environment_check || die
822 +
823 + # Verify OSS support
824 + if use oss && ! use kernel_FreeBSD; then
825 + if ! has_version ">=media-sound/oss-4"; then
826 + eerror "You cannot build wine with USE=oss without having support from a"
827 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
828 + eerror
829 + die
830 + fi
831 + fi
832 +}
833 +
834 +pkg_setup() {
835 + wine_build_environment_check || die
836 + wine_env_vcs_vars || die
837 +
838 + WINE_VARIANT="${PN#wine}-${PV}"
839 + WINE_VARIANT="${WINE_VARIANT#-}"
840 +
841 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
842 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
843 + MY_DATADIR="${MY_DATAROOTDIR}"
844 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
845 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
846 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
847 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
848 + MY_MANDIR="${MY_DATADIR}/man"
849 +}
850 +
851 +src_unpack() {
852 + if [[ ${PV} == "9999" ]] ; then
853 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
854 + fi
855 +
856 + default
857 +
858 + l10n_find_plocales_changes "${S}/po" "" ".po"
859 +}
860 +
861 +src_prepare() {
862 +
863 + eapply_bin(){
864 + local patch
865 + for patch in ${PATCHES_BIN[@]}; do
866 + patchbin --nogit < "${patch}" || die
867 + done
868 + }
869 +
870 + local md5="$(md5sum server/protocol.def)"
871 +
872 + default
873 + eapply_bin
874 + eautoreconf
875 +
876 + # Modification of the server protocol requires regenerating the server requests
877 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
878 + einfo "server/protocol.def was patched; running tools/make_requests"
879 + tools/make_requests || die #432348
880 + fi
881 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
882 + if ! use run-exes; then
883 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
884 + fi
885 +
886 + # Edit wine.desktop to work for specific variant
887 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
888 +
889 + # hi-res default icon, #472990, https://bugs.winehq.org/show_bug.cgi?id=24652
890 + cp "${PATCHDIR}/files/oic_winlogo.ico" dlls/user32/resources/ || die
891 +
892 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
893 +
894 + # Fix manpage generation for locales #469418 and abi_x86_64 #617864
895 +
896 + # Duplicate manpages input files for wine64
897 + local f
898 + for f in loader/*.man.in; do
899 + cp ${f} ${f/wine/wine64} || die
900 + done
901 + # Add wine64 manpages to Makefile
902 + if use abi_x86_64; then
903 + sed -i "/wine.man.in/i \
904 + \\\twine64.man.in \\\\" loader/Makefile.in || die
905 + sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
906 +\164\2/' loader/Makefile.in || die
907 + fi
908 +
909 + rm_man_file(){
910 + local file="${1}"
911 + loc=${2}
912 + sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
913 + }
914 +
915 + while read f; do
916 + l10n_for_each_disabled_locale_do rm_man_file "${f}"
917 + done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
918 +}
919 +
920 +src_configure() {
921 + wine_compiler_check || die
922 +
923 + export LDCONFIG=/bin/true
924 + use custom-cflags || strip-flags
925 +
926 + multilib-minimal_src_configure
927 +}
928 +
929 +multilib_src_configure() {
930 + local myconf=(
931 + --prefix="${MY_PREFIX}"
932 + --datarootdir="${MY_DATAROOTDIR}"
933 + --datadir="${MY_DATADIR}"
934 + --docdir="${MY_DOCDIR}"
935 + --includedir="${MY_INCLUDEDIR}"
936 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
937 + --libexecdir="${MY_LIBEXECDIR}"
938 + --localstatedir="${MY_LOCALSTATEDIR}"
939 + --mandir="${MY_MANDIR}"
940 + --sysconfdir=/etc/wine
941 + $(use_with alsa)
942 + $(use_with capi)
943 + $(use_with lcms cms)
944 + $(use_with cups)
945 + $(use_with ncurses curses)
946 + $(use_with udisks dbus)
947 + $(use_with fontconfig)
948 + $(use_with ssl gnutls)
949 + $(use_enable gecko mshtml)
950 + $(use_with gphoto2 gphoto)
951 + $(use_with gsm)
952 + $(use_with gssapi)
953 + $(use_with gstreamer)
954 + --without-hal
955 + $(use_with jpeg)
956 + $(use_with kerberos krb5)
957 + $(use_with ldap)
958 + $(use_enable mono mscoree)
959 + $(use_with mp3 mpg123)
960 + $(use_with netapi)
961 + $(use_with nls gettext)
962 + $(use_with openal)
963 + $(use_with opencl)
964 + $(use_with opengl)
965 + $(use_with osmesa)
966 + $(use_with oss)
967 + $(use_with pcap)
968 + $(use_with png)
969 + $(use_with pulseaudio pulse)
970 + $(use_with threads pthread)
971 + $(use_with scanner sane)
972 + $(use_with sdl)
973 + $(use_enable test tests)
974 + $(use_with truetype freetype)
975 + $(use_with udev)
976 + $(use_with v4l)
977 + $(use_with vulkan)
978 + $(use_with X x)
979 + $(use_with X xfixes)
980 + $(use_with xcomposite)
981 + $(use_with xinerama)
982 + $(use_with xml)
983 + $(use_with xml xslt)
984 + )
985 +
986 + local PKG_CONFIG AR RANLIB
987 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
988 + # set AR and RANLIB to make QA scripts happy; #483342
989 + tc-export PKG_CONFIG AR RANLIB
990 +
991 + if use amd64; then
992 + if [[ ${ABI} == amd64 ]]; then
993 + myconf+=( --enable-win64 )
994 + else
995 + myconf+=( --disable-win64 )
996 + fi
997 +
998 + # Note: using --with-wine64 results in problems with multilib.eclass
999 + # CC/LD hackery. We're using separate tools instead.
1000 + fi
1001 +
1002 + ECONF_SOURCE=${S} \
1003 + econf "${myconf[@]}"
1004 + emake depend
1005 +}
1006 +
1007 +multilib_src_test() {
1008 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
1009 + if [[ ${ABI} == x86 ]]; then
1010 + if [[ $(id -u) == 0 ]]; then
1011 + ewarn "Skipping tests since they cannot be run under the root user."
1012 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
1013 + return
1014 + fi
1015 +
1016 + WINEPREFIX="${T}/.wine-${ABI}" \
1017 + Xemake test
1018 + fi
1019 +}
1020 +
1021 +multilib_src_install_all() {
1022 + local DOCS=( ANNOUNCE AUTHORS README )
1023 + add_locale_docs() {
1024 + local locale_doc="documentation/README.$1"
1025 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
1026 + }
1027 + l10n_for_each_locale_do add_locale_docs
1028 +
1029 + einstalldocs
1030 + prune_libtool_files --all
1031 +
1032 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
1033 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
1034 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
1035 + fi
1036 +
1037 + # Remove wineconsole if neither backend is installed #551124
1038 + if ! use X && ! use ncurses; then
1039 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
1040 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
1041 + rm_wineconsole() {
1042 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
1043 + }
1044 + multilib_foreach_abi rm_wineconsole
1045 + fi
1046 +
1047 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
1048 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
1049 +
1050 + if use abi_x86_64 && ! use abi_x86_32; then
1051 + dosym wine64 "${MY_PREFIX}"/bin/wine # 404331
1052 + dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
1053 + fi
1054 +
1055 + # Failglob for binloops, shouldn't be necessary, but including to stay safe
1056 + eshopts_push -s failglob #615218
1057 + # Make wrappers for binaries for handling multiple variants
1058 + # Note: wrappers instead of symlinks because some are shell which use basename
1059 + local b
1060 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
1061 + make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
1062 + done
1063 + eshopts_pop
1064 +}
1065 +
1066 +pkg_postinst() {
1067 + eselect wine register ${P}
1068 + if [[ ${PN} == "wine-vanilla" ]]; then
1069 + eselect wine register --vanilla ${P} || die
1070 + fi
1071 +
1072 + eselect wine update --all --if-unset || die
1073 +
1074 + xdg_desktop_database_update
1075 +
1076 + if ! use gecko; then
1077 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
1078 + ewarn "implementation of iexplore. Many older windows applications"
1079 + ewarn "rely upon the existence of an iexplore implementation, so"
1080 + ewarn "you will likely need to install an external one, like via winetricks"
1081 + fi
1082 + if ! use mono; then
1083 + ewarn "Without Wine Mono, wine prefixes will not have a default"
1084 + ewarn "implementation of .NET. Many windows applications rely upon"
1085 + ewarn "the existence of a .NET implementation, so you will likely need"
1086 + ewarn "to install an external one, like via winetricks"
1087 + fi
1088 +}
1089 +
1090 +pkg_prerm() {
1091 + eselect wine deregister ${P}
1092 + if [[ ${PN} == "wine-vanilla" ]]; then
1093 + eselect wine deregister --vanilla ${P} || die
1094 + fi
1095 +
1096 + eselect wine update --all --if-unset || die
1097 +}
1098 +
1099 +pkg_postrm() {
1100 + xdg_desktop_database_update
1101 +}