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: Wed, 25 Jan 2023 03:01:42
Message-Id: 1674614884.9749ffd94b9cef78cd06a82a9cd638528d29f18c.ionen@gentoo
1 commit: 9749ffd94b9cef78cd06a82a9cd638528d29f18c
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 25 02:46:16 2023 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 25 02:48:04 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9749ffd9
7
8 app-emulation/wine-staging: add 8.0
9
10 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
11
12 app-emulation/wine-staging/Manifest | 2 +
13 app-emulation/wine-staging/wine-staging-8.0.ebuild | 355 +++++++++++++++++++++
14 2 files changed, 357 insertions(+)
15
16 diff --git a/app-emulation/wine-staging/Manifest b/app-emulation/wine-staging/Manifest
17 index f3dbaed773c9..70cb7191cd1a 100644
18 --- a/app-emulation/wine-staging/Manifest
19 +++ b/app-emulation/wine-staging/Manifest
20 @@ -1,4 +1,6 @@
21 DIST wine-7.19.tar.xz 28502612 BLAKE2B b7b270656955c7a1e1d84e8bbc7e3e8abff5aedadb5e8a458f0b1109d746875a359f3d2f53b1c9c6caae65d17fd1d205466cd3a884034a8bad6afe9456f13b5d SHA512 f76dbda97cccad4c0f249b5dd4e8d48afa832134f1704ae228650bb73ee82823e628b23bd53a3f8729e06a8933597ff2fffa5551f156fc9c9181b67c066747d5
22 DIST wine-7.22.tar.xz 28974052 BLAKE2B c86466964817b916ee8f7b687f193eda8bdd3fb17152ab1565971e36f43b12b540033ac1c5fa5d15576041febd32cf1ea2955732c5386debcbda46fb3acca0f1 SHA512 bf58a5b98bef5b291aff1eca3f94c28da95990e4c8da9af5e9e28b9480d57163d088b501b0c1bca5b568bf586dd9933cdc1ea1f371b78d95c94e2d25d0a65efc
23 +DIST wine-8.0.tar.xz 29054044 BLAKE2B baf8f96b665119c9f38a148a2472dbe8f6ca8d4641d9d09d48cb72cb4de2585c274b8b7981c2fa622ead6da2f087c57652e9b48edc8a17c0cfd6be9a36732f02 SHA512 53ba813b260a65a271ec575822725b97631f60038fb026dcc0fe66862711eedcc29a8feb29ff54ae4f64458f85c290d8f3838eff5e4c77a5420a7d2b951fef77
24 DIST wine-staging-7.19.tar.gz 9523048 BLAKE2B e53fd47af493cbdc4542f908a39557324d70ad67ff2e06c80296c006a63518e43988750cab2f4d3d9197fc9c8a1e61ed4d96bcc310b82b6cfc8ec12b941f1c5c SHA512 c51cb18c4ae00eccf414f5edda18ebf363674ba7cfa95da135b3a43b7c012c086d454d6ac32b22d98e611bb87e55c3e1ee95571a4a0c9713028b5ac38e8aed3f
25 DIST wine-staging-7.22.tar.gz 9528424 BLAKE2B e41f24f924117259715505f4f9998ef23a657bca5b0e285feb7f9fd732e6b566a495f48ec59af09b1d4d51db522b051028f6cbba748256e939929fbf978f0e44 SHA512 5fdac19ec290c67767fac71abe07d9350ec431919c67a0f2d2df18ced20f1d3dddb921b3d5586d03add187c6281e1a691cc220e8d2d5ad4eeb94015721479d65
26 +DIST wine-staging-8.0.tar.gz 9529620 BLAKE2B c9540195ea885d9f1e980232b0af471e92c61eb079cae35fdb3af5c13d4660b3466f751772440e38f15874082db296d16d1f1d68827a505b2dd949617eda0203 SHA512 76a729d7ced1ff634ddb455ddfaa66ca103b652f43cd152b57ada7431bb5fbb74f5e92bf2f4f329b6df6f5908130afad84e609cbce6df645d6cf8131e9b949f9
27
28 diff --git a/app-emulation/wine-staging/wine-staging-8.0.ebuild b/app-emulation/wine-staging/wine-staging-8.0.ebuild
29 new file mode 100644
30 index 000000000000..b23645292240
31 --- /dev/null
32 +++ b/app-emulation/wine-staging/wine-staging-8.0.ebuild
33 @@ -0,0 +1,355 @@
34 +# Copyright 2022-2023 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +MULTILIB_COMPAT=( abi_x86_{32,64} )
40 +inherit autotools flag-o-matic multilib multilib-build toolchain-funcs wrapper
41 +
42 +WINE_GECKO=2.47.3
43 +WINE_MONO=7.4.0
44 +
45 +if [[ ${PV} == *9999 ]]; then
46 + inherit git-r3
47 + EGIT_REPO_URI="https://github.com/wine-staging/wine-staging.git"
48 + WINE_EGIT_REPO_URI="https://gitlab.winehq.org/wine/wine.git"
49 +else
50 + (( $(ver_cut 2) )) && WINE_SDIR=$(ver_cut 1).x || WINE_SDIR=$(ver_cut 1).0
51 + SRC_URI="
52 + https://dl.winehq.org/wine/source/${WINE_SDIR}/wine-${PV}.tar.xz
53 + https://github.com/wine-staging/wine-staging/archive/v${PV}.tar.gz -> ${P}.tar.gz"
54 + KEYWORDS="-* ~amd64 ~x86"
55 +fi
56 +S="${WORKDIR}/wine-${PV}"
57 +
58 +DESCRIPTION="Free implementation of Windows(tm) on Unix, with Wine-Staging patchset"
59 +HOMEPAGE="https://wiki.winehq.org/Wine-Staging"
60 +
61 +LICENSE="LGPL-2.1+ BSD-2 IJG MIT OPENLDAP ZLIB gsm libpng2 libtiff"
62 +SLOT="${PV}"
63 +IUSE="
64 + +X +abi_x86_32 +abi_x86_64 +alsa capi crossdev-mingw cups dos
65 + llvm-libunwind debug custom-cflags +fontconfig +gecko gphoto2
66 + +gstreamer kerberos +mingw +mono netapi nls odbc opencl +opengl
67 + osmesa pcap perl pulseaudio samba scanner +sdl selinux +ssl
68 + +truetype udev udisks +unwind usb v4l +vulkan +xcomposite xinerama"
69 +REQUIRED_USE="
70 + X? ( truetype )
71 + crossdev-mingw? ( mingw )" # bug #551124 for truetype
72 +
73 +# tests are non-trivial to run, can hang easily, don't play well with
74 +# sandbox, and several need real opengl/vulkan or network access
75 +RESTRICT="test"
76 +
77 +# `grep WINE_CHECK_SONAME configure.ac` + if not directly linked
78 +WINE_DLOPEN_DEPEND="
79 + X? (
80 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
81 + x11-libs/libXfixes[${MULTILIB_USEDEP}]
82 + x11-libs/libXi[${MULTILIB_USEDEP}]
83 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
84 + x11-libs/libXrender[${MULTILIB_USEDEP}]
85 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
86 + opengl? (
87 + media-libs/libglvnd[X,${MULTILIB_USEDEP}]
88 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
89 + )
90 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
91 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
92 + )
93 + cups? ( net-print/cups[${MULTILIB_USEDEP}] )
94 + fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
95 + kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
96 + netapi? ( net-fs/samba[${MULTILIB_USEDEP}] )
97 + odbc? ( dev-db/unixODBC[${MULTILIB_USEDEP}] )
98 + sdl? ( media-libs/libsdl2[haptic,joystick,${MULTILIB_USEDEP}] )
99 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
100 + truetype? ( media-libs/freetype[${MULTILIB_USEDEP}] )
101 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
102 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
103 + vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )"
104 +WINE_COMMON_DEPEND="
105 + ${WINE_DLOPEN_DEPEND}
106 + X? (
107 + x11-libs/libX11[${MULTILIB_USEDEP}]
108 + x11-libs/libXext[${MULTILIB_USEDEP}]
109 + )
110 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
111 + capi? ( net-libs/libcapi:=[${MULTILIB_USEDEP}] )
112 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
113 + gstreamer? (
114 + dev-libs/glib:2[${MULTILIB_USEDEP}]
115 + media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
116 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
117 + )
118 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
119 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
120 + pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
121 + scanner? ( media-gfx/sane-backends[${MULTILIB_USEDEP}] )
122 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
123 + unwind? (
124 + llvm-libunwind? ( sys-libs/llvm-libunwind[${MULTILIB_USEDEP}] )
125 + !llvm-libunwind? ( sys-libs/libunwind:=[${MULTILIB_USEDEP}] )
126 + )
127 + usb? ( dev-libs/libusb:1[${MULTILIB_USEDEP}] )"
128 +RDEPEND="
129 + ${WINE_COMMON_DEPEND}
130 + app-emulation/wine-desktop-common
131 + dos? ( games-emulation/dosbox )
132 + gecko? ( app-emulation/wine-gecko:${WINE_GECKO}[${MULTILIB_USEDEP}] )
133 + gstreamer? ( media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}] )
134 + mono? ( app-emulation/wine-mono:${WINE_MONO} )
135 + perl? (
136 + dev-lang/perl
137 + dev-perl/XML-LibXML
138 + )
139 + samba? ( net-fs/samba[winbind] )
140 + selinux? ( sec-policy/selinux-wine )
141 + udisks? ( sys-fs/udisks:2 )"
142 +DEPEND="
143 + ${WINE_COMMON_DEPEND}
144 + sys-kernel/linux-headers
145 + X? ( x11-base/xorg-proto )"
146 +BDEPEND="
147 + dev-lang/perl
148 + sys-devel/binutils
149 + sys-devel/bison
150 + sys-devel/flex
151 + virtual/pkgconfig
152 + mingw? ( !crossdev-mingw? (
153 + >=dev-util/mingw64-toolchain-10.0.0_p1-r2[${MULTILIB_USEDEP}]
154 + ) )
155 + nls? ( sys-devel/gettext )"
156 +IDEPEND=">=app-eselect/eselect-wine-2"
157 +
158 +QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext
159 +
160 +PATCHES=(
161 + "${FILESDIR}"/${PN}-7.17-noexecstack.patch
162 + "${FILESDIR}"/${PN}-7.20-unwind.patch
163 +)
164 +
165 +pkg_pretend() {
166 + [[ ${MERGE_TYPE} == binary ]] && return
167 +
168 + if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then
169 + local mingw=-w64-mingw32
170 + for mingw in $(usev abi_x86_64 x86_64${mingw}) $(usev abi_x86_32 i686${mingw}); do
171 + if ! type -P ${mingw}-gcc >/dev/null; then
172 + eerror "With USE=crossdev-mingw, you must prepare the MinGW toolchain"
173 + eerror "yourself by installing sys-devel/crossdev then running:"
174 + eerror
175 + eerror " crossdev --target ${mingw}"
176 + eerror
177 + eerror "For more information, please see: https://wiki.gentoo.org/wiki/Mingw"
178 + die "USE=crossdev-mingw is enabled, but ${mingw}-gcc was not found"
179 + fi
180 + done
181 + fi
182 +}
183 +
184 +src_unpack() {
185 + if [[ ${PV} == *9999 ]]; then
186 + EGIT_CHECKOUT_DIR=${WORKDIR}/${P}
187 + git-r3_src_unpack
188 +
189 + EGIT_COMMIT=$("${BASH}" "${EGIT_CHECKOUT_DIR}"/patches/patchinstall.sh --upstream-commit) || die
190 + EGIT_REPO_URI=${WINE_EGIT_REPO_URI}
191 + EGIT_CHECKOUT_DIR=${S}
192 + einfo "Fetching Wine commit matching the current patchset by default (${EGIT_COMMIT})"
193 + git-r3_src_unpack
194 + else
195 + default
196 + fi
197 +}
198 +
199 +src_prepare() {
200 + local staging=(
201 + ./patchinstall.sh DESTDIR="${S}"
202 + --all
203 + --backend=eapply
204 + --no-autoconf
205 + -W winemenubuilder-Desktop_Icon_Path #652176
206 + ${MY_WINE_STAGING_CONF}
207 + )
208 +
209 + # source patcher in a subshell so can use eapply as a backend
210 + ebegin "Running ${staging[*]}"
211 + ( cd ../${P}/patches && . "${staging[@]}" )
212 + eend ${?} || die "Failed to apply the patchset"
213 +
214 + # sanity check, bumping these has a history of oversights
215 + local geckomono=$(sed -En '/^#define (GECKO|MONO)_VER/{s/[^0-9.]//gp}' \
216 + dlls/appwiz.cpl/addons.c || die)
217 + if [[ ${WINE_GECKO}$'\n'${WINE_MONO} != "${geckomono}" ]]; then
218 + local gmfatal=
219 + [[ ${PV} == *9999 ]] && gmfatal=nonfatal
220 + ${gmfatal} die -n "gecko/mono mismatch in ebuild, has: " ${geckomono} " (please file a bug)"
221 + fi
222 +
223 + default
224 +
225 + # ensure .desktop calls this variant + slot
226 + sed -i "/^Exec=/s/wine /${P} /" loader/wine.desktop || die
227 +
228 + # always update for patches (including user's wrt #432348)
229 + eautoreconf
230 + tools/make_requests || die # perl
231 +}
232 +
233 +src_configure() {
234 + WINE_PREFIX=/usr/lib/${P}
235 + WINE_DATADIR=/usr/share/${P}
236 +
237 + local conf=(
238 + --prefix="${EPREFIX}"${WINE_PREFIX}
239 + --datadir="${EPREFIX}"${WINE_DATADIR}
240 + --includedir="${EPREFIX}"/usr/include/${P}
241 + --libdir="${EPREFIX}"${WINE_PREFIX}
242 + --mandir="${EPREFIX}"${WINE_DATADIR}/man
243 + $(use_enable gecko mshtml)
244 + $(use_enable mono mscoree)
245 + --disable-tests
246 + $(use_with X x)
247 + $(use_with alsa)
248 + $(use_with capi)
249 + $(use_with cups)
250 + $(use_with fontconfig)
251 + $(use_with gphoto2 gphoto)
252 + $(use_with gstreamer)
253 + $(use_with kerberos gssapi)
254 + $(use_with kerberos krb5)
255 + $(use_with mingw)
256 + $(use_with netapi)
257 + $(use_with nls gettext)
258 + $(use_with opencl)
259 + $(use_with opengl)
260 + $(use_with osmesa)
261 + --without-oss # media-sound/oss is not packaged (OSSv4)
262 + $(use_with pcap)
263 + $(use_with pulseaudio pulse)
264 + $(use_with scanner sane)
265 + $(use_with sdl)
266 + $(use_with ssl gnutls)
267 + $(use_with truetype freetype)
268 + $(use_with udev)
269 + $(use_with udisks dbus) # dbus is only used for udisks
270 + $(use_with unwind)
271 + $(use_with usb)
272 + $(use_with v4l v4l2)
273 + $(use_with vulkan)
274 + $(use_with xcomposite)
275 + $(use_with xinerama)
276 + $(usev !odbc ac_cv_lib_soname_odbc=)
277 + )
278 +
279 + tc-ld-force-bfd # builds with non-bfd but broken at runtime (bug #867097)
280 + filter-lto # build failure
281 + use mingw || filter-flags -fno-plt # build failure
282 + use custom-cflags || strip-flags # can break in obscure ways at runtime
283 + use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
284 +
285 + # temporary workaround for tc-ld-force-bfd not yet enforcing with mold
286 + # https://github.com/gentoo/gentoo/pull/28355
287 + [[ $($(tc-getCC) ${LDFLAGS} -Wl,--version 2>/dev/null) == mold* ]] &&
288 + append-ldflags -fuse-ld=bfd
289 +
290 + # build using upstream's way (--with-wine64)
291 + # order matters: configure+compile 64->32, install 32->64
292 + local -i bits
293 + for bits in $(usev abi_x86_64 64) $(usev abi_x86_32 32); do
294 + (
295 + einfo "Configuring ${PN} for ${bits}bits in ${WORKDIR}/build${bits} ..."
296 +
297 + mkdir ../build${bits} || die
298 + cd ../build${bits} || die
299 +
300 + pe_arch=i386
301 + if (( bits == 64 )); then
302 + pe_arch=x86_64
303 + : "${CROSSCC:=${CROSSCC_amd64:-x86_64-w64-mingw32-gcc}}"
304 + conf+=( --enable-win64 )
305 + elif use amd64; then
306 + conf+=(
307 + $(usev abi_x86_64 --with-wine64=../build64)
308 + TARGETFLAGS=-m32 # for widl
309 + )
310 + # _setup is optional, but use over Wine's auto-detect (+#472038)
311 + multilib_toolchain_setup x86
312 + fi
313 + : "${CROSSCC:=${CROSSCC_x86:-i686-w64-mingw32-gcc}}"
314 +
315 + if use mingw; then
316 + # CROSSCC is no longer recognized by Wine, but still use for now
317 + # (future handling for CROSS* variables is subject to changes)
318 + conf+=( ac_cv_prog_${pe_arch}_CC="${CROSSCC}" )
319 +
320 + # use *FLAGS for mingw, but strip unsupported
321 + : "${CROSSCFLAGS:=$(
322 + # >=wine-7.21 configure.ac no longer adds -fno-strict by mistake
323 + append-cflags '-fno-strict-aliasing'
324 + filter-flags '-fstack-clash-protection' #758914
325 + filter-flags '-fstack-protector*' #870136
326 + filter-flags '-mfunction-return=thunk*' #878849
327 + CC=${CROSSCC} test-flags-CC ${CFLAGS:--O2})}"
328 + : "${CROSSLDFLAGS:=$(
329 + filter-flags '-fuse-ld=*'
330 + CC=${CROSSCC} test-flags-CCLD ${LDFLAGS})}"
331 + export CROSS{C,LD}FLAGS
332 + fi
333 +
334 + ECONF_SOURCE=${S} econf "${conf[@]}"
335 + )
336 + done
337 +}
338 +
339 +src_compile() {
340 + use abi_x86_64 && emake -C ../build64 # do first
341 + use abi_x86_32 && emake -C ../build32
342 +}
343 +
344 +src_install() {
345 + use abi_x86_32 && emake DESTDIR="${D}" -C ../build32 install
346 + use abi_x86_64 && emake DESTDIR="${D}" -C ../build64 install # do last
347 +
348 + # symlink for plain 'wine' and install its man pages if 64bit-only #404331
349 + if use abi_x86_64 && use !abi_x86_32; then
350 + dosym wine64 ${WINE_PREFIX}/bin/wine
351 + dosym wine64-preloader ${WINE_PREFIX}/bin/wine-preloader
352 + local man
353 + for man in ../build64/loader/wine.*man; do
354 + : "${man##*/wine}"
355 + : "${_%.*}"
356 + insinto ${WINE_DATADIR}/man/${_:+${_#.}/}man1
357 + newins ${man} wine.1
358 + done
359 + fi
360 +
361 + use perl || rm "${ED}"${WINE_DATADIR}/man/man1/wine{dump,maker}.1 \
362 + "${ED}"${WINE_PREFIX}/bin/{function_grep.pl,wine{dump,maker}} || die
363 +
364 + # create variant wrappers for eselect-wine
365 + local bin
366 + for bin in "${ED}"${WINE_PREFIX}/bin/*; do
367 + make_wrapper "${bin##*/}-${P#wine-}" "${bin#"${ED}"}"
368 + done
369 +
370 + # don't let portage try to strip PE files with the wrong
371 + # strip executable and instead handle it here (saves ~120MB)
372 + if use mingw; then
373 + dostrip -x ${WINE_PREFIX}/wine/{i386,x86_64}-windows
374 + use debug ||
375 + find "${ED}"${WINE_PREFIX}/wine/*-windows -regex '.*\.\(a\|dll\|exe\)' \
376 + -exec $(usex abi_x86_64 x86_64 i686)-w64-mingw32-strip --strip-unneeded {} + || die
377 + fi
378 +
379 + dodoc ANNOUNCE AUTHORS README* documentation/README*
380 +}
381 +
382 +pkg_postinst() {
383 + eselect wine update --if-unset || die
384 +}
385 +
386 +pkg_postrm() {
387 + eselect wine update --if-unset || die
388 +}