Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/wine-staging/
Date: Sat, 10 Sep 2022 09:48:37
Message-Id: 1662803235.ba10eaa465d5e3062caf00852de9dd52a4e81ae7.ionen@gentoo
1 commit: ba10eaa465d5e3062caf00852de9dd52a4e81ae7
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 9 18:21:46 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 10 09:47:15 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba10eaa4
7
8 app-emulation/wine-staging: sync live
9
10 Almost entirely different, so diff is not meaningful.
11 See previous commit for details (identical to 7.17).
12
13 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
14
15 .../wine-staging/wine-staging-9999.ebuild | 665 +++++++--------------
16 1 file changed, 232 insertions(+), 433 deletions(-)
17
18 diff --git a/app-emulation/wine-staging/wine-staging-9999.ebuild b/app-emulation/wine-staging/wine-staging-9999.ebuild
19 index 9cfa7dc58db7..8b3f0ce65d88 100644
20 --- a/app-emulation/wine-staging/wine-staging-9999.ebuild
21 +++ b/app-emulation/wine-staging/wine-staging-9999.ebuild
22 @@ -1,226 +1,142 @@
23 -# Copyright 1999-2022 Gentoo Authors
24 +# Copyright 2022 Gentoo Authors
25 # Distributed under the terms of the GNU General Public License v2
26
27 EAPI=8
28
29 -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"
30 -PLOCALE_BACKUP="en"
31 +MULTILIB_COMPAT=( abi_x86_{32,64} )
32 +inherit autotools flag-o-matic multilib multilib-build toolchain-funcs wrapper
33
34 -inherit autotools estack flag-o-matic multilib-minimal pax-utils plocale toolchain-funcs virtualx wrapper xdg-utils
35 -MY_PN="${PN%%-*}"
36 -MY_PV="${PV/_/-}"
37 -MY_P="${MY_PN}-${MY_PV}"
38 -GECKO_VERSION="2.47.3"
39 +WINE_GECKO=2.47.3
40 +WINE_MONO=7.3.0
41
42 -if [[ ${MY_PV} == "9999" ]] ; then
43 - EGIT_REPO_URI="https://source.winehq.org/git/wine.git"
44 - EGIT_BRANCH="master"
45 +if [[ ${PV} == *9999 ]]; then
46 inherit git-r3
47 - SRC_URI=""
48 - #KEYWORDS=""
49 + EGIT_REPO_URI="https://github.com/wine-staging/wine-staging.git"
50 + WINE_EGIT_REPO_URI="https://gitlab.winehq.org/wine/wine.git"
51 else
52 - MAJOR_V=$(ver_cut 1)
53 - MINOR_V=$(ver_cut 2)
54 - if [[ ${MINOR_V} != "0" ]] ; then
55 - MINOR_V="x"
56 - fi
57 - SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.${MINOR_V}/${MY_P}.tar.xz"
58 + (( $(ver_cut 2) )) && WINE_SDIR=$(ver_cut 1).x || WINE_SDIR=$(ver_cut 1).0
59 + SRC_URI="
60 + https://dl.winehq.org/wine/source/${WINE_SDIR}/wine-${PV}.tar.xz
61 + https://github.com/wine-staging/wine-staging/archive/v${PV}.tar.gz -> ${P}.tar.gz"
62 KEYWORDS="-* ~amd64 ~x86"
63 fi
64 -S="${WORKDIR}/${MY_P}"
65 -
66 -STAGING_P="wine-staging-${MY_PV}"
67 -STAGING_DIR="${WORKDIR}/${STAGING_P}"
68 -GWP_V="20211122"
69 -PATCHDIR="${WORKDIR}/gentoo-wine-patches"
70 +S="${WORKDIR}/wine-${PV}"
71
72 DESCRIPTION="Free implementation of Windows(tm) on Unix, with Wine-Staging patchset"
73 HOMEPAGE="https://www.winehq.org/"
74 -SRC_URI="${SRC_URI}
75 - https://dev.gentoo.org/~sarnex/distfiles/wine/gentoo-wine-patches-${GWP_V}.tar.xz
76 -"
77 -
78 -if [[ ${MY_PV} == "9999" ]] ; then
79 - STAGING_EGIT_REPO_URI="https://github.com/wine-staging/wine-staging.git"
80 -else
81 - SRC_URI="${SRC_URI}
82 - staging? ( https://github.com/wine-staging/wine-staging/archive/v${MY_PV}.tar.gz -> ${STAGING_P}.tar.gz )"
83 -fi
84
85 -LICENSE="LGPL-2.1"
86 -SLOT="${MY_PV}"
87 -IUSE="+abi_x86_32 +abi_x86_64 +alsa capi crossdev-mingw cups custom-cflags dos +fontconfig +gecko gphoto2 gstreamer kerberos ldap mingw +mono mp3 netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight pulseaudio +realtime +run-exes samba scanner sdl selinux +ssl staging test +threads +truetype udev +udisks +unwind usb v4l vulkan +X +xcomposite xinerama"
88 -REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
89 +LICENSE="LGPL-2.1+ BSD-2 IJG MIT ZLIB gsm libpng2 libtiff"
90 +SLOT="${PV}"
91 +IUSE="
92 + +X +abi_x86_32 +abi_x86_64 +alsa capi crossdev-mingw cups dos
93 + llvm-libunwind debug custom-cflags +fontconfig +gecko gphoto2
94 + +gstreamer kerberos ldap +mingw +mono netapi nls odbc openal
95 + opencl +opengl osmesa pcap perl pulseaudio samba scanner +sdl
96 + selinux +ssl +truetype udev udisks +unwind usb v4l +vulkan xattr
97 + +xcomposite xinerama"
98 +REQUIRED_USE="
99 X? ( truetype )
100 - crossdev-mingw? ( mingw )
101 - elibc_glibc? ( threads )
102 - osmesa? ( opengl )
103 - pipelight? ( staging )
104 - test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
105 -
106 -# FIXME: the test suite is unsuitable for us; many tests require net access
107 -# or fail due to Xvfb's opengl limitations.
108 -RESTRICT="test"
109 + crossdev-mingw? ( mingw )" # bug #551124 for truetype
110
111 -BDEPEND="sys-devel/flex
112 - virtual/yacc
113 - virtual/pkgconfig
114 - mingw? ( !crossdev-mingw? ( dev-util/mingw64-toolchain[${MULTILIB_USEDEP}] ) )"
115 +# tests are non-trivial to run, can hang easily, don't play well with
116 +# sandbox, and several need real opengl/vulkan or network access
117 +RESTRICT="test"
118
119 -COMMON_DEPEND="
120 +# `grep WINE_CHECK_SONAME configure.ac` + if not directly linked
121 +WINE_DLOPEN_DEPEND="
122 X? (
123 x11-libs/libXcursor[${MULTILIB_USEDEP}]
124 - x11-libs/libXext[${MULTILIB_USEDEP}]
125 x11-libs/libXfixes[${MULTILIB_USEDEP}]
126 - x11-libs/libXrandr[${MULTILIB_USEDEP}]
127 x11-libs/libXi[${MULTILIB_USEDEP}]
128 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
129 + x11-libs/libXrender[${MULTILIB_USEDEP}]
130 x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
131 + opengl? (
132 + media-libs/libglvnd[X,${MULTILIB_USEDEP}]
133 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
134 + )
135 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
136 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
137 )
138 - alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
139 - capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
140 - cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
141 - fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
142 - gphoto2? (
143 - media-libs/libgphoto2:=[${MULTILIB_USEDEP}]
144 - media-libs/libjpeg-turbo:0=[${MULTILIB_USEDEP}]
145 + cups? ( net-print/cups[${MULTILIB_USEDEP}] )
146 + fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
147 + kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
148 + netapi? ( net-fs/samba[${MULTILIB_USEDEP}] )
149 + odbc? ( dev-db/unixODBC[${MULTILIB_USEDEP}] )
150 + sdl? ( media-libs/libsdl2[haptic,joystick,${MULTILIB_USEDEP}] )
151 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
152 + truetype? ( media-libs/freetype[${MULTILIB_USEDEP}] )
153 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
154 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
155 + vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )"
156 +WINE_COMMON_DEPEND="
157 + ${WINE_DLOPEN_DEPEND}
158 + X? (
159 + x11-libs/libX11[${MULTILIB_USEDEP}]
160 + x11-libs/libXext[${MULTILIB_USEDEP}]
161 )
162 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
163 + capi? ( net-libs/libcapi:=[${MULTILIB_USEDEP}] )
164 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
165 gstreamer? (
166 + dev-libs/glib:2[${MULTILIB_USEDEP}]
167 + media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
168 media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
169 - media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
170 )
171 - kerberos? ( virtual/krb5:0=[${MULTILIB_USEDEP}] )
172 ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
173 - netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
174 - nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
175 - odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
176 - openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
177 + openal? ( media-libs/openal[${MULTILIB_USEDEP}] )
178 opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
179 - opengl? (
180 - virtual/opengl[${MULTILIB_USEDEP}]
181 - )
182 - osmesa? ( >=media-libs/mesa-13[osmesa,${MULTILIB_USEDEP}] )
183 pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
184 - pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
185 - scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
186 - sdl? ( media-libs/libsdl2:=[haptic,joystick,${MULTILIB_USEDEP}] )
187 - ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
188 - staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
189 - truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
190 + pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
191 + scanner? ( media-gfx/sane-backends[${MULTILIB_USEDEP}] )
192 udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
193 - udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
194 - unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
195 - usb? ( virtual/libusb:1[${MULTILIB_USEDEP}] )
196 - v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
197 - vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
198 - xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
199 - xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )"
200 -
201 -RDEPEND="${COMMON_DEPEND}
202 + unwind? (
203 + llvm-libunwind? ( sys-libs/llvm-libunwind[${MULTILIB_USEDEP}] )
204 + !llvm-libunwind? ( sys-libs/libunwind:=[${MULTILIB_USEDEP}] )
205 + )
206 + usb? ( dev-libs/libusb:1[${MULTILIB_USEDEP}] )
207 + xattr? ( sys-apps/attr[${MULTILIB_USEDEP}] )"
208 +RDEPEND="
209 + ${WINE_COMMON_DEPEND}
210 app-emulation/wine-desktop-common
211 - >app-eselect/eselect-wine-0.3
212 - dos? ( >=games-emulation/dosbox-0.74_p20160629 )
213 - gecko? ( app-emulation/wine-gecko:${GECKO_VERSION}[abi_x86_32?,abi_x86_64?] )
214 - mono? ( app-emulation/wine-mono:7.3.0 )
215 + dos? ( games-emulation/dosbox )
216 + gecko? ( app-emulation/wine-gecko:${WINE_GECKO}[${MULTILIB_USEDEP}] )
217 + gstreamer? ( media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}] )
218 + mono? ( app-emulation/wine-mono:${WINE_MONO} )
219 perl? (
220 dev-lang/perl
221 - dev-perl/XML-Simple
222 + dev-perl/XML-LibXML
223 )
224 - pulseaudio? (
225 - realtime? ( sys-auth/rtkit )
226 - )
227 - samba? ( >=net-fs/samba-3.0.25[winbind] )
228 + samba? ( net-fs/samba[winbind] )
229 selinux? ( sec-policy/selinux-wine )
230 udisks? ( sys-fs/udisks:2 )"
231 +DEPEND="
232 + ${WINE_COMMON_DEPEND}
233 + sys-kernel/linux-headers
234 + X? ( x11-base/xorg-proto )"
235 +BDEPEND="
236 + dev-lang/perl
237 + sys-devel/bison
238 + sys-devel/flex
239 + virtual/pkgconfig
240 + mingw? ( !crossdev-mingw? ( dev-util/mingw64-toolchain[${MULTILIB_USEDEP}] ) )
241 + nls? ( sys-devel/gettext )"
242 +IDEPEND="app-eselect/eselect-wine"
243
244 -# tools/make_requests requires perl
245 -DEPEND="${COMMON_DEPEND}
246 - ${BDEPEND}
247 - >=sys-kernel/linux-headers-2.6
248 - X? ( x11-base/xorg-proto )
249 - staging? (
250 - dev-lang/perl
251 - dev-perl/XML-Simple
252 - )
253 - xinerama? ( x11-base/xorg-proto )"
254 -
255 -# These use a non-standard "Wine" category, which is provided by
256 -# /etc/xdg/applications-merged/wine.menu
257 -QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
258 -usr/share/applications/wine-notepad.desktop
259 -usr/share/applications/wine-uninstaller.desktop
260 -usr/share/applications/wine-winecfg.desktop"
261 +QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext
262
263 PATCHES=(
264 - "${PATCHDIR}/patches/${MY_PN}-6.22-winegcc.patch" #260726
265 - "${PATCHDIR}/patches/${MY_PN}-4.7-multilib-portage.patch" #395615
266 - "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
267 + "${FILESDIR}"/${PN}-7.17-llvm-libunwind.patch
268 + "${FILESDIR}"/${PN}-7.17-noexecstack.patch
269 )
270 -PATCHES_BIN=()
271 -
272 -# https://bugs.gentoo.org/show_bug.cgi?id=635222
273 -if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${MY_PV} == 9999 ]]; then
274 - DEPEND+=" dev-util/patchbin"
275 -fi
276 -
277 -wine_compiler_check() {
278 - # Ensure compiler support
279 - # (No checks here as of 2022)
280 - return 0
281 -}
282 -
283 -wine_build_environment_check() {
284 - [[ ${MERGE_TYPE} = "binary" ]] && return 0
285 -
286 - if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
287 - eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
288 - eerror "See https://bugs.gentoo.org/487864 for more details."
289 - eerror
290 - return 1
291 - fi
292 -}
293 -
294 -wine_env_vcs_vars() {
295 - local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
296 - local pn_live_val="${pn_live_var}"
297 - eval pn_live_val='$'${pn_live_val}
298 - if [[ ! -z ${pn_live_val} ]]; then
299 - if use staging; then
300 - eerror "Because of the multi-repo nature of ${MY_PN}, ${pn_live_var}"
301 - eerror "cannot be used to set the commit. Instead, you may use the"
302 - eerror "environment variables:"
303 - eerror " EGIT_OVERRIDE_COMMIT_WINE"
304 - eerror " EGIT_OVERRIDE_COMMIT_WINE_STAGING_WINE_STAGING"
305 - eerror
306 - return 1
307 - fi
308 - fi
309 - if [[ ! -z ${EGIT_COMMIT} ]]; then
310 - eerror "Commits must now be specified using the environment variables:"
311 - eerror " EGIT_OVERRIDE_COMMIT_WINE"
312 - eerror " EGIT_OVERRIDE_COMMIT_WINE_STAGING_WINE_STAGING"
313 - eerror
314 - return 1
315 - fi
316 -}
317
318 pkg_pretend() {
319 - if [[ ${MERGE_TYPE} != binary ]] ; then
320 - wine_build_environment_check || die
321 -
322 - # Verify OSS support
323 - if use oss; then
324 - if ! has_version ">=media-sound/oss-4"; then
325 - eerror "You cannot build wine with USE=oss without having support from"
326 - eerror ">=media-sound/oss-4 (only available through external repos)"
327 - eerror
328 - die
329 - fi
330 - fi
331 + [[ ${MERGE_TYPE} == binary ]] && return
332
333 - if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then
334 - local mingw=-w64-mingw32
335 - for mingw in $(usev abi_x86_64 x86_64${mingw}) $(usev abi_x86_32 i686${mingw}); do
336 - type -P ${mingw}-gcc && continue
337 + if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then
338 + local mingw=-w64-mingw32
339 + for mingw in $(usev abi_x86_64 x86_64${mingw}) $(usev abi_x86_32 i686${mingw}); do
340 + if ! type -P ${mingw}-gcc >/dev/null; then
341 eerror "With USE=crossdev-mingw, you must prepare the MinGW toolchain"
342 eerror "yourself by installing sys-devel/crossdev then running:"
343 eerror
344 @@ -228,324 +144,207 @@ pkg_pretend() {
345 eerror
346 eerror "For more information, please see: https://wiki.gentoo.org/wiki/Mingw"
347 die "USE=crossdev-mingw is enabled, but ${mingw}-gcc was not found"
348 - done
349 - fi
350 + fi
351 + done
352 fi
353 }
354
355 -pkg_setup() {
356 - wine_build_environment_check || die
357 - wine_env_vcs_vars || die
358 -
359 - WINE_VARIANT="${PN#wine}-${MY_PV}"
360 - WINE_VARIANT="${WINE_VARIANT#-}"
361 -
362 - MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
363 - MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
364 - MY_DATADIR="${MY_DATAROOTDIR}"
365 - MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
366 - MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
367 - MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
368 - MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
369 - MY_MANDIR="${MY_DATADIR}/man"
370 -}
371 -
372 src_unpack() {
373 - if [[ ${MY_PV} == "9999" ]] ; then
374 - EGIT_CHECKOUT_DIR="${S}" git-r3_src_unpack
375 - if use staging; then
376 - local CURRENT_WINE_COMMIT=${EGIT_VERSION}
377 -
378 - EGIT_CHECKOUT_DIR="${STAGING_DIR}" EGIT_REPO_URI="${STAGING_EGIT_REPO_URI}" git-r3_src_unpack
379 -
380 - local COMPAT_WINE_COMMIT=$("${STAGING_DIR}/patches/patchinstall.sh" --upstream-commit) || die
381 -
382 - if [[ "${CURRENT_WINE_COMMIT}" != "${COMPAT_WINE_COMMIT}" ]]; then
383 - einfo "The current Staging patchset is not guaranteed to apply on this WINE commit."
384 - einfo "If src_prepare fails, try emerging with the env var WINE_COMMIT."
385 - einfo "Example: EGIT_OVERRIDE_COMMIT_WINE=${COMPAT_WINE_COMMIT} emerge -1 wine"
386 - fi
387 - fi
388 + if [[ ${PV} == *9999 ]]; then
389 + EGIT_CHECKOUT_DIR=${WORKDIR}/${P}
390 + git-r3_src_unpack
391 +
392 + EGIT_COMMIT=$(<"${EGIT_CHECKOUT_DIR}"/staging/upstream-commit) || die
393 + EGIT_REPO_URI=${WINE_EGIT_REPO_URI}
394 + EGIT_CHECKOUT_DIR=${S}
395 + einfo "Fetching Wine commit matching the current patchset by default (${EGIT_COMMIT})"
396 + git-r3_src_unpack
397 + else
398 + default
399 fi
400 -
401 - default
402 -
403 - plocale_find_changes "${S}/po" "" ".po"
404 }
405
406 src_prepare() {
407 + local staging=(
408 + ./patchinstall.sh DESTDIR="${S}"
409 + --all
410 + --backend=eapply
411 + --no-autoconf
412 + -W winemenubuilder-Desktop_Icon_Path #652176
413 + ${MY_WINE_STAGING_CONF}
414 + )
415
416 - eapply_bin(){
417 - local patch
418 - for patch in ${PATCHES_BIN[@]}; do
419 - patchbin --nogit < "${patch}" || die
420 - done
421 - }
422 -
423 - if use gecko; then
424 - local source_gecko_version=$( sed -n -e '/^#define GECKO_VERSION/p' dlls/appwiz.cpl/addons.c | grep -Eo -m 1 '[0-9.]+' )
425 - if [[ ${source_gecko_version} != ${GECKO_VERSION} ]] ; then
426 - die "app-emulation/wine-gecko version is not correct! Please file a bug."
427 - fi
428 - fi
429 -
430 - local md5="$(md5sum server/protocol.def)"
431 -
432 - if use staging; then
433 - ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
434 - ewarn "Wine bugzilla should explicitly state that staging was used."
435 -
436 - local STAGING_EXCLUDE="-W winemenubuilder-Desktop_Icon_Path" #652176
437 - use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
438 -
439 - # Launch wine-staging patcher in a subshell, using eapply as a backend, and gitapply.sh as a backend for binary patches
440 - ebegin "Running Wine-Staging patch installer"
441 - (
442 - set -- DESTDIR="${S}" --backend=eapply --no-autoconf --all ${STAGING_EXCLUDE}
443 - cd "${STAGING_DIR}/patches"
444 - source "${STAGING_DIR}/patches/patchinstall.sh"
445 - )
446 - eend $? || die "Failed to apply Wine-Staging patches"
447 + # source patcher in a subshell so can use eapply as a backend
448 + ebegin "Running ${staging[*]}"
449 + ( cd ../${P}/patches && . "${staging[@]}" )
450 + eend ${?} || die "Failed to apply the patchset"
451 +
452 + # sanity check, bumping these has a history of oversights
453 + local geckomono=$(sed -En '/^#define (GECKO|MONO)_VER/{s/[^0-9.]//gp}' \
454 + dlls/appwiz.cpl/addons.c || die)
455 + if [[ ${WINE_GECKO}$'\n'${WINE_MONO} != "${geckomono}" ]]; then
456 + local gmfatal=
457 + [[ ${PV} == *9999 ]] && gmfatal=nonfatal
458 + ${gmfatal} die -n "gecko/mono mismatch in ebuild, has: " ${geckomono} " (please file a bug)"
459 fi
460
461 default
462 - eapply_bin
463 - eautoreconf
464 -
465 - # Modification of the server protocol requires regenerating the server requests
466 - if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
467 - einfo "server/protocol.def was patched; running tools/make_requests"
468 - tools/make_requests || die #432348
469 - fi
470 - sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
471 - if ! use run-exes; then
472 - sed -i '/^MimeType/d' loader/wine.desktop || die #117785
473 - fi
474 -
475 - # Edit wine.desktop to work for specific variant
476 - sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
477
478 - # hi-res default icon, #472990, https://bugs.winehq.org/show_bug.cgi?id=24652
479 - cp "${PATCHDIR}/files/oic_winlogo.ico" dlls/user32/resources/ || die
480 + # ensure .desktop calls this variant + slot
481 + sed -i "/^Exec=/s/wine /${P} /" loader/wine.desktop || die
482
483 - plocale_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
484 -
485 - # Fix manpage generation for locales #469418 and abi_x86_64 #617864
486 -
487 - # Duplicate manpages input files for wine64
488 - local f
489 - for f in loader/*.man.in; do
490 - cp ${f} ${f/wine/wine64} || die
491 - done
492 - # Add wine64 manpages to Makefile
493 - if use abi_x86_64; then
494 - sed -i "/wine.man.in/i \
495 - \\\twine64.man.in \\\\" loader/Makefile.in || die
496 - sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
497 -\164\2/' loader/Makefile.in || die
498 - fi
499 -
500 - rm_man_file(){
501 - local file="${1}"
502 - loc=${2}
503 - sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
504 - }
505 -
506 - while read f; do
507 - plocale_for_each_disabled_locale rm_man_file "${f}"
508 - done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
509 + # always update for patches (including user's wrt #432348)
510 + eautoreconf
511 + tools/make_requests || die # perl
512 }
513
514 src_configure() {
515 - wine_compiler_check || die
516 -
517 - export LDCONFIG=/bin/true
518 - use custom-cflags || strip-flags
519 - if use mingw; then
520 - use crossdev-mingw || PATH="${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}"
521 -
522 - # use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
523 - local mingwcc=${CROSSCC:-$(usex x86 i686 x86_64)-w64-mingw32-gcc}
524 - : "${CROSSCFLAGS:=$(CC=${mingwcc} test-flags-CC ${CFLAGS:--O2})}"
525 - : "${CROSSLDFLAGS:=$(
526 - filter-flags '-fuse-ld=*'
527 - CC=${mingwcc} test-flags-CCLD ${LDFLAGS})}"
528 - export CROSS{C,LD}FLAGS
529 - fi
530 -
531 - multilib-minimal_src_configure
532 -}
533 -
534 -multilib_src_configure() {
535 - local myconf=(
536 - --prefix="${MY_PREFIX}"
537 - --datarootdir="${MY_DATAROOTDIR}"
538 - --datadir="${MY_DATADIR}"
539 - --docdir="${MY_DOCDIR}"
540 - --includedir="${MY_INCLUDEDIR}"
541 - --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
542 - --libexecdir="${MY_LIBEXECDIR}"
543 - --localstatedir="${MY_LOCALSTATEDIR}"
544 - --mandir="${MY_MANDIR}"
545 - --sysconfdir="${EPREFIX}/etc/wine"
546 + WINE_PREFIX=/usr/lib/${P}
547 + WINE_DATADIR=/usr/share/${P}
548 +
549 + local conf=(
550 + --prefix="${EPREFIX}"${WINE_PREFIX}
551 + --datadir="${EPREFIX}"${WINE_DATADIR}
552 + --includedir="${EPREFIX}"/usr/include/${P}
553 + --libdir="${EPREFIX}"${WINE_PREFIX}
554 + --mandir="${EPREFIX}"${WINE_DATADIR}/man
555 + $(use_enable gecko mshtml)
556 + $(use_enable mono mscoree)
557 + --disable-tests
558 + $(use_with X x)
559 $(use_with alsa)
560 $(use_with capi)
561 $(use_with cups)
562 - $(use_with udisks dbus)
563 $(use_with fontconfig)
564 - $(use_with ssl gnutls)
565 - $(use_enable gecko mshtml)
566 $(use_with gphoto2 gphoto)
567 $(use_with gstreamer)
568 - --enable-hal
569 $(use_with kerberos gssapi)
570 $(use_with kerberos krb5)
571 $(use_with ldap)
572 - # TODO: Will bug 685172 still need special handling?
573 $(use_with mingw)
574 - $(use_enable mono mscoree)
575 $(use_with netapi)
576 $(use_with nls gettext)
577 $(use_with openal)
578 $(use_with opencl)
579 $(use_with opengl)
580 $(use_with osmesa)
581 - $(use_with oss)
582 + --without-oss # media-sound/oss is not packaged (OSSv4)
583 $(use_with pcap)
584 $(use_with pulseaudio pulse)
585 - $(use_with threads pthread)
586 $(use_with scanner sane)
587 $(use_with sdl)
588 - $(use_enable test tests)
589 + $(use_with ssl gnutls)
590 $(use_with truetype freetype)
591 $(use_with udev)
592 + $(use_with udisks dbus) # dbus is only used for udisks
593 $(use_with unwind)
594 $(use_with usb)
595 $(use_with v4l v4l2)
596 $(use_with vulkan)
597 - $(use_with X x)
598 - $(use_with X xfixes)
599 + $(use_with xattr)
600 $(use_with xcomposite)
601 $(use_with xinerama)
602 + $(usev !odbc ac_cv_lib_soname_odbc=)
603 )
604
605 - use staging && myconf+=(
606 - --with-xattr
607 - )
608 -
609 - local PKG_CONFIG
610 - # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
611 - tc-export PKG_CONFIG
612 -
613 - if use amd64; then
614 - if [[ ${ABI} == amd64 ]]; then
615 - myconf+=( --enable-win64 )
616 - else
617 - myconf+=( --disable-win64 )
618 + tc-ld-force-bfd #867097
619 + use custom-cflags || strip-flags # can break in obscure ways, also no lto
620 + use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
621 +
622 + # build using upstream's way (--with-wine64)
623 + # order matters: configure+compile 64->32, install 32->64
624 + local -i bits
625 + for bits in $(usev abi_x86_64 64) $(usev abi_x86_32 32); do
626 + (
627 + einfo "Configuring ${PN} for ${bits}bits in ${WORKDIR}/build${bits} ..."
628 +
629 + mkdir ../build${bits} || die
630 + cd ../build${bits} || die
631 +
632 + # CROSSCC_amd64/x86 are unused by Wine, but recognized here for users
633 + if (( bits == 64 )); then
634 + : "${CROSSCC:=${CROSSCC_amd64:-x86_64-w64-mingw32-gcc}}"
635 + conf+=( --enable-win64 )
636 + elif use amd64; then
637 + conf+=(
638 + $(usev abi_x86_64 --with-wine64=../build64)
639 + TARGETFLAGS=-m32 # for widl
640 + )
641 + # _setup is optional, but use over Wine's auto-detect (+#472038)
642 + multilib_toolchain_setup x86
643 fi
644 + : "${CROSSCC:=${CROSSCC_x86:-i686-w64-mingw32-gcc}}"
645
646 - # Note: using --with-wine64 results in problems with multilib.eclass
647 - # CC/LD hackery. We're using separate tools instead.
648 - fi
649 -
650 - ECONF_SOURCE=${S} \
651 - econf "${myconf[@]}"
652 - emake depend
653 -}
654 -
655 -multilib_src_test() {
656 - # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
657 - if [[ ${ABI} == x86 ]]; then
658 - if [[ $(id -u) == 0 ]]; then
659 - ewarn "Skipping tests since they cannot be run under the root user."
660 - ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
661 - return
662 + # use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
663 + if use mingw; then
664 + : "${CROSSCFLAGS:=$(CC=${CROSSCC} test-flags-CC ${CFLAGS:--O2})}"
665 + : "${CROSSLDFLAGS:=$(
666 + filter-flags '-fuse-ld=*'
667 + CC=${CROSSCC} test-flags-CCLD ${LDFLAGS})}"
668 + export CROSS{CC,{C,LD}FLAGS}
669 fi
670
671 - WINEPREFIX="${T}/.wine-${ABI}" \
672 - virtx emake test
673 - fi
674 + ECONF_SOURCE=${S} econf "${conf[@]}"
675 + )
676 + done
677 }
678
679 -multilib_src_install_all() {
680 - local DOCS=( ANNOUNCE AUTHORS README )
681 - add_locale_docs() {
682 - local locale_doc="documentation/README.$1"
683 - [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
684 - }
685 - plocale_for_each_locale add_locale_docs
686 -
687 - einstalldocs
688 - find "${ED}" -name *.la -delete || die
689 +src_compile() {
690 + use abi_x86_64 && emake -C ../build64 # do first
691 + use abi_x86_32 && emake -C ../build32
692 +}
693
694 - if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
695 - rm "${D%}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
696 - "${D%}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
697 +src_install() {
698 + use abi_x86_32 && emake DESTDIR="${D}" -C ../build32 install
699 + use abi_x86_64 && emake DESTDIR="${D}" -C ../build64 install # do last
700 +
701 + # symlink for plain 'wine' and install its man pages if 64bit-only #404331
702 + if use abi_x86_64 && use !abi_x86_32; then
703 + dosym wine64 ${WINE_PREFIX}/bin/wine
704 + dosym wine64-preloader ${WINE_PREFIX}/bin/wine-preloader
705 + local man
706 + for man in ../build64/loader/wine.*man; do
707 + : "${man##*/wine}"
708 + : "${_%.*}"
709 + insinto ${WINE_DATADIR}/man/${_:+${_#.}/}man1
710 + newins ${man} wine.1
711 + done
712 fi
713
714 - use abi_x86_32 && pax-mark psmr "${D%}${MY_PREFIX}"/bin/wine{,-preloader} #255055
715 - use abi_x86_64 && pax-mark psmr "${D%}${MY_PREFIX}"/bin/wine64{,-preloader}
716 -
717 - # Avoid double prefix from dosym and make_wrapper
718 - MY_PREFIX=${MY_PREFIX#${EPREFIX}}
719 -
720 - if use abi_x86_64 && ! use abi_x86_32; then
721 - dosym wine64 "${MY_PREFIX}"/bin/wine # 404331
722 - dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
723 - fi
724 + use perl || rm "${ED}"${WINE_DATADIR}/man/man1/wine{dump,maker}.1 \
725 + "${ED}"${WINE_PREFIX}/bin/{function_grep.pl,wine{dump,maker}} || die
726
727 - # Failglob for binloops, shouldn't be necessary, but including to stay safe
728 - eshopts_push -s failglob #615218
729 - # Make wrappers for binaries for handling multiple variants
730 - # Note: wrappers instead of symlinks because some are shell which use basename
731 - local b
732 - for b in "${ED%}${MY_PREFIX}"/bin/*; do
733 - make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
734 + # create variant wrappers for eselect-wine
735 + local bin
736 + for bin in "${ED}"${WINE_PREFIX}/bin/*; do
737 + make_wrapper "${bin##*/}-${P#wine-}" "${bin#"${ED}"}"
738 done
739 - eshopts_pop
740 -}
741
742 -pkg_postinst() {
743 - eselect wine register ${PN}-${MY_PV}
744 - if [[ ${PN} == "wine-vanilla" ]]; then
745 - eselect wine register --vanilla ${PN}-${MY_PV} || die
746 - else
747 - if use staging; then
748 - eselect wine register --staging ${PN}-${MY_PV} || die
749 - fi
750 + # don't let portage try to strip PE files with the wrong
751 + # strip executable and instead handle it here (saves ~120MB)
752 + if use mingw; then
753 + dostrip -x ${WINE_PREFIX}/wine/{i386,x86_64}-windows
754 + use debug ||
755 + find "${ED}"${WINE_PREFIX}/wine/*-windows -regex '.*\.\(a\|dll\|exe\)' \
756 + -exec $(usex abi_x86_64 x86_64 i686)-w64-mingw32-strip --strip-unneeded {} + || die
757 fi
758
759 - eselect wine update --all --if-unset || die
760 -
761 - xdg_desktop_database_update
762 -
763 - if ! use gecko; then
764 - ewarn "Without Wine Gecko, wine prefixes will not have a default"
765 - ewarn "implementation of iexplore. Many older windows applications"
766 - ewarn "rely upon the existence of an iexplore implementation, so"
767 - ewarn "you will likely need to install an external one, like via winetricks"
768 - fi
769 - if ! use mono; then
770 - ewarn "Without Wine Mono, wine prefixes will not have a default"
771 - ewarn "implementation of .NET. Many windows applications rely upon"
772 - ewarn "the existence of a .NET implementation, so you will likely need"
773 - ewarn "to install an external one, like via winetricks"
774 - fi
775 + dodoc ANNOUNCE AUTHORS README* documentation/README*
776 }
777
778 -pkg_prerm() {
779 - eselect wine deregister ${PN}-${MY_PV}
780 - if [[ ${PN} == "wine-vanilla" ]]; then
781 - eselect wine deregister --vanilla ${PN}-${MY_PV} || die
782 - else
783 - if use staging; then
784 - eselect wine deregister --staging ${PN}-${MY_PV}|| die
785 - fi
786 - fi
787 +wine-eselect() {
788 + ebegin "${1^}ing ${P} using eselect-wine"
789 + eselect wine ${1} ${P} &&
790 + eselect wine ${1} --${PN#wine-} ${P} &&
791 + eselect wine update --if-unset &&
792 + eselect wine update --${PN#wine-} --if-unset
793 + eend ${?} || die -n "eselect failed, may need to manually handle ${P}"
794 +}
795
796 - eselect wine update --all --if-unset || die
797 +pkg_postinst() {
798 + wine-eselect register
799 }
800
801 -pkg_postrm() {
802 - xdg_desktop_database_update
803 +pkg_prerm() {
804 + nonfatal wine-eselect deregister
805 }