Gentoo Archives: gentoo-commits

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