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