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