Gentoo Archives: gentoo-commits

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