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