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-staging/
Date: Sun, 03 Jul 2022 15:16:20
Message-Id: 1656861292.7f9b0512f19df9d28e34a82b4fdab2b50cf515a7.sarnex@gentoo
1 commit: 7f9b0512f19df9d28e34a82b4fdab2b50cf515a7
2 Author: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 3 15:10:47 2022 +0000
4 Commit: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 3 15:14:52 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f9b0512
7
8 app-emulation/wine-staging: Version bump
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>
12
13 app-emulation/wine-staging/Manifest | 2 +
14 .../wine-staging/wine-staging-7.12.ebuild | 542 +++++++++++++++++++++
15 2 files changed, 544 insertions(+)
16
17 diff --git a/app-emulation/wine-staging/Manifest b/app-emulation/wine-staging/Manifest
18 index 55d440c2da54..9bd27a08253e 100644
19 --- a/app-emulation/wine-staging/Manifest
20 +++ b/app-emulation/wine-staging/Manifest
21 @@ -1,9 +1,11 @@
22 DIST gentoo-wine-patches-20211122.tar.xz 59796 BLAKE2B 21460e6adf4934a52f8841f76f234a764c2dc1ac77eeed1cee10adafec3aa723640ebd4b51559e9ef433070ac731c4648620bd9e75e99f31b2e2f494cf01f02d SHA512 a18cb320617e2157977032c38c322177a2d248f14e43051d38de595af171495546c93d5e71e0dbe1a4f326a2dc819bb03dcfd04454ac85bbcd6b1975ae5d9d96
23 DIST wine-7.10.tar.xz 27915328 BLAKE2B fc778285cce52317d77461f0bce11d6e3214a536ecd42364d6cd31f609a23116fa582a7cb85873a99c61eb5cf5e1e3036e4d4d1887b87f75f501109ac3eb4625 SHA512 be460be6c3f6f54c20220287a7c4c9d41d27bd14fabb97b1f9824a4be361e38b2e2e51a621e0332d6c48934b1af425efaec92132f73e6d1270337ffbfcac2576
24 DIST wine-7.11.tar.xz 27975308 BLAKE2B 7031c950de4ee6d00c1006841a2d6fe55cebce644d354eb05cb963207b491a717c6ba7ce8f19c337167ec8bd6c1480427112a32b4363db745e99461be5917c77 SHA512 aff6a5996ba7336d97c59a1402688b109e6cca123c60fa6f03813d81ad6478f4ed4a62fb7813dc6952cca7ec1250182730873f3ac17f0855bbf000bf3c1d86fe
25 +DIST wine-7.12.tar.xz 28221024 BLAKE2B 551f37360a6dd2c535b5b1a9896cd9c9c091d56c4d2f3d2988092d48d54aa447fc0dad18034bad7b7beaa9c6587071e8d32bd08092a9ba93acb39dac9ddfc391 SHA512 4746fb1c3d0ec7f20e22d821f8e88e5415b85cb60f53e9ad61b89e8321b6a6b2999eb2b70c7ac46477f633bccb6c2aba49ce2655c380cb85cd5c71dbe4af50b4
26 DIST wine-7.8.tar.xz 27728116 BLAKE2B 3c878de8377906a687026bf1d5f9167bdce6b13a3d750d2a92fdcf70aed8e3da01560d26e4b075b6564b741996fc2168bb98c409f95618ab9fbb8e8b583a5384 SHA512 5e63edabc7dcdce62a1ce683c9ef387a2d801af3a0f99c32daacfea566a3813086f4f5977279c7b7526574f5cd95d052805bd5c145b82221d321d8aa638bfe1d
27 DIST wine-7.9.tar.xz 27783272 BLAKE2B 3265402b90913670b6a81a1f0d91d84d536734883749d31af572953e3b244ba721c15bb851e0e0e868c402d9add2e2007e49225bdaaa02a8dedee575d4e69602 SHA512 47ecbb8bc31a06d0f40a63469ffe3df4a1e05c9476a8926ec7f20c2230de8afecb5e0df9f3c5dd238ce3d0323d7cf9c9f48c41ef6ca149822458a4e605a2e029
28 DIST wine-staging-7.10.tar.gz 9646352 BLAKE2B acb68df0b79c5912ecfc400ac7b40fd0205908ce7edb06f69fa4c8e7a3c94d33551b98c7ae2aadded65c012aaf1b7990ac7aeefb37e7c07779aaeceb7d74397e SHA512 7c2aa5ec78f12ef3415f7e3615775f8a0a727f6e5bb0173f5746934166dbec5d4edfaa572d3fe26ef62fe933772346495a6c618d58ee0a6374028a158beb05c8
29 DIST wine-staging-7.11.tar.gz 9643832 BLAKE2B d215353a0163011b964d24d6e0cb3011286ce8d9ad6b42ad2bd389cb65c214db01a67a6f37db3eedd36d34995d7423112bbddbd06abbcbc5bb5f0d565d06a157 SHA512 5985f7536f7d0a8bedcfcdf095861a06589ea6ad9896c87043ca88f9ef3c4bc9854931b51b64471e361378f332cea70adc58ef9303e9e5d1a6dcc9789761c187
30 +DIST wine-staging-7.12.tar.gz 9644343 BLAKE2B 760b34abf245b8d2e5baed13db57a841bba73f9dd6652f958428fec3617000cdc00d6f3ac305f4b580cf462938a56ef9a6f0c6931306c25ce82b7fe4da314d9f SHA512 0cf7554011835052b75a836fca89c6cf9b5fa1653c96a82b0dcd3cf40147602eebaf81aa6b94348432371bef9550c8dc21c9cf7d78b49a422bd113e8a6a8e3b0
31 DIST wine-staging-7.8.tar.gz 9658435 BLAKE2B 0c089cd1498a5d8d90bbcabf8c3b55552176bc1f0c4717c6f7d1f6dcadfdaa0d52b0fdfd3c150de0da3626085e05fdb49343739950558bf47eff96f77f6a1464 SHA512 86f514a60d6f7ed612189a6834a18265a7551f3358903a3d67413d81d134c98f2aa7e4f79682be1a75d7bec194c4ca0bbf5d10c6e10277d451cd4aa332cc20ed
32 DIST wine-staging-7.9.tar.gz 9657482 BLAKE2B 2b7f30fde6a73d1012f31e83ca9fd7bd20d87a0edcf1f175115139e47d8aecdfeea5e432cd8cc4253773755856fff00e36aab25098a9a59ed44a2f0c572e7ba5 SHA512 6c856eeaa18bad56b5302939968995221277f80eb380510762535063929b7d95e58df11ad01459ab4e6a7f97efada8c09034457a58ad637620d3a296c93ace6d
33
34 diff --git a/app-emulation/wine-staging/wine-staging-7.12.ebuild b/app-emulation/wine-staging/wine-staging-7.12.ebuild
35 new file mode 100644
36 index 000000000000..9d69fea688ff
37 --- /dev/null
38 +++ b/app-emulation/wine-staging/wine-staging-7.12.ebuild
39 @@ -0,0 +1,542 @@
40 +# Copyright 1999-2022 Gentoo Authors
41 +# Distributed under the terms of the GNU General Public License v2
42 +
43 +EAPI=8
44 +
45 +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"
46 +PLOCALE_BACKUP="en"
47 +
48 +inherit autotools estack flag-o-matic multilib-minimal pax-utils plocale toolchain-funcs virtualx wrapper xdg-utils
49 +MY_PN="${PN%%-*}"
50 +MY_PV="${PV/_/-}"
51 +MY_P="${MY_PN}-${MY_PV}"
52 +
53 +if [[ ${MY_PV} == "9999" ]] ; then
54 + EGIT_REPO_URI="https://source.winehq.org/git/wine.git"
55 + EGIT_BRANCH="master"
56 + inherit git-r3
57 + SRC_URI=""
58 + #KEYWORDS=""
59 +else
60 + MAJOR_V=$(ver_cut 1)
61 + MINOR_V=$(ver_cut 2)
62 + if [[ ${MINOR_V} != "0" ]] ; then
63 + MINOR_V="x"
64 + fi
65 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.${MINOR_V}/${MY_P}.tar.xz"
66 + KEYWORDS="-* ~amd64 ~x86"
67 +fi
68 +S="${WORKDIR}/${MY_P}"
69 +
70 +STAGING_P="wine-staging-${MY_PV}"
71 +STAGING_DIR="${WORKDIR}/${STAGING_P}"
72 +GWP_V="20211122"
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 [[ ${MY_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${MY_PV}.tar.gz -> ${STAGING_P}.tar.gz )"
86 +fi
87 +
88 +LICENSE="LGPL-2.1"
89 +SLOT="${MY_PV}"
90 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi crossdev-mingw cups custom-cflags dos +fontconfig +gecko gphoto2 gssapi 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"
91 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
92 + X? ( truetype )
93 + crossdev-mingw? ( mingw )
94 + elibc_glibc? ( threads )
95 + osmesa? ( opengl )
96 + pipelight? ( staging )
97 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
98 +
99 +# FIXME: the test suite is unsuitable for us; many tests require net access
100 +# or fail due to Xvfb's opengl limitations.
101 +RESTRICT="test"
102 +
103 +BDEPEND="sys-devel/flex
104 + virtual/yacc
105 + virtual/pkgconfig
106 + mingw? ( !crossdev-mingw? ( dev-util/mingw64-toolchain[${MULTILIB_USEDEP}] ) )"
107 +
108 +COMMON_DEPEND="
109 + X? (
110 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
111 + x11-libs/libXext[${MULTILIB_USEDEP}]
112 + x11-libs/libXfixes[${MULTILIB_USEDEP}]
113 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
114 + x11-libs/libXi[${MULTILIB_USEDEP}]
115 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
116 + )
117 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
118 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
119 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
120 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
121 + gphoto2? (
122 + media-libs/libgphoto2:=[${MULTILIB_USEDEP}]
123 + media-libs/libjpeg-turbo:0=[${MULTILIB_USEDEP}]
124 + )
125 + gssapi? ( virtual/krb5[${MULTILIB_USEDEP}] )
126 + gstreamer? (
127 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
128 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
129 + )
130 + kerberos? ( virtual/krb5:0=[${MULTILIB_USEDEP}] )
131 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
132 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
133 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
134 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
135 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
136 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
137 + opengl? (
138 + virtual/opengl[${MULTILIB_USEDEP}]
139 + )
140 + osmesa? ( >=media-libs/mesa-13[osmesa,${MULTILIB_USEDEP}] )
141 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
142 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
143 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
144 + sdl? ( media-libs/libsdl2:=[haptic,joystick,${MULTILIB_USEDEP}] )
145 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
146 + staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
147 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
148 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
149 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
150 + unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
151 + usb? ( virtual/libusb:1[${MULTILIB_USEDEP}] )
152 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
153 + vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
154 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
155 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )"
156 +
157 +RDEPEND="${COMMON_DEPEND}
158 + app-emulation/wine-desktop-common
159 + >app-eselect/eselect-wine-0.3
160 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
161 + gecko? ( app-emulation/wine-gecko:2.47.2[abi_x86_32?,abi_x86_64?] )
162 + mono? ( app-emulation/wine-mono:7.3.0 )
163 + perl? (
164 + dev-lang/perl
165 + dev-perl/XML-Simple
166 + )
167 + pulseaudio? (
168 + realtime? ( sys-auth/rtkit )
169 + )
170 + samba? ( >=net-fs/samba-3.0.25[winbind] )
171 + selinux? ( sec-policy/selinux-wine )
172 + udisks? ( sys-fs/udisks:2 )"
173 +
174 +# tools/make_requests requires perl
175 +DEPEND="${COMMON_DEPEND}
176 + ${BDEPEND}
177 + >=sys-kernel/linux-headers-2.6
178 + X? ( x11-base/xorg-proto )
179 + staging? (
180 + dev-lang/perl
181 + dev-perl/XML-Simple
182 + )
183 + xinerama? ( x11-base/xorg-proto )"
184 +
185 +# These use a non-standard "Wine" category, which is provided by
186 +# /etc/xdg/applications-merged/wine.menu
187 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
188 +usr/share/applications/wine-notepad.desktop
189 +usr/share/applications/wine-uninstaller.desktop
190 +usr/share/applications/wine-winecfg.desktop"
191 +
192 +PATCHES=(
193 + "${PATCHDIR}/patches/${MY_PN}-6.22-winegcc.patch" #260726
194 + "${PATCHDIR}/patches/${MY_PN}-4.7-multilib-portage.patch" #395615
195 + "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch" #310611
196 +)
197 +PATCHES_BIN=()
198 +
199 +# https://bugs.gentoo.org/show_bug.cgi?id=635222
200 +if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${MY_PV} == 9999 ]]; then
201 + DEPEND+=" dev-util/patchbin"
202 +fi
203 +
204 +wine_compiler_check() {
205 + # Ensure compiler support
206 + # (No checks here as of 2022)
207 + return 0
208 +}
209 +
210 +wine_build_environment_check() {
211 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
212 +
213 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
214 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
215 + eerror "See https://bugs.gentoo.org/487864 for more details."
216 + eerror
217 + return 1
218 + fi
219 +}
220 +
221 +wine_env_vcs_vars() {
222 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
223 + local pn_live_val="${pn_live_var}"
224 + eval pn_live_val='$'${pn_live_val}
225 + if [[ ! -z ${pn_live_val} ]]; then
226 + if use staging; then
227 + eerror "Because of the multi-repo nature of ${MY_PN}, ${pn_live_var}"
228 + eerror "cannot be used to set the commit. Instead, you may use the"
229 + eerror "environment variables:"
230 + eerror " EGIT_OVERRIDE_COMMIT_WINE"
231 + eerror " EGIT_OVERRIDE_COMMIT_WINE_STAGING_WINE_STAGING"
232 + eerror
233 + return 1
234 + fi
235 + fi
236 + if [[ ! -z ${EGIT_COMMIT} ]]; then
237 + eerror "Commits must now be specified using the environment variables:"
238 + eerror " EGIT_OVERRIDE_COMMIT_WINE"
239 + eerror " EGIT_OVERRIDE_COMMIT_WINE_STAGING_WINE_STAGING"
240 + eerror
241 + return 1
242 + fi
243 +}
244 +
245 +pkg_pretend() {
246 + if [[ ${MERGE_TYPE} != binary ]] ; then
247 + wine_build_environment_check || die
248 +
249 + # Verify OSS support
250 + if use oss; then
251 + if ! has_version ">=media-sound/oss-4"; then
252 + eerror "You cannot build wine with USE=oss without having support from"
253 + eerror ">=media-sound/oss-4 (only available through external repos)"
254 + eerror
255 + die
256 + fi
257 + fi
258 +
259 + if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then
260 + local mingw=-w64-mingw32
261 + for mingw in $(usev abi_x86_64 x86_64${mingw}) $(usev abi_x86_32 i686${mingw}); do
262 + type -P ${mingw}-gcc && continue
263 + eerror "With USE=crossdev-mingw, you must prepare the MinGW toolchain"
264 + eerror "yourself by installing sys-devel/crossdev then running:"
265 + eerror
266 + eerror " crossdev --target ${mingw}"
267 + eerror
268 + eerror "For more information, please see: https://wiki.gentoo.org/wiki/Mingw"
269 + die "USE=crossdev-mingw is enabled, but ${mingw}-gcc was not found"
270 + done
271 + fi
272 + fi
273 +}
274 +
275 +pkg_setup() {
276 + wine_build_environment_check || die
277 + wine_env_vcs_vars || die
278 +
279 + WINE_VARIANT="${PN#wine}-${MY_PV}"
280 + WINE_VARIANT="${WINE_VARIANT#-}"
281 +
282 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
283 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
284 + MY_DATADIR="${MY_DATAROOTDIR}"
285 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
286 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
287 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
288 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
289 + MY_MANDIR="${MY_DATADIR}/man"
290 +}
291 +
292 +src_unpack() {
293 + if [[ ${MY_PV} == "9999" ]] ; then
294 + EGIT_CHECKOUT_DIR="${S}" git-r3_src_unpack
295 + if use staging; then
296 + local CURRENT_WINE_COMMIT=${EGIT_VERSION}
297 +
298 + EGIT_CHECKOUT_DIR="${STAGING_DIR}" EGIT_REPO_URI="${STAGING_EGIT_REPO_URI}" git-r3_src_unpack
299 +
300 + local COMPAT_WINE_COMMIT=$("${STAGING_DIR}/patches/patchinstall.sh" --upstream-commit) || die
301 +
302 + if [[ "${CURRENT_WINE_COMMIT}" != "${COMPAT_WINE_COMMIT}" ]]; then
303 + einfo "The current Staging patchset is not guaranteed to apply on this WINE commit."
304 + einfo "If src_prepare fails, try emerging with the env var WINE_COMMIT."
305 + einfo "Example: EGIT_OVERRIDE_COMMIT_WINE=${COMPAT_WINE_COMMIT} emerge -1 wine"
306 + fi
307 + fi
308 + fi
309 +
310 + default
311 +
312 + plocale_find_changes "${S}/po" "" ".po"
313 +}
314 +
315 +src_prepare() {
316 +
317 + eapply_bin(){
318 + local patch
319 + for patch in ${PATCHES_BIN[@]}; do
320 + patchbin --nogit < "${patch}" || die
321 + done
322 + }
323 +
324 + local md5="$(md5sum server/protocol.def)"
325 +
326 + if use staging; then
327 + ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
328 + ewarn "Wine bugzilla should explicitly state that staging was used."
329 +
330 + local STAGING_EXCLUDE="-W winemenubuilder-Desktop_Icon_Path" #652176
331 + use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
332 +
333 + # Launch wine-staging patcher in a subshell, using eapply as a backend, and gitapply.sh as a backend for binary patches
334 + ebegin "Running Wine-Staging patch installer"
335 + (
336 + set -- DESTDIR="${S}" --backend=eapply --no-autoconf --all ${STAGING_EXCLUDE}
337 + cd "${STAGING_DIR}/patches"
338 + source "${STAGING_DIR}/patches/patchinstall.sh"
339 + )
340 + eend $? || die "Failed to apply Wine-Staging patches"
341 + fi
342 +
343 + default
344 + eapply_bin
345 + eautoreconf
346 +
347 + # Modification of the server protocol requires regenerating the server requests
348 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
349 + einfo "server/protocol.def was patched; running tools/make_requests"
350 + tools/make_requests || die #432348
351 + fi
352 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
353 + if ! use run-exes; then
354 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
355 + fi
356 +
357 + # Edit wine.desktop to work for specific variant
358 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
359 +
360 + # hi-res default icon, #472990, https://bugs.winehq.org/show_bug.cgi?id=24652
361 + cp "${PATCHDIR}/files/oic_winlogo.ico" dlls/user32/resources/ || die
362 +
363 + plocale_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
364 +
365 + # Fix manpage generation for locales #469418 and abi_x86_64 #617864
366 +
367 + # Duplicate manpages input files for wine64
368 + local f
369 + for f in loader/*.man.in; do
370 + cp ${f} ${f/wine/wine64} || die
371 + done
372 + # Add wine64 manpages to Makefile
373 + if use abi_x86_64; then
374 + sed -i "/wine.man.in/i \
375 + \\\twine64.man.in \\\\" loader/Makefile.in || die
376 + sed -i -E 's/(.*wine)(.*\.UTF-8\.man\.in.*)/&\
377 +\164\2/' loader/Makefile.in || die
378 + fi
379 +
380 + rm_man_file(){
381 + local file="${1}"
382 + loc=${2}
383 + sed -i "/${loc}\.UTF-8\.man\.in/d" "${file}" || die
384 + }
385 +
386 + while read f; do
387 + plocale_for_each_disabled_locale rm_man_file "${f}"
388 + done < <(find -name "Makefile.in" -exec grep -q "UTF-8.man.in" "{}" \; -print)
389 +}
390 +
391 +src_configure() {
392 + wine_compiler_check || die
393 +
394 + export LDCONFIG=/bin/true
395 + use custom-cflags || strip-flags
396 + if use mingw; then
397 + use crossdev-mingw || PATH="${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}"
398 +
399 + # use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
400 + local mingwcc=${CROSSCC:-$(usex x86 i686 x86_64)-w64-mingw32-gcc}
401 + : "${CROSSCFLAGS:=$(CC=${mingwcc} test-flags-CC ${CFLAGS:--O2})}"
402 + : "${CROSSLDFLAGS:=$(CC=${mingwcc} test-flags-CCLD ${LDFLAGS})}"
403 + export CROSS{C,LD}FLAGS
404 + fi
405 +
406 + multilib-minimal_src_configure
407 +}
408 +
409 +multilib_src_configure() {
410 + local myconf=(
411 + --prefix="${MY_PREFIX}"
412 + --datarootdir="${MY_DATAROOTDIR}"
413 + --datadir="${MY_DATADIR}"
414 + --docdir="${MY_DOCDIR}"
415 + --includedir="${MY_INCLUDEDIR}"
416 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
417 + --libexecdir="${MY_LIBEXECDIR}"
418 + --localstatedir="${MY_LOCALSTATEDIR}"
419 + --mandir="${MY_MANDIR}"
420 + --sysconfdir="${EPREFIX}/etc/wine"
421 + $(use_with alsa)
422 + $(use_with capi)
423 + $(use_with cups)
424 + $(use_with udisks dbus)
425 + $(use_with fontconfig)
426 + $(use_with ssl gnutls)
427 + $(use_enable gecko mshtml)
428 + $(use_with gphoto2 gphoto)
429 + $(use_with gssapi)
430 + $(use_with gstreamer)
431 + --enable-hal
432 + $(use_with kerberos krb5)
433 + $(use_with ldap)
434 + # TODO: Will bug 685172 still need special handling?
435 + $(use_with mingw)
436 + $(use_enable mono mscoree)
437 + $(use_with netapi)
438 + $(use_with nls gettext)
439 + $(use_with openal)
440 + $(use_with opencl)
441 + $(use_with opengl)
442 + $(use_with osmesa)
443 + $(use_with oss)
444 + $(use_with pcap)
445 + $(use_with pulseaudio pulse)
446 + $(use_with threads pthread)
447 + $(use_with scanner sane)
448 + $(use_with sdl)
449 + $(use_enable test tests)
450 + $(use_with truetype freetype)
451 + $(use_with udev)
452 + $(use_with unwind)
453 + $(use_with usb)
454 + $(use_with v4l v4l2)
455 + $(use_with vulkan)
456 + $(use_with X x)
457 + $(use_with X xfixes)
458 + $(use_with xcomposite)
459 + $(use_with xinerama)
460 + )
461 +
462 + use staging && myconf+=(
463 + --with-xattr
464 + )
465 +
466 + local PKG_CONFIG
467 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
468 + tc-export PKG_CONFIG
469 +
470 + if use amd64; then
471 + if [[ ${ABI} == amd64 ]]; then
472 + myconf+=( --enable-win64 )
473 + else
474 + myconf+=( --disable-win64 )
475 + fi
476 +
477 + # Note: using --with-wine64 results in problems with multilib.eclass
478 + # CC/LD hackery. We're using separate tools instead.
479 + fi
480 +
481 + ECONF_SOURCE=${S} \
482 + econf "${myconf[@]}"
483 + emake depend
484 +}
485 +
486 +multilib_src_test() {
487 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
488 + if [[ ${ABI} == x86 ]]; then
489 + if [[ $(id -u) == 0 ]]; then
490 + ewarn "Skipping tests since they cannot be run under the root user."
491 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
492 + return
493 + fi
494 +
495 + WINEPREFIX="${T}/.wine-${ABI}" \
496 + virtx emake test
497 + fi
498 +}
499 +
500 +multilib_src_install_all() {
501 + local DOCS=( ANNOUNCE AUTHORS README )
502 + add_locale_docs() {
503 + local locale_doc="documentation/README.$1"
504 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
505 + }
506 + plocale_for_each_locale add_locale_docs
507 +
508 + einstalldocs
509 + find "${ED}" -name *.la -delete || die
510 +
511 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
512 + rm "${D%}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
513 + "${D%}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
514 + fi
515 +
516 + use abi_x86_32 && pax-mark psmr "${D%}${MY_PREFIX}"/bin/wine{,-preloader} #255055
517 + use abi_x86_64 && pax-mark psmr "${D%}${MY_PREFIX}"/bin/wine64{,-preloader}
518 +
519 + # Avoid double prefix from dosym and make_wrapper
520 + MY_PREFIX=${MY_PREFIX#${EPREFIX}}
521 +
522 + if use abi_x86_64 && ! use abi_x86_32; then
523 + dosym wine64 "${MY_PREFIX}"/bin/wine # 404331
524 + dosym wine64-preloader "${MY_PREFIX}"/bin/wine-preloader
525 + fi
526 +
527 + # Failglob for binloops, shouldn't be necessary, but including to stay safe
528 + eshopts_push -s failglob #615218
529 + # Make wrappers for binaries for handling multiple variants
530 + # Note: wrappers instead of symlinks because some are shell which use basename
531 + local b
532 + for b in "${ED%}${MY_PREFIX}"/bin/*; do
533 + make_wrapper "${b##*/}-${WINE_VARIANT}" "${MY_PREFIX}/bin/${b##*/}"
534 + done
535 + eshopts_pop
536 +}
537 +
538 +pkg_postinst() {
539 + eselect wine register ${PN}-${MY_PV}
540 + if [[ ${PN} == "wine-vanilla" ]]; then
541 + eselect wine register --vanilla ${PN}-${MY_PV} || die
542 + else
543 + if use staging; then
544 + eselect wine register --staging ${PN}-${MY_PV} || die
545 + fi
546 + fi
547 +
548 + eselect wine update --all --if-unset || die
549 +
550 + xdg_desktop_database_update
551 +
552 + if ! use gecko; then
553 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
554 + ewarn "implementation of iexplore. Many older windows applications"
555 + ewarn "rely upon the existence of an iexplore implementation, so"
556 + ewarn "you will likely need to install an external one, like via winetricks"
557 + fi
558 + if ! use mono; then
559 + ewarn "Without Wine Mono, wine prefixes will not have a default"
560 + ewarn "implementation of .NET. Many windows applications rely upon"
561 + ewarn "the existence of a .NET implementation, so you will likely need"
562 + ewarn "to install an external one, like via winetricks"
563 + fi
564 +}
565 +
566 +pkg_prerm() {
567 + eselect wine deregister ${PN}-${MY_PV}
568 + if [[ ${PN} == "wine-vanilla" ]]; then
569 + eselect wine deregister --vanilla ${PN}-${MY_PV} || die
570 + else
571 + if use staging; then
572 + eselect wine deregister --staging ${PN}-${MY_PV}|| die
573 + fi
574 + fi
575 +
576 + eselect wine update --all --if-unset || die
577 +}
578 +
579 +pkg_postrm() {
580 + xdg_desktop_database_update
581 +}