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: Sun, 02 Sep 2018 14:35:12
Message-Id: 1535898813.5c234f19f242da83f38aceb1d16d2fa5f15f662f.sarnex@gentoo
1 commit: 5c234f19f242da83f38aceb1d16d2fa5f15f662f
2 Author: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 2 14:33:33 2018 +0000
4 Commit: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 2 14:33:33 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/wine.git/commit/?id=5c234f19
7
8 app-emulation/wine-staging: Bump to 3.15
9
10 Package-Manager: Portage-2.3.48, Repoman-2.3.10
11
12 app-emulation/wine-staging/Manifest | 2 +
13 .../wine-staging/wine-staging-3.15.ebuild | 612 +++++++++++++++++++++
14 2 files changed, 614 insertions(+)
15
16 diff --git a/app-emulation/wine-staging/Manifest b/app-emulation/wine-staging/Manifest
17 index 62ba166..0d86abd 100644
18 --- a/app-emulation/wine-staging/Manifest
19 +++ b/app-emulation/wine-staging/Manifest
20 @@ -26,6 +26,7 @@ DIST wine-3.11.tar.xz 20501100 BLAKE2B 793fe0a83ed13f4ca436c710198ffcbde5e0109d9
21 DIST wine-3.12.tar.xz 20516708 BLAKE2B 6ff32f8d471492c1ca42db434b16c0273e98cd15215d2f67e3d8e34e298d36620f55409bb781687f3ab11e6a44bd95eaa033e642fdb0d7aae90319ac2ddd2fb6 SHA512 afc76e8975ea780f664de27a17128f730bcbe72a9fad0c01bfe6dcc98c2f98729ccde32e97fe4df2cf98f5d1b254b28f0e7cd380855148c5cfb41dd88f3012a1
22 DIST wine-3.13.tar.xz 20551460 BLAKE2B 2f8b1c2f72761b3c5541b8760be3009295dc9482257539edce83aa9d6022b2e8a25e1cee4fe56b69808e51e338fd330db5da17dec5dea4ba7684b5d7eb7e77d5 SHA512 a07a3d2a19261f9251f165ca4c14871e6ebda4d3f99da16f9fc41f06e80cae3fb50aeab96628c7a739e635e896dbb31c55df8b42c4637a058f9035c664c93a59
23 DIST wine-3.14.tar.xz 20583696 BLAKE2B 5e9410c5dadd0c08cbe0e52b0170840492890784dbd1afc8f01ab50caac8443513133575fa6f64143276ce315dde8614f5ece4b3cd5568c224a3379c85619b63 SHA512 50dbbf8a832abfa01247b9d170c6e1fe4f722cc8868659512df7bc17efd7e9d618db10283baf1eda0f1e4abbcdd130be16dbdb8d5a91b155c2c441e50e2b43f1
24 +DIST wine-3.15.tar.xz 21402964 BLAKE2B fb74ae33b89612b894463b6381184737ddda7b8a23d939cefc207124529d2042051ae16959f0e752400c02ca1ee69a5870d809912b7ddc9f56c7377bcc643bf2 SHA512 3fb3f6a896eae53ef75a751e72f7431f9b6986b56738dc314bca9eff9d078e65d865ebb28cbb7a63aa571eb11cdaed20c21c36cec565f81610e348fd165e0f2a
25 DIST wine-3.3.tar.xz 19891048 BLAKE2B be77224e7add585f6bba77f436faa8bc9da4f4416d07e2fc67e29d5f9553b03ae8cef12fcb8dee917d84bb5a1c66af16d3140b17b195f2db58464ffe86ff7d9e SHA512 c9e4c75e94d745837208bf877b19c4e4e46df1e78082d21e716f52c9f9d93eaabbec8bf34783cda68e4275f53e37929b81ac128e5b8a13c1e5035223b2621d6a
26 DIST wine-3.4.tar.xz 19932472 BLAKE2B 8cac5d2c8b3cfb7377f8c3b0aaac6326afd1bda5a9203c9705ea473c43483475d80b23a53e40f2c17af256f523ad759525701b20ac8d600b662b34845ea9414b SHA512 5787bf3fa13d363302ee26f86b96ed728b2b06184572021efdbb00b2c8ebd088056c6d9e22c6c78f0edc0a0b12e26facccc51f08970c8c5eaab4309e86b4286c
27 DIST wine-3.5.tar.xz 19963436 BLAKE2B 83d7c0719a088f8c705f7a9d8a6df6b9ee5e0a5ffa57c0a921875097be29298bebb9025222039432c65da32359e187a93413e04a5bb73171f0033911595baf9f SHA512 c1e36f3db862fdedd00c3ac20c84c6eb799b53fe32e959b481a6168baf7d9725ed9bd0a97e7f9b651e3ccfba4f8fb623445369be03fde5010ed0fcb0a53e7d3f
28 @@ -60,6 +61,7 @@ DIST wine-staging-3.11.tar.gz 9950753 BLAKE2B bffc6a86b652695d9ed4e0e2ce6f165e45
29 DIST wine-staging-3.12.tar.gz 9936375 BLAKE2B 5c48fb1037d39ce6ab78c03a002b2edfc2fc434c0f661bb6def050becd7411998b9ae763db99bda3b5190e3e6ab355699806d976d01f813904080c6156dafb7e SHA512 166f991f7c8f59df656f3fb28150a8e26e48d1ff6906b3eccd31cb84524e28efe7e7df00eadc21881940308ccc4b4edebcb2a71bdd03ba3de5beb1cf42e2f058
30 DIST wine-staging-3.13.tar.gz 9936353 BLAKE2B f5791c6f1bc43395860ea938cfadefe88e6839e44d6e3a8c5b9474e1ec17654645145459a2a9c32adbec6a5cd6441f754b0121958ff4c12e424262bb61c18358 SHA512 0124950cc18d566daecc532a432bce27d712f48eaaa9b37bf930e056b460e30a8fb1806aa179f72b44a95dc56963a3dc063b4acb71affb7b8ddff3001fe59b9a
31 DIST wine-staging-3.14.tar.gz 9938677 BLAKE2B 0f801298ad23d24688d072236bfa5b9fc549e1ecb964912f90029efd71fab27a38661df27433b52d1356a2b800c9a7c39d91ae08f60eb2deaf211d97a1ba60b7 SHA512 f998baac6be3fece1ae6d4e924f883befea43f849d678c987e9fe4d102cf22fde7b4a0fa728294c46d70c7d29caa037022fb9e33ce4b4fac0e49c94d25cdfa66
32 +DIST wine-staging-3.15.tar.gz 9941091 BLAKE2B 5a0e37ce52ff3e6130434aa56953e70fafb0c83dc33fa1ad7562a9244821ae75c30b9c858c7506462348b6d13016c236a14bde0297bc43d2d282d60c6c012470 SHA512 f0ed9d4a099b03c04a126927919b7eddbdaff7a08a0b97cdf387c64318826d6454183cf03997425b349540d13b1ccf6262aa2c5af0af682939584e3de71b7541
33 DIST wine-staging-3.3.tar.gz 10136486 BLAKE2B ea64e19fe987125bcdb0c5281e389574fe300225adc62eaff9be4f751642fba863acd4580e80e041fb4d4881f7861a4c093944abeca3a1a786b713278f5bf6d5 SHA512 02d48a9c403b93d01ca37b74af5dc81f86e49c72d67f194c71ccebd4556fa72c473728a1b1f9d5325c6f85f4e41bb7072a1183a2d81cafa8888e00dc53d12166
34 DIST wine-staging-3.4.tar.gz 10117160 BLAKE2B f5a15718732afe25c92d3b245d270db4e161fc755fe50d83f9646d0dcdf076ea91af3955c35e8f8a08648e860c74cc59ba0adc8c626290e48e4f21bf41374a45 SHA512 f0cc2b3d91589a4d9536c1011001edf7db428387592407a64949381c0ac2f0bb79b0fbf04d3c85db50adbecba716188a8249e1ff166b5ec3004d9eb5f9e92f3f
35 DIST wine-staging-3.5.tar.gz 10024748 BLAKE2B b5399bd22fd1edc1e22ee82e19bb9e54d4d12e771cfa0578dfc69d5cc18c0b6c1dba8e9c522ffddd14c187e012f33196738035dd34b45d71f48eac96997fd8b5 SHA512 39ce4fccac408d69c55fe53376744d218d546d09fc3fcaa5c8e87ba070de5ed52128ebdf0ed76cb5e3a5178a79c8fb25a8786b129e8b3eb59156732d7a4bf15c
36
37 diff --git a/app-emulation/wine-staging/wine-staging-3.15.ebuild b/app-emulation/wine-staging/wine-staging-3.15.ebuild
38 new file mode 100644
39 index 0000000..2977288
40 --- /dev/null
41 +++ b/app-emulation/wine-staging/wine-staging-3.15.ebuild
42 @@ -0,0 +1,612 @@
43 +# Copyright 1999-2018 Gentoo Foundation
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI=6
47 +
48 +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"
49 +PLOCALE_BACKUP="en"
50 +
51 +inherit autotools estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator xdg-utils
52 +
53 +MY_PN="${PN%%-*}"
54 +MY_P="${MY_PN}-${PV}"
55 +
56 +if [[ ${PV} == "9999" ]] ; then
57 + EGIT_REPO_URI="https://source.winehq.org/git/wine.git"
58 + EGIT_BRANCH="master"
59 + inherit git-r3
60 + SRC_URI=""
61 + #KEYWORDS=""
62 +else
63 + MAJOR_V=$(get_version_component_range 1)
64 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
65 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
66 +fi
67 +S="${WORKDIR}/${MY_P}"
68 +
69 +STAGING_P="wine-staging-${PV}"
70 +STAGING_DIR="${WORKDIR}/${STAGING_P}"
71 +GWP_V="20180120"
72 +PATCHDIR="${WORKDIR}/gentoo-wine-patches"
73 +
74 +DESCRIPTION="Free implementation of Windows(tm) on Unix, with Wine-Staging patchset"
75 +HOMEPAGE="https://www.winehq.org/"
76 +SRC_URI="${SRC_URI}
77 + https://dev.gentoo.org/~np-hardass/distfiles/wine/gentoo-wine-patches-${GWP_V}.tar.xz
78 +"
79 +
80 +if [[ ${PV} == "9999" ]] ; then
81 + STAGING_EGIT_REPO_URI="https://github.com/wine-staging/wine-staging.git"
82 +else
83 + SRC_URI="${SRC_URI}
84 + staging? ( https://github.com/wine-staging/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
85 +fi
86 +
87 +LICENSE="LGPL-2.1"
88 +SLOT="${PV}"
89 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc ffmpeg +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 pipelight +png prelink pulseaudio +realtime +run-exes samba scanner sdl selinux +ssl staging test themes +threads +truetype udev +udisks v4l vaapi vkd3d vulkan +X +xcomposite xinerama +xml"
90 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
91 + X? ( truetype )
92 + elibc_glibc? ( threads )
93 + ffmpeg? ( staging )
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 + ffmpeg? ( >=media-video/ffmpeg-4:=[${MULTILIB_USEDEP}] )
118 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
119 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
120 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
121 + gssapi? ( virtual/krb5[${MULTILIB_USEDEP}] )
122 + gstreamer? (
123 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
124 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
125 + )
126 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
127 + kerberos? ( virtual/krb5:0=[${MULTILIB_USEDEP}] )
128 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
129 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
130 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
131 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
132 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
133 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
134 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
135 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
136 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
137 + opengl? (
138 + virtual/glu[${MULTILIB_USEDEP}]
139 + virtual/opengl[${MULTILIB_USEDEP}]
140 + )
141 + osmesa? ( >=media-libs/mesa-13[osmesa,${MULTILIB_USEDEP}] )
142 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
143 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
144 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
145 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
146 + sdl? ( media-libs/libsdl2:=[haptic,joystick,${MULTILIB_USEDEP}] )
147 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
148 + staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
149 + themes? (
150 + dev-libs/glib:2[${MULTILIB_USEDEP}]
151 + x11-libs/cairo[${MULTILIB_USEDEP}]
152 + x11-libs/gtk+:3[${MULTILIB_USEDEP}]
153 + )
154 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
155 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
156 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
157 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
158 + vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
159 + vkd3d? ( app-emulation/vkd3d[${MULTILIB_USEDEP}] )
160 + vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
161 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
162 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
163 + xml? (
164 + dev-libs/libxml2[${MULTILIB_USEDEP}]
165 + dev-libs/libxslt[${MULTILIB_USEDEP}]
166 + )"
167 +
168 +RDEPEND="${COMMON_DEPEND}
169 + app-emulation/wine-desktop-common
170 + >app-eselect/eselect-wine-0.3
171 + !app-emulation/wine:0
172 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
173 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
174 + mono? ( app-emulation/wine-mono:4.7.3 )
175 + perl? (
176 + dev-lang/perl
177 + dev-perl/XML-Simple
178 + )
179 + pulseaudio? (
180 + realtime? ( sys-auth/rtkit )
181 + )
182 + samba? ( >=net-fs/samba-3.0.25[winbind] )
183 + selinux? ( sec-policy/selinux-wine )
184 + udisks? ( sys-fs/udisks:2 )"
185 +
186 +# tools/make_requests requires perl
187 +DEPEND="${COMMON_DEPEND}
188 + sys-devel/flex
189 + >=sys-kernel/linux-headers-2.6
190 + virtual/pkgconfig
191 + virtual/yacc
192 + X? ( x11-base/xorg-proto )
193 + prelink? ( sys-devel/prelink )
194 + staging? (
195 + dev-lang/perl
196 + dev-perl/XML-Simple
197 + )
198 + xinerama? ( x11-base/xorg-proto )"
199 +
200 +# These use a non-standard "Wine" category, which is provided by
201 +# /etc/xdg/applications-merged/wine.menu
202 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
203 +usr/share/applications/wine-notepad.desktop
204 +usr/share/applications/wine-uninstaller.desktop
205 +usr/share/applications/wine-winecfg.desktop"
206 +
207 +PATCHES=(
208 + "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
209 + "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
210 + "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
211 + "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
212 +)
213 +PATCHES_BIN=()
214 +
215 +# https://bugs.gentoo.org/show_bug.cgi?id=635222
216 +if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${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 "environmental variables WINE_COMMIT, and STAGING_COMMIT."
314 + eerror
315 + return 1
316 + fi
317 + fi
318 + if [[ ! -z ${EGIT_COMMIT} ]]; then
319 + eerror "Commits must now be specified using the environmental variables"
320 + eerror "WINE_COMMIT, STAGING_COMMIT, and D3D9_COMMIT"
321 + eerror
322 + return 1
323 + fi
324 +}
325 +
326 +pkg_pretend() {
327 + wine_build_environment_check || die
328 +
329 + # Verify OSS support
330 + if use oss && ! use kernel_FreeBSD; then
331 + if ! has_version ">=media-sound/oss-4"; then
332 + eerror "You cannot build wine with USE=oss without having support from a"
333 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
334 + eerror
335 + die
336 + fi
337 + fi
338 +}
339 +
340 +pkg_setup() {
341 + wine_build_environment_check || die
342 + wine_env_vcs_vars || die
343 +
344 + WINE_VARIANT="${PN#wine}-${PV}"
345 + WINE_VARIANT="${WINE_VARIANT#-}"
346 +
347 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
348 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
349 + MY_DATADIR="${MY_DATAROOTDIR}"
350 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
351 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
352 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
353 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
354 + MY_MANDIR="${MY_DATADIR}/man"
355 +}
356 +
357 +src_unpack() {
358 + if [[ ${PV} == "9999" ]] ; then
359 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
360 + if use staging; then
361 + local CURRENT_WINE_COMMIT=${EGIT_VERSION}
362 +
363 + git-r3_fetch "${STAGING_EGIT_REPO_URI}" "${STAGING_COMMIT}"
364 + git-r3_checkout "${STAGING_EGIT_REPO_URI}" "${STAGING_DIR}"
365 +
366 + local COMPAT_WINE_COMMIT=$("${STAGING_DIR}/patches/patchinstall.sh" --upstream-commit) || die
367 +
368 + if [[ "${CURRENT_WINE_COMMIT}" != "${COMPAT_WINE_COMMIT}" ]]; then
369 + einfo "The current Staging patchset is not guaranteed to apply on this WINE commit."
370 + einfo "If src_prepare fails, try emerging with the env var WINE_COMMIT."
371 + einfo "Example: WINE_COMMIT=${COMPAT_WINE_COMMIT} emerge -1 wine"
372 + fi
373 + fi
374 + fi
375 +
376 + default
377 +
378 + l10n_find_plocales_changes "${S}/po" "" ".po"
379 +}
380 +
381 +src_prepare() {
382 +
383 + eapply_bin(){
384 + local patch
385 + for patch in ${PATCHES_BIN[@]}; do
386 + patchbin --nogit < "${patch}" || die
387 + done
388 + }
389 +
390 + local md5="$(md5sum server/protocol.def)"
391 +
392 + if use staging; then
393 + ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
394 + ewarn "Wine bugzilla should explicitly state that staging was used."
395 +
396 + local STAGING_EXCLUDE=""
397 + use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
398 +
399 + # Launch wine-staging patcher in a subshell, using eapply as a backend, and gitapply.sh as a backend for binary patches
400 + ebegin "Running Wine-Staging patch installer"
401 + (
402 + set -- DESTDIR="${S}" --backend=eapply --no-autoconf --all ${STAGING_EXCLUDE}
403 + cd "${STAGING_DIR}/patches"
404 + source "${STAGING_DIR}/patches/patchinstall.sh"
405 + )
406 + eend $? || die "Failed to apply Wine-Staging patches"
407 + fi
408 +
409 + default
410 + eapply_bin
411 + eautoreconf
412 +
413 + # Modification of the server protocol requires regenerating the server requests
414 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
415 + einfo "server/protocol.def was patched; running tools/make_requests"
416 + tools/make_requests || die #432348
417 + fi
418 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
419 + if ! use run-exes; then
420 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
421 + fi
422 +
423 + # Edit wine.desktop to work for specific variant
424 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
425 +
426 + # hi-res default icon, #472990, https://bugs.winehq.org/show_bug.cgi?id=24652
427 + cp "${PATCHDIR}/files/oic_winlogo.ico" dlls/user32/resources/ || die
428 +
429 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
430 +
431 + # Fix manpage generation for locales #469418 and abi_x86_64 #617864
432 +
433 + # Duplicate manpages input files for wine64
434 + local f
435 + for f in loader/*.man.in; do
436 + cp ${f} ${f/wine/wine64} || die
437 + done
438 + # Add wine64 manpages to Makefile
439 + if use abi_x86_64; then
440 + sed -i "/wine.man.in/i \
441 + \\\twine64.man.in \\\\" loader/Makefile.in || die
442 + sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
443 +\164\2/' loader/Makefile.in || die
444 + fi
445 +
446 + rm_man_file(){
447 + local file="${1}"
448 + loc=${2}
449 + sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
450 + }
451 +
452 + while read f; do
453 + l10n_for_each_disabled_locale_do rm_man_file "${f}"
454 + done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
455 +}
456 +
457 +src_configure() {
458 + wine_compiler_check || die
459 +
460 + export LDCONFIG=/bin/true
461 + use custom-cflags || strip-flags
462 +
463 + multilib-minimal_src_configure
464 +}
465 +
466 +multilib_src_configure() {
467 + local myconf=(
468 + --prefix="${MY_PREFIX}"
469 + --datarootdir="${MY_DATAROOTDIR}"
470 + --datadir="${MY_DATADIR}"
471 + --docdir="${MY_DOCDIR}"
472 + --includedir="${MY_INCLUDEDIR}"
473 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
474 + --libexecdir="${MY_LIBEXECDIR}"
475 + --localstatedir="${MY_LOCALSTATEDIR}"
476 + --mandir="${MY_MANDIR}"
477 + --sysconfdir=/etc/wine
478 + $(use_with alsa)
479 + $(use_with capi)
480 + $(use_with lcms cms)
481 + $(use_with cups)
482 + $(use_with ncurses curses)
483 + $(use_with udisks dbus)
484 + $(use_with ffmpeg)
485 + $(use_with fontconfig)
486 + $(use_with ssl gnutls)
487 + $(use_enable gecko mshtml)
488 + $(use_with gphoto2 gphoto)
489 + $(use_with gsm)
490 + $(use_with gssapi)
491 + $(use_with gstreamer)
492 + --without-hal
493 + $(use_with jpeg)
494 + $(use_with kerberos krb5)
495 + $(use_with ldap)
496 + $(use_enable mono mscoree)
497 + $(use_with mp3 mpg123)
498 + $(use_with netapi)
499 + $(use_with nls gettext)
500 + $(use_with openal)
501 + $(use_with opencl)
502 + $(use_with opengl)
503 + $(use_with osmesa)
504 + $(use_with oss)
505 + $(use_with pcap)
506 + $(use_with png)
507 + $(use_with pulseaudio pulse)
508 + $(use_with threads pthread)
509 + $(use_with scanner sane)
510 + $(use_with sdl)
511 + $(use_enable test tests)
512 + $(use_with truetype freetype)
513 + $(use_with udev)
514 + $(use_with v4l)
515 + $(use_with vkd3d)
516 + $(use_with vulkan)
517 + $(use_with X x)
518 + $(use_with X xfixes)
519 + $(use_with xcomposite)
520 + $(use_with xinerama)
521 + $(use_with xml)
522 + $(use_with xml xslt)
523 + )
524 +
525 + use staging && myconf+=(
526 + --with-xattr
527 + $(use_with themes gtk3)
528 + $(use_with vaapi va)
529 + )
530 +
531 + local PKG_CONFIG AR RANLIB
532 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
533 + # set AR and RANLIB to make QA scripts happy; #483342
534 + tc-export PKG_CONFIG AR RANLIB
535 +
536 + if use amd64; then
537 + if [[ ${ABI} == amd64 ]]; then
538 + myconf+=( --enable-win64 )
539 + else
540 + myconf+=( --disable-win64 )
541 + fi
542 +
543 + # Note: using --with-wine64 results in problems with multilib.eclass
544 + # CC/LD hackery. We're using separate tools instead.
545 + fi
546 +
547 + ECONF_SOURCE=${S} \
548 + econf "${myconf[@]}"
549 + emake depend
550 +}
551 +
552 +multilib_src_test() {
553 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
554 + if [[ ${ABI} == x86 ]]; then
555 + if [[ $(id -u) == 0 ]]; then
556 + ewarn "Skipping tests since they cannot be run under the root user."
557 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
558 + return
559 + fi
560 +
561 + WINEPREFIX="${T}/.wine-${ABI}" \
562 + Xemake test
563 + fi
564 +}
565 +
566 +multilib_src_install_all() {
567 + local DOCS=( ANNOUNCE AUTHORS README )
568 + add_locale_docs() {
569 + local locale_doc="documentation/README.$1"
570 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
571 + }
572 + l10n_for_each_locale_do add_locale_docs
573 +
574 + einstalldocs
575 + prune_libtool_files --all
576 +
577 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
578 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
579 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
580 + fi
581 +
582 + # Remove wineconsole if neither backend is installed #551124
583 + if ! use X && ! use ncurses; then
584 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
585 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
586 + rm_wineconsole() {
587 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
588 + }
589 + multilib_foreach_abi rm_wineconsole
590 + fi
591 +
592 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
593 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
594 +
595 + if use abi_x86_64 && ! use abi_x86_32; then
596 + dosym wine64 "${MY_PREFIX}"/bin/wine # 404331
597 + dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
598 + fi
599 +
600 + # Failglob for binloops, shouldn't be necessary, but including to stay safe
601 + eshopts_push -s failglob #615218
602 + # Make wrappers for binaries for handling multiple variants
603 + # Note: wrappers instead of symlinks because some are shell which use basename
604 + local b
605 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
606 + make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
607 + done
608 + eshopts_pop
609 +}
610 +
611 +pkg_postinst() {
612 + eselect wine register ${P}
613 + if [[ ${PN} == "wine-vanilla" ]]; then
614 + eselect wine register --vanilla ${P} || die
615 + else
616 + if use staging; then
617 + eselect wine register --staging ${P} || die
618 + fi
619 + fi
620 +
621 + eselect wine update --all --if-unset || die
622 +
623 + xdg_desktop_database_update
624 +
625 + if ! use gecko; then
626 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
627 + ewarn "implementation of iexplore. Many older windows applications"
628 + ewarn "rely upon the existence of an iexplore implementation, so"
629 + ewarn "you will likely need to install an external one, like via winetricks"
630 + fi
631 + if ! use mono; then
632 + ewarn "Without Wine Mono, wine prefixes will not have a default"
633 + ewarn "implementation of .NET. Many windows applications rely upon"
634 + ewarn "the existence of a .NET implementation, so you will likely need"
635 + ewarn "to install an external one, like via winetricks"
636 + fi
637 +}
638 +
639 +pkg_prerm() {
640 + eselect wine deregister ${P}
641 + if [[ ${PN} == "wine-vanilla" ]]; then
642 + eselect wine deregister --vanilla ${P} || die
643 + else
644 + if use staging; then
645 + eselect wine deregister --staging ${P} || die
646 + fi
647 + fi
648 +
649 + eselect wine update --all --if-unset || die
650 +}
651 +
652 +pkg_postrm() {
653 + xdg_desktop_database_update
654 +}