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, 30 Nov 2019 19:50:24
Message-Id: 1575143391.5f46c91f9d628afad455eee084f7237320c782bd.sarnex@gentoo
1 commit: 5f46c91f9d628afad455eee084f7237320c782bd
2 Author: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 30 19:49:51 2019 +0000
4 Commit: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 30 19:49:51 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/wine.git/commit/?id=5f46c91f
7
8 app-emulation/wine-staging: Bump to 4.21
9
10 Package-Manager: Portage-2.3.80, Repoman-2.3.19
11 Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>
12
13 app-emulation/wine-staging/Manifest | 2 +
14 .../wine-staging/wine-staging-4.21.ebuild | 620 +++++++++++++++++++++
15 2 files changed, 622 insertions(+)
16
17 diff --git a/app-emulation/wine-staging/Manifest b/app-emulation/wine-staging/Manifest
18 index a9df29c..963c5a1 100644
19 --- a/app-emulation/wine-staging/Manifest
20 +++ b/app-emulation/wine-staging/Manifest
21 @@ -16,6 +16,7 @@ DIST wine-4.18.tar.xz 22263936 BLAKE2B 710d6d90ff1ef9adeb5bb9012c8f354985c1610f4
22 DIST wine-4.19.tar.xz 22283616 BLAKE2B 0d648d931737bc381bca3ad0fa2bfcc089c8324c47c80bdaa85aaddb5a63f5145ef5cc442da299591edbd1723ff1dd49fbf629363ec5e4c6152b7016aed612f3 SHA512 a86bd7ccfb1878445ea946e4ca72769c10b4d966bcc893536a8c3eaa29484ba687dc3a44755ec92a2ad6073e736985b814c0c682bf4f90b5ffe2bca0ebbf4b25
23 DIST wine-4.2.tar.xz 21724960 BLAKE2B d3c4381265e5086a17582c28fd4d19c84ed8e9839d039d5f2eba32efcc09ae6dad2a25fa375042d98d35de30065eaa0095e36bb8fbca608ec74abc654bae5196 SHA512 408a846e92a0222f64ddd3c4d2c2a71b387ce51749e346c1fbca1fd57db910fa18dc6bb4ce0a350bef81e13be77c6b2d74537f7a1c0dcbb0e6d4c19d1ade288c
24 DIST wine-4.20.tar.xz 22314856 BLAKE2B c3734029583bf17929a92475f4ad3ac97df632d967b9f7fc2d9f076a7f8492ec144b41227812271703ee665a6a17e9b1e3eed6697d5f7394824d3783fcd8de5a SHA512 c01af88106b8a808fbceb6ace45882c300656a47913142ba7052283b358d6d5b4379895804e15a2ca1870a4e955ea3ca857ec042a8070ea4ffaefa0c7a84e701
25 +DIST wine-4.21.tar.xz 22395844 BLAKE2B 1b9c1fd8f4a1ff0527b4d4a02b1dfffa4f6887f2f261b7d4b5afa12e65a8ea18f544c91397cfc71039db7736d33cd0219aaab82cc4564ecd0cb9c74a2e39d6e5 SHA512 f962e47577db2de4e74022b8d51e81e30a004f98b37d8eee5889334271f013123e3ff53e5ac1416c2dd93ec90bee8a2d300b3842c20124df99ef067ac5c72f53
26 DIST wine-4.3.tar.xz 21764500 BLAKE2B dd94b710f2be20ce3225fb58e0a20f0ee46e59834dc77383e262620faa64597c41625382237c39563b3bb67b1850cca2460ca147e2c5ee3052f0fdfdee067ec5 SHA512 45c0519f8f2873ef65e1761d518a7148f3aa54c0e993a41a60849c01c8df17386d57edd83308cff289300adc6a8e3fc5918fb12513f5b85a88e556b420479e83
27 DIST wine-4.4.tar.xz 21805668 BLAKE2B cf973240a3f2a1ad1cac8690cdc5cd86be428220395d90bfe3b15567e6a2be0bb78e5828de3b77b617827122f5b0bb1dfeeef351102ca001722340ceaeb5625e SHA512 6678c9b0e086bdc9fab9f9fd2517226352b49f846bbae7be6000bb60db2f302aad49622192077b45880d45ad33ba4d82bfe3403fb82a1e65159f1352b40933de
28 DIST wine-4.5.tar.xz 21879868 BLAKE2B fc2bc13fefac97570a67a1c48a0144c1194896f779803efc0c3229fc234f128f53c78cadb1d47d28ec6772ecea73831c8850322e537aa1af62b537b7856ecae5 SHA512 261420efdf14595715cff5bb6a61223b0f2090b89dc05dca8c053a8a81abc3018715d41db50769a0f0488c658efc0742ac0f577b578e69eace70be4e463131dd
29 @@ -37,6 +38,7 @@ DIST wine-staging-4.18.tar.gz 9917480 BLAKE2B 477da02f5177e7efad33ca30267b2a8755
30 DIST wine-staging-4.19.tar.gz 9908545 BLAKE2B 36674228de808ac9d1f3f66e9274fd9de68173a6a1acca405eb08836a8a787e4e78465442ef6769c02f8fd2e20c3f059d59a1408ed3a8add8a91a68efd07b7bc SHA512 a47ae16dd39797b54011f942fe7e722897af7ddc0bed2bf2e39c46aecf60a02769f7287609c63b4c0c3f1c8e40172e0cdf3bdb53562a07d7a2b7ac53e570dbdc
31 DIST wine-staging-4.2.tar.gz 9850260 BLAKE2B 938d12bb44acef2920c6a47978f170cab532ddd785de394dddc95cc359b301e0db26a3ec9aa08abaf03542b59a97c16dfebb3bf5e4c9ddc9bed829200e529bb9 SHA512 2fb66bdeab084231983569d3884211a4d269a48bd6b25ba2e7c7e83d2dc98a205bd92dfc67c09528d57192086571d3f4f6c988c522b25aade1d525b74e662f2e
32 DIST wine-staging-4.20.tar.gz 9899451 BLAKE2B a90a71f8f68874822c7326eb13cd26e66dfce8afc6d8fc60f1cf86a20c1a8074178bbc618b540a4bac5168fb0242a0fe46c9167bab3e587462d78b706eaad15c SHA512 2ce4f6fa83fc275c83bc7f7bbd4b1a4ca65f7e55e16af40958635b8b2efc2b174baa79ed576ed09c4c13b572756fb6262f19281e5b72797c7e0f1f6c4dd1a4ee
33 +DIST wine-staging-4.21.tar.gz 9904765 BLAKE2B 43f15cd96c7f5ca9cf5aad120c73a3aa534dce33797a4a4e707bea668cfc93e077ad112055dc428263775a30c6447620eed8650a9828ac487bf36c6490a7b73d SHA512 0c6c32f86d252f827ebb8d5df2b046c4f0a49aa7c0ca47939b33844786e561d5f676db1e199ec3cd9969757985f66b865099061f5e77234c3aabd4fd29d3a063
34 DIST wine-staging-4.3.tar.gz 9888763 BLAKE2B 095f2789f601822e34b7f9d0a078bd433aa2861e7cc55d5b74520bfedc2c88064bbffa3a73bcea170c4e4fb96e9eaa50f0cb927aba2cc6d1f12480bacfa49968 SHA512 9fd89c54200cf7c8e8a7f978fb6b34c89ece755976789f5c5c361ffb8d2882f14260c81ab8ac14ad140e41d807adbbaba05381a31b0177492aa222ef2fe04e4d
35 DIST wine-staging-4.4.tar.gz 9882230 BLAKE2B 705841e14abf3e3e65ae4b64ac2613f42f0e8caf32258ef6fc7e78b5410038c7cc766293488bb110e1f4c2c06d6b55b4cd3e59acea7e0f15c3bb6304e427f891 SHA512 4ddeddac2e2de9afd95ded71edb47f3eac15d1ca94254481e5369d6b69e401471b00ba16747621eb2d0f7d92c0558590f6efe89b3ea15012d9d3d45553d49196
36 DIST wine-staging-4.5.tar.gz 9859696 BLAKE2B 3d6ea22659fe45fe6cbe0f292737d4238e9f32b307b1750debfcb628a72b1dfc8a486c644a78c2d0285a206d13644ecc3bd26a307e61f78cc118219bf3395ec6 SHA512 fda32b26de79bd3bbff6b1ab2249d7ff8adc7e8da2753271e8dae4f84bc71764ea6d1a887cc643e0ff70b217bd75fefebd3eb1bd4b6faace9a36399878998029
37
38 diff --git a/app-emulation/wine-staging/wine-staging-4.21.ebuild b/app-emulation/wine-staging/wine-staging-4.21.ebuild
39 new file mode 100644
40 index 0000000..a2a1c58
41 --- /dev/null
42 +++ b/app-emulation/wine-staging/wine-staging-4.21.ebuild
43 @@ -0,0 +1,620 @@
44 +# Copyright 1999-2019 Gentoo Authors
45 +# Distributed under the terms of the GNU General Public License v2
46 +
47 +EAPI=6
48 +
49 +PLOCALES="ar ast bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru si sk sl sr_RS@cyrillic sr_RS@latin sv ta te th tr uk wa zh_CN zh_TW"
50 +PLOCALE_BACKUP="en"
51 +
52 +inherit autotools eapi7-ver estack eutils flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx xdg-utils
53 +
54 +MY_PN="${PN%%-*}"
55 +MY_P="${MY_PN}-${PV}"
56 +
57 +if [[ ${PV} == "9999" ]] ; then
58 + EGIT_REPO_URI="https://source.winehq.org/git/wine.git"
59 + EGIT_BRANCH="master"
60 + inherit git-r3
61 + SRC_URI=""
62 + #KEYWORDS=""
63 +else
64 + MAJOR_V=$(ver_cut 1)
65 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
66 + KEYWORDS="-* ~amd64 ~x86"
67 +fi
68 +S="${WORKDIR}/${MY_P}"
69 +
70 +STAGING_P="wine-staging-${PV}"
71 +STAGING_DIR="${WORKDIR}/${STAGING_P}"
72 +GWP_V="20190511"
73 +PATCHDIR="${WORKDIR}/gentoo-wine-patches"
74 +
75 +DESCRIPTION="Free implementation of Windows(tm) on Unix, with Wine-Staging patchset"
76 +HOMEPAGE="https://www.winehq.org/"
77 +SRC_URI="${SRC_URI}
78 + https://dev.gentoo.org/~sarnex/distfiles/wine/gentoo-wine-patches-${GWP_V}.tar.xz
79 +"
80 +
81 +if [[ ${PV} == "9999" ]] ; then
82 + STAGING_EGIT_REPO_URI="https://github.com/wine-staging/wine-staging.git"
83 +else
84 + SRC_URI="${SRC_URI}
85 + staging? ( https://github.com/wine-staging/wine-staging/archive/v${PV}.tar.gz -> ${STAGING_P}.tar.gz )"
86 +fi
87 +
88 +LICENSE="LGPL-2.1"
89 +SLOT="${PV}"
90 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +faudio 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 + faudio? ( app-emulation/faudio:=[${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.9.4 )
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}-4.8-winegcc.patch" #260726
211 + "${PATCHDIR}/patches/${MY_PN}-4.7-multilib-portage.patch" #395615
212 + "${PATCHDIR}/patches/${MY_PN}-4.7-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 "environment variables:"
316 + eerror " EGIT_OVERRIDE_COMMIT_WINE"
317 + eerror " EGIT_OVERRIDE_COMMIT_WINE_STAGING_WINE_STAGING"
318 + eerror
319 + return 1
320 + fi
321 + fi
322 + if [[ ! -z ${EGIT_COMMIT} ]]; then
323 + eerror "Commits must now be specified using the environment variables:"
324 + eerror " EGIT_OVERRIDE_COMMIT_WINE"
325 + eerror " EGIT_OVERRIDE_COMMIT_WINE_STAGING_WINE_STAGING"
326 + eerror
327 + return 1
328 + fi
329 +}
330 +
331 +pkg_pretend() {
332 + wine_build_environment_check || die
333 +
334 + # Verify OSS support
335 + if use oss && ! use kernel_FreeBSD; then
336 + if ! has_version ">=media-sound/oss-4"; then
337 + eerror "You cannot build wine with USE=oss without having support from a"
338 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
339 + eerror
340 + die
341 + fi
342 + fi
343 +}
344 +
345 +pkg_setup() {
346 + wine_build_environment_check || die
347 + wine_env_vcs_vars || die
348 +
349 + WINE_VARIANT="${PN#wine}-${PV}"
350 + WINE_VARIANT="${WINE_VARIANT#-}"
351 +
352 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
353 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
354 + MY_DATADIR="${MY_DATAROOTDIR}"
355 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
356 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
357 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
358 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
359 + MY_MANDIR="${MY_DATADIR}/man"
360 +}
361 +
362 +src_unpack() {
363 + if [[ ${PV} == "9999" ]] ; then
364 + EGIT_CHECKOUT_DIR="${S}" git-r3_src_unpack
365 + if use staging; then
366 + local CURRENT_WINE_COMMIT=${EGIT_VERSION}
367 +
368 + EGIT_CHECKOUT_DIR="${STAGING_DIR}" EGIT_REPO_URI="${STAGING_EGIT_REPO_URI}" git-r3_src_unpack
369 +
370 + local COMPAT_WINE_COMMIT=$("${STAGING_DIR}/patches/patchinstall.sh" --upstream-commit) || die
371 +
372 + if [[ "${CURRENT_WINE_COMMIT}" != "${COMPAT_WINE_COMMIT}" ]]; then
373 + einfo "The current Staging patchset is not guaranteed to apply on this WINE commit."
374 + einfo "If src_prepare fails, try emerging with the env var WINE_COMMIT."
375 + einfo "Example: EGIT_OVERRIDE_COMMIT_WINE=${COMPAT_WINE_COMMIT} emerge -1 wine"
376 + fi
377 + fi
378 + fi
379 +
380 + default
381 +
382 + l10n_find_plocales_changes "${S}/po" "" ".po"
383 +}
384 +
385 +src_prepare() {
386 +
387 + eapply_bin(){
388 + local patch
389 + for patch in ${PATCHES_BIN[@]}; do
390 + patchbin --nogit < "${patch}" || die
391 + done
392 + }
393 +
394 + local md5="$(md5sum server/protocol.def)"
395 +
396 + if use staging; then
397 + ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
398 + ewarn "Wine bugzilla should explicitly state that staging was used."
399 +
400 + local STAGING_EXCLUDE=""
401 + use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
402 +
403 + # Launch wine-staging patcher in a subshell, using eapply as a backend, and gitapply.sh as a backend for binary patches
404 + ebegin "Running Wine-Staging patch installer"
405 + (
406 + set -- DESTDIR="${S}" --backend=eapply --no-autoconf --all ${STAGING_EXCLUDE}
407 + cd "${STAGING_DIR}/patches"
408 + source "${STAGING_DIR}/patches/patchinstall.sh"
409 + )
410 + eend $? || die "Failed to apply Wine-Staging patches"
411 + fi
412 +
413 + default
414 + eapply_bin
415 + eautoreconf
416 +
417 + # Modification of the server protocol requires regenerating the server requests
418 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
419 + einfo "server/protocol.def was patched; running tools/make_requests"
420 + tools/make_requests || die #432348
421 + fi
422 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
423 + if ! use run-exes; then
424 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
425 + fi
426 +
427 + # Edit wine.desktop to work for specific variant
428 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
429 +
430 + # hi-res default icon, #472990, https://bugs.winehq.org/show_bug.cgi?id=24652
431 + cp "${PATCHDIR}/files/oic_winlogo.ico" dlls/user32/resources/ || die
432 +
433 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
434 +
435 + # Fix manpage generation for locales #469418 and abi_x86_64 #617864
436 +
437 + # Duplicate manpages input files for wine64
438 + local f
439 + for f in loader/*.man.in; do
440 + cp ${f} ${f/wine/wine64} || die
441 + done
442 + # Add wine64 manpages to Makefile
443 + if use abi_x86_64; then
444 + sed -i "/wine.man.in/i \
445 + \\\twine64.man.in \\\\" loader/Makefile.in || die
446 + sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
447 +\164\2/' loader/Makefile.in || die
448 + fi
449 +
450 + rm_man_file(){
451 + local file="${1}"
452 + loc=${2}
453 + sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
454 + }
455 +
456 + while read f; do
457 + l10n_for_each_disabled_locale_do rm_man_file "${f}"
458 + done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
459 +}
460 +
461 +src_configure() {
462 + wine_compiler_check || die
463 +
464 + export LDCONFIG=/bin/true
465 + use custom-cflags || strip-flags
466 +
467 + multilib-minimal_src_configure
468 +}
469 +
470 +multilib_src_configure() {
471 + local myconf=(
472 + --prefix="${MY_PREFIX}"
473 + --datarootdir="${MY_DATAROOTDIR}"
474 + --datadir="${MY_DATADIR}"
475 + --docdir="${MY_DOCDIR}"
476 + --includedir="${MY_INCLUDEDIR}"
477 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
478 + --libexecdir="${MY_LIBEXECDIR}"
479 + --localstatedir="${MY_LOCALSTATEDIR}"
480 + --mandir="${MY_MANDIR}"
481 + --sysconfdir="${EPREFIX}/etc/wine"
482 + $(use_with alsa)
483 + $(use_with capi)
484 + $(use_with lcms cms)
485 + $(use_with cups)
486 + $(use_with ncurses curses)
487 + $(use_with udisks dbus)
488 + $(use_with faudio)
489 + $(use_with ffmpeg)
490 + $(use_with fontconfig)
491 + $(use_with ssl gnutls)
492 + $(use_enable gecko mshtml)
493 + $(use_with gphoto2 gphoto)
494 + $(use_with gsm)
495 + $(use_with gssapi)
496 + $(use_with gstreamer)
497 + --without-hal
498 + $(use_with jpeg)
499 + $(use_with kerberos krb5)
500 + $(use_with ldap)
501 + --without-mingw # linux LDFLAGS leak in mingw32: bug #685172
502 + $(use_enable mono mscoree)
503 + $(use_with mp3 mpg123)
504 + $(use_with netapi)
505 + $(use_with nls gettext)
506 + $(use_with openal)
507 + $(use_with opencl)
508 + $(use_with opengl)
509 + $(use_with osmesa)
510 + $(use_with oss)
511 + $(use_with pcap)
512 + $(use_with png)
513 + $(use_with pulseaudio pulse)
514 + $(use_with threads pthread)
515 + $(use_with scanner sane)
516 + $(use_with sdl)
517 + $(use_enable test tests)
518 + $(use_with truetype freetype)
519 + $(use_with udev)
520 + $(use_with v4l v4l2)
521 + $(use_with vkd3d)
522 + $(use_with vulkan)
523 + $(use_with X x)
524 + $(use_with X xfixes)
525 + $(use_with xcomposite)
526 + $(use_with xinerama)
527 + $(use_with xml)
528 + $(use_with xml xslt)
529 + )
530 +
531 + use staging && myconf+=(
532 + --with-xattr
533 + $(use_with themes gtk3)
534 + $(use_with vaapi va)
535 + )
536 +
537 + local PKG_CONFIG AR RANLIB
538 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
539 + # set AR and RANLIB to make QA scripts happy; #483342
540 + tc-export PKG_CONFIG AR RANLIB
541 +
542 + if use amd64; then
543 + if [[ ${ABI} == amd64 ]]; then
544 + myconf+=( --enable-win64 )
545 + else
546 + myconf+=( --disable-win64 )
547 + fi
548 +
549 + # Note: using --with-wine64 results in problems with multilib.eclass
550 + # CC/LD hackery. We're using separate tools instead.
551 + fi
552 +
553 + ECONF_SOURCE=${S} \
554 + econf "${myconf[@]}"
555 + emake depend
556 +}
557 +
558 +multilib_src_test() {
559 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
560 + if [[ ${ABI} == x86 ]]; then
561 + if [[ $(id -u) == 0 ]]; then
562 + ewarn "Skipping tests since they cannot be run under the root user."
563 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
564 + return
565 + fi
566 +
567 + WINEPREFIX="${T}/.wine-${ABI}" \
568 + Xemake test
569 + fi
570 +}
571 +
572 +multilib_src_install_all() {
573 + local DOCS=( ANNOUNCE AUTHORS README )
574 + add_locale_docs() {
575 + local locale_doc="documentation/README.$1"
576 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
577 + }
578 + l10n_for_each_locale_do add_locale_docs
579 +
580 + einstalldocs
581 + prune_libtool_files --all
582 +
583 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
584 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
585 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
586 + fi
587 +
588 + # Remove wineconsole if neither backend is installed #551124
589 + if ! use X && ! use ncurses; then
590 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
591 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
592 + rm_wineconsole() {
593 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
594 + }
595 + multilib_foreach_abi rm_wineconsole
596 + fi
597 +
598 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
599 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
600 +
601 + # Avoid double prefix from dosym and make_wrapper
602 + MY_PREFIX=${MY_PREFIX#${EPREFIX}}
603 +
604 + if use abi_x86_64 && ! use abi_x86_32; then
605 + dosym wine64 "${MY_PREFIX}"/bin/wine # 404331
606 + dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
607 + fi
608 +
609 + # Failglob for binloops, shouldn't be necessary, but including to stay safe
610 + eshopts_push -s failglob #615218
611 + # Make wrappers for binaries for handling multiple variants
612 + # Note: wrappers instead of symlinks because some are shell which use basename
613 + local b
614 + for b in "${ED%/}${MY_PREFIX}"/bin/*; do
615 + make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
616 + done
617 + eshopts_pop
618 +}
619 +
620 +pkg_postinst() {
621 + eselect wine register ${P}
622 + if [[ ${PN} == "wine-vanilla" ]]; then
623 + eselect wine register --vanilla ${P} || die
624 + else
625 + if use staging; then
626 + eselect wine register --staging ${P} || die
627 + fi
628 + fi
629 +
630 + eselect wine update --all --if-unset || die
631 +
632 + xdg_desktop_database_update
633 +
634 + if ! use gecko; then
635 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
636 + ewarn "implementation of iexplore. Many older windows applications"
637 + ewarn "rely upon the existence of an iexplore implementation, so"
638 + ewarn "you will likely need to install an external one, like via winetricks"
639 + fi
640 + if ! use mono; then
641 + ewarn "Without Wine Mono, wine prefixes will not have a default"
642 + ewarn "implementation of .NET. Many windows applications rely upon"
643 + ewarn "the existence of a .NET implementation, so you will likely need"
644 + ewarn "to install an external one, like via winetricks"
645 + fi
646 +}
647 +
648 +pkg_prerm() {
649 + eselect wine deregister ${P}
650 + if [[ ${PN} == "wine-vanilla" ]]; then
651 + eselect wine deregister --vanilla ${P} || die
652 + else
653 + if use staging; then
654 + eselect wine deregister --staging ${P} || die
655 + fi
656 + fi
657 +
658 + eselect wine update --all --if-unset || die
659 +}
660 +
661 +pkg_postrm() {
662 + xdg_desktop_database_update
663 +}