Gentoo Archives: gentoo-commits

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