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