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