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