1 |
commit: 2e0980beada259e57077f4b99d068d3b85557d28 |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 10 23:26:08 2022 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 3 19:46:00 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e0980be |
7 |
|
8 |
app-emulation/wine-proton: new package, add 7.0.4 |
9 |
|
10 |
This is Valve's modified wine fork as used by Proton (includes |
11 |
various workarounds for games, fsync support, etc...), which |
12 |
can be used independently as a eselect'able Wine variant. |
13 |
|
14 |
Also using a new experimental ebuild that's not based on existing |
15 |
Wine ones -- may have regressions unrelated to the variant itself. |
16 |
Trims some ancient unnecessary bits, skips a few things I feel the |
17 |
ebuild doesn't need to handle, and change build method a bit. |
18 |
|
19 |
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> |
20 |
|
21 |
app-emulation/wine-proton/Manifest | 1 + |
22 |
app-emulation/wine-proton/files/README.gentoo | 52 ++++ |
23 |
.../files/wine-proton-7.0.4-llvm-libunwind.patch | 9 + |
24 |
.../files/wine-proton-7.0.4-noexecstack.patch | 7 + |
25 |
.../wine-proton-7.0.4-restore-menubuilder.patch | 14 + |
26 |
app-emulation/wine-proton/metadata.xml | 28 ++ |
27 |
app-emulation/wine-proton/wine-proton-7.0.4.ebuild | 303 +++++++++++++++++++++ |
28 |
7 files changed, 414 insertions(+) |
29 |
|
30 |
diff --git a/app-emulation/wine-proton/Manifest b/app-emulation/wine-proton/Manifest |
31 |
new file mode 100644 |
32 |
index 000000000000..69394f0077a5 |
33 |
--- /dev/null |
34 |
+++ b/app-emulation/wine-proton/Manifest |
35 |
@@ -0,0 +1 @@ |
36 |
+DIST proton-wine-7.0-4.tar.gz 45561670 BLAKE2B 0bc3432e5aa9ca1655e76b31dcbef08febe263e07d3635d005fbc7798b3a08fa50e2e736f33b18700f187dc755f012d7e8ae3edae6a63fb433cd9b8861b747b0 SHA512 dccdf4115e2a7c92981163783f5705e78fbfa042f06123e4802251bd2c558e8b4de7e3d2e114a5d942f9493eb64fb7fdedff2e6e8b3f21ea1de1156456930d8c |
37 |
|
38 |
diff --git a/app-emulation/wine-proton/files/README.gentoo b/app-emulation/wine-proton/files/README.gentoo |
39 |
new file mode 100644 |
40 |
index 000000000000..988d28df7ddf |
41 |
--- /dev/null |
42 |
+++ b/app-emulation/wine-proton/files/README.gentoo |
43 |
@@ -0,0 +1,52 @@ |
44 |
+While this version of Wine is usable independently, it does contain some |
45 |
+Steam-oriented changes that may be unexpected. Notably C:\users\steamuser |
46 |
+is used rather than C:\users\<user-name> and it may be necessary to move |
47 |
+files if converting from non-proton Wine prefixes (like games' save files). |
48 |
+ |
49 |
+To keep a low maintenance cost, these changes are not reverted in Gentoo |
50 |
+with the exception of re-enabling winemenubuilder for desktop entries. |
51 |
+ |
52 |
+Also, given this Wine variant is oriented toward running games, some |
53 |
+normally unrelated features (e.g. ldap) may not have real upstream |
54 |
+(Valve) support. Because of this, some are left always disabled. |
55 |
+ |
56 |
+If needed, use other variants for the more expected Wine behavior. |
57 |
+ |
58 |
+--- |
59 |
+ |
60 |
+Given Proton is not creating the Wine prefixes, some features are not |
61 |
+enabled by default and PROTON_* variables to control them are unrecognized. |
62 |
+ |
63 |
+To (optionally) setup some notable defaults of Proton: |
64 |
+- export WINEFSYNC=1 |
65 |
+. Often improves performance for CPU-bound applications, recommended |
66 |
+. but should be left disabled if get crashes mentioning fsync errors. |
67 |
+. >Requires linux kernel >=5.16 if unpatched. |
68 |
+- export WINE_LARGE_ADDRESS_AWARE=1 |
69 |
+. Allows 32bit applications to access more memory, notably helps |
70 |
+. prevent crashes on memory-heavy applications while using dxvk below. |
71 |
+- WINEPREFIX=/path/to setup_dxvk.sh install --symlink |
72 |
+. Vulkan-based d3d9/10/11 that often provides both better performance |
73 |
+. and compatibility (strongly recommended). |
74 |
+. >Requires app-emulation/dxvk |
75 |
+- WINEPREFIX=/path/to setup_vkd3d_proton.sh install --symlink |
76 |
+. Like above, but for d3d12. Wine also supports vkd3d as-is but this |
77 |
+. is the modified fork used by Proton (may or may not be better). |
78 |
+. >Requires app-emulation/vkd3d-proton |
79 |
+ |
80 |
+For some applications it may be better to disable these or do other |
81 |
+workarounds, see https://www.protondb.com/ for specific information. |
82 |
+ |
83 |
+Many other proton-specific improvements / fixes are always enabled, and |
84 |
+some game-specific quirks are auto-enabled as needed (can see a few from |
85 |
+running winecfg). |
86 |
+ |
87 |
+If have audio/video playback issues, note to look at GStreamer plugins. |
88 |
+Notably USE=ffmpeg on media-plugins/gst-plugins-meta which Proton normally |
89 |
+provide by default. |
90 |
+ |
91 |
+--- |
92 |
+ |
93 |
+If have other Wine variants installed, remember to either use `eselect wine` |
94 |
+to select this variant or call it as wine-proton. Note other available |
95 |
+variants may be auto-selected when removing/replacing a selected slot. |
96 |
|
97 |
diff --git a/app-emulation/wine-proton/files/wine-proton-7.0.4-llvm-libunwind.patch b/app-emulation/wine-proton/files/wine-proton-7.0.4-llvm-libunwind.patch |
98 |
new file mode 100644 |
99 |
index 000000000000..0086fa5e0353 |
100 |
--- /dev/null |
101 |
+++ b/app-emulation/wine-proton/files/wine-proton-7.0.4-llvm-libunwind.patch |
102 |
@@ -0,0 +1,9 @@ |
103 |
+Note the dodgy _CONFIG_H_ check can be removed when >=llvm-libunwind-15 |
104 |
+(which adds _VERSION) is well established: https://reviews.llvm.org/D121015 |
105 |
+--- a/dlls/ntdll/unix/signal_x86_64.c |
106 |
++++ b/dlls/ntdll/unix/signal_x86_64.c |
107 |
+@@ -1370,3 +1370,3 @@ |
108 |
+ |
109 |
+-#ifdef __APPLE__ |
110 |
++#if defined(__APPLE__) || defined(_LIBUNWIND_VERSION) || defined(____LIBUNWIND_CONFIG_H__) |
111 |
+ rc = unw_getcontext( &unw_context ); |
112 |
|
113 |
diff --git a/app-emulation/wine-proton/files/wine-proton-7.0.4-noexecstack.patch b/app-emulation/wine-proton/files/wine-proton-7.0.4-noexecstack.patch |
114 |
new file mode 100644 |
115 |
index 000000000000..92aa0b4b5c5d |
116 |
--- /dev/null |
117 |
+++ b/app-emulation/wine-proton/files/wine-proton-7.0.4-noexecstack.patch |
118 |
@@ -0,0 +1,7 @@ |
119 |
+Also write GNU-stack note on dummy files used for stub libraries. |
120 |
+--- a/tools/winebuild/import.c |
121 |
++++ b/tools/winebuild/import.c |
122 |
+@@ -1675,2 +1675,3 @@ |
123 |
+ output( "\t.text\n" ); |
124 |
++ output_gnu_stack_note(); |
125 |
+ } |
126 |
|
127 |
diff --git a/app-emulation/wine-proton/files/wine-proton-7.0.4-restore-menubuilder.patch b/app-emulation/wine-proton/files/wine-proton-7.0.4-restore-menubuilder.patch |
128 |
new file mode 100644 |
129 |
index 000000000000..760340791060 |
130 |
--- /dev/null |
131 |
+++ b/app-emulation/wine-proton/files/wine-proton-7.0.4-restore-menubuilder.patch |
132 |
@@ -0,0 +1,14 @@ |
133 |
+Without Steam there is no launcher by default, users with more custom |
134 |
+setups may not need this but others will want access to desktop entries. |
135 |
+--- a/configure.ac |
136 |
++++ b/configure.ac |
137 |
+@@ -3683,2 +3683,3 @@ |
138 |
+ WINE_CONFIG_MAKEFILE(programs/winefile) |
139 |
++WINE_CONFIG_MAKEFILE(programs/winemenubuilder) |
140 |
+ WINE_CONFIG_MAKEFILE(programs/winemine) |
141 |
+--- a/loader/wine.inf.in |
142 |
++++ b/loader/wine.inf.in |
143 |
+@@ -5630,2 +5630,3 @@ |
144 |
+ [Services] |
145 |
++HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r" |
146 |
+ HKLM,"System\CurrentControlSet\Services\Eventlog\Application",,16 |
147 |
|
148 |
diff --git a/app-emulation/wine-proton/metadata.xml b/app-emulation/wine-proton/metadata.xml |
149 |
new file mode 100644 |
150 |
index 000000000000..e0ea57df1f22 |
151 |
--- /dev/null |
152 |
+++ b/app-emulation/wine-proton/metadata.xml |
153 |
@@ -0,0 +1,28 @@ |
154 |
+<?xml version="1.0" encoding="UTF-8"?> |
155 |
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> |
156 |
+<pkgmetadata> |
157 |
+ <maintainer type="person"> |
158 |
+ <email>ionen@g.o</email> |
159 |
+ <name>Ionen Wolkens</name> |
160 |
+ </maintainer> |
161 |
+ <maintainer type="project"> |
162 |
+ <email>wine@g.o</email> |
163 |
+ <name>Wine</name> |
164 |
+ </maintainer> |
165 |
+ <use> |
166 |
+ <flag name="crossdev-mingw"> |
167 |
+ Use <pkg>sys-devel/crossdev</pkg> for the toolchain rather than |
168 |
+ <pkg>dev-util/mingw64-toolchain</pkg> (requires manual setting up) |
169 |
+ </flag> |
170 |
+ <flag name="gecko">Enable mshtml support using <pkg>app-emulation/wine-gecko</pkg></flag> |
171 |
+ <flag name="mono">Enable .NET support using <pkg>app-emulation/wine-mono</pkg></flag> |
172 |
+ <flag name="osmesa">Enable off-screen rendering (OpenGL in bitmaps) support</flag> |
173 |
+ <flag name="perl">Install helpers that require perl (winedump/winemaker)</flag> |
174 |
+ <flag name="sdl">Enable gamepad support using <pkg>media-libs/libsdl2</pkg></flag> |
175 |
+ <flag name="vkd3d">Enable DirectX 12 support using <pkg>app-emulation/vkd3d</pkg></flag> |
176 |
+ </use> |
177 |
+ <upstream> |
178 |
+ <changelog>https://github.com/ValveSoftware/Proton/wiki/Changelog</changelog> |
179 |
+ <remote-id type="github">ValveSoftware/wine</remote-id> |
180 |
+ </upstream> |
181 |
+</pkgmetadata> |
182 |
|
183 |
diff --git a/app-emulation/wine-proton/wine-proton-7.0.4.ebuild b/app-emulation/wine-proton/wine-proton-7.0.4.ebuild |
184 |
new file mode 100644 |
185 |
index 000000000000..b78eed8c93c6 |
186 |
--- /dev/null |
187 |
+++ b/app-emulation/wine-proton/wine-proton-7.0.4.ebuild |
188 |
@@ -0,0 +1,303 @@ |
189 |
+# Copyright 2022 Gentoo Authors |
190 |
+# Distributed under the terms of the GNU General Public License v2 |
191 |
+ |
192 |
+EAPI=8 |
193 |
+ |
194 |
+MULTILIB_COMPAT=( abi_x86_{32,64} ) |
195 |
+PYTHON_COMPAT=( python3_{8..11} ) |
196 |
+inherit autotools flag-o-matic multilib multilib-build \ |
197 |
+ python-any-r1 readme.gentoo-r1 toolchain-funcs wrapper |
198 |
+ |
199 |
+WINE_GECKO=2.47.3 |
200 |
+WINE_MONO=7.3.0 |
201 |
+WINE_PV=$(ver_rs 2 -) |
202 |
+ |
203 |
+DESCRIPTION="Valve Software's fork of Wine" |
204 |
+HOMEPAGE="https://github.com/ValveSoftware/wine/" |
205 |
+SRC_URI="https://github.com/ValveSoftware/wine/archive/refs/tags/proton-wine-${WINE_PV}.tar.gz" |
206 |
+S="${WORKDIR}/${PN}-wine-${WINE_PV}" |
207 |
+ |
208 |
+LICENSE="LGPL-2.1+ BSD-2 IJG MIT ZLIB gsm libpng2 libtiff" |
209 |
+SLOT="${PV}" |
210 |
+KEYWORDS="-* ~amd64 ~x86" |
211 |
+IUSE=" |
212 |
+ +abi_x86_32 +abi_x86_64 +alsa crossdev-mingw custom-cflags debug |
213 |
+ +fontconfig +gecko +gstreamer llvm-libunwind +mono nls openal |
214 |
+ osmesa perl pulseaudio +sdl selinux +ssl udev udisks +unwind usb |
215 |
+ v4l +vkd3d +xcomposite xinerama" |
216 |
+ |
217 |
+WINE_DLOPEN_DEPEND=" |
218 |
+ dev-libs/gmp:=[${MULTILIB_USEDEP}] |
219 |
+ dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] |
220 |
+ media-libs/freetype[${MULTILIB_USEDEP}] |
221 |
+ media-libs/libglvnd[X,${MULTILIB_USEDEP}] |
222 |
+ media-libs/vulkan-loader[${MULTILIB_USEDEP}] |
223 |
+ x11-libs/libXcursor[${MULTILIB_USEDEP}] |
224 |
+ x11-libs/libXfixes[${MULTILIB_USEDEP}] |
225 |
+ x11-libs/libXi[${MULTILIB_USEDEP}] |
226 |
+ x11-libs/libXrandr[${MULTILIB_USEDEP}] |
227 |
+ x11-libs/libXrender[${MULTILIB_USEDEP}] |
228 |
+ x11-libs/libXxf86vm[${MULTILIB_USEDEP}] |
229 |
+ fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] ) |
230 |
+ osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] ) |
231 |
+ sdl? ( media-libs/libsdl2[haptic,joystick,${MULTILIB_USEDEP}] ) |
232 |
+ ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] ) |
233 |
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] ) |
234 |
+ v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] ) |
235 |
+ xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] ) |
236 |
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )" |
237 |
+WINE_COMMON_DEPEND=" |
238 |
+ ${WINE_DLOPEN_DEPEND} |
239 |
+ x11-libs/libX11[${MULTILIB_USEDEP}] |
240 |
+ x11-libs/libXext[${MULTILIB_USEDEP}] |
241 |
+ alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] ) |
242 |
+ gstreamer? ( |
243 |
+ dev-libs/glib:2[${MULTILIB_USEDEP}] |
244 |
+ media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}] |
245 |
+ media-libs/gstreamer:1.0[${MULTILIB_USEDEP}] |
246 |
+ ) |
247 |
+ openal? ( media-libs/openal[${MULTILIB_USEDEP}] ) |
248 |
+ pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] ) |
249 |
+ udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] ) |
250 |
+ unwind? ( |
251 |
+ llvm-libunwind? ( sys-libs/llvm-libunwind[${MULTILIB_USEDEP}] ) |
252 |
+ !llvm-libunwind? ( sys-libs/libunwind:=[${MULTILIB_USEDEP}] ) |
253 |
+ ) |
254 |
+ usb? ( dev-libs/libusb:1[${MULTILIB_USEDEP}] ) |
255 |
+ vkd3d? ( >=app-emulation/vkd3d-1.2[${MULTILIB_USEDEP}] )" |
256 |
+RDEPEND=" |
257 |
+ ${WINE_COMMON_DEPEND} |
258 |
+ app-emulation/wine-desktop-common |
259 |
+ gecko? ( app-emulation/wine-gecko:${WINE_GECKO}[${MULTILIB_USEDEP}] ) |
260 |
+ gstreamer? ( media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}] ) |
261 |
+ mono? ( app-emulation/wine-mono:${WINE_MONO} ) |
262 |
+ perl? ( |
263 |
+ dev-lang/perl |
264 |
+ dev-perl/XML-LibXML |
265 |
+ ) |
266 |
+ selinux? ( sec-policy/selinux-wine ) |
267 |
+ udisks? ( sys-fs/udisks:2 )" |
268 |
+DEPEND=" |
269 |
+ ${WINE_COMMON_DEPEND} |
270 |
+ sys-kernel/linux-headers |
271 |
+ x11-base/xorg-proto" |
272 |
+BDEPEND=" |
273 |
+ ${PYTHON_DEPS} |
274 |
+ dev-lang/perl |
275 |
+ sys-devel/bison |
276 |
+ sys-devel/flex |
277 |
+ virtual/pkgconfig |
278 |
+ nls? ( sys-devel/gettext ) |
279 |
+ !crossdev-mingw? ( dev-util/mingw64-toolchain[${MULTILIB_USEDEP}] )" |
280 |
+IDEPEND=">=app-eselect/eselect-wine-1.2.2-r1" |
281 |
+ |
282 |
+QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext |
283 |
+ |
284 |
+PATCHES=( |
285 |
+ "${FILESDIR}"/${PN}-7.0.4-llvm-libunwind.patch |
286 |
+ "${FILESDIR}"/${PN}-7.0.4-noexecstack.patch |
287 |
+ "${FILESDIR}"/${PN}-7.0.4-restore-menubuilder.patch |
288 |
+) |
289 |
+ |
290 |
+pkg_pretend() { |
291 |
+ [[ ${MERGE_TYPE} == binary ]] && return |
292 |
+ |
293 |
+ if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then |
294 |
+ local mingw=-w64-mingw32 |
295 |
+ for mingw in $(usev abi_x86_64 x86_64${mingw}) $(usev abi_x86_32 i686${mingw}); do |
296 |
+ type -P ${mingw}-gcc >/dev/null && continue |
297 |
+ eerror "With USE=crossdev-mingw, you must prepare the MinGW toolchain" |
298 |
+ eerror "yourself by installing sys-devel/crossdev then running:" |
299 |
+ eerror |
300 |
+ eerror " crossdev --target ${mingw}" |
301 |
+ eerror |
302 |
+ eerror "For more information, please see: https://wiki.gentoo.org/wiki/Mingw" |
303 |
+ eerror "--> Note that mingw builds are default for ${PN} even without this USE." |
304 |
+ die "USE=crossdev-mingw is enabled, but ${mingw}-gcc was not found" |
305 |
+ done |
306 |
+ fi |
307 |
+} |
308 |
+ |
309 |
+src_prepare() { |
310 |
+ # sanity check, bumping these has a history of oversights |
311 |
+ local geckomono="$(sed -En '/^#define (GECKO|MONO)_VER/{s/[^0-9.]//gp}' \ |
312 |
+ dlls/appwiz.cpl/addons.c || die)" |
313 |
+ [[ ${WINE_GECKO}$'\n'${WINE_MONO} == "${geckomono}" ]] || |
314 |
+ die "gecko/mono mismatch, has:" ${geckomono} |
315 |
+ |
316 |
+ default |
317 |
+ |
318 |
+ # ensure .desktop calls this variant + slot |
319 |
+ sed -i "/^Exec=/s/wine /${P} /" loader/wine.desktop || die |
320 |
+ |
321 |
+ # similarly to staging, append to `wine --version` for identification |
322 |
+ sed -i "s/wine_build[^1]*1/& (Proton-${WINE_PV})/" configure.ac || die |
323 |
+ |
324 |
+ # source has outdated auto-generated files, update like Proton's Makefile |
325 |
+ eautoreconf |
326 |
+ tools/make_requests || die # perl |
327 |
+ dlls/winevulkan/make_vulkan -x vk.xml || die # python |
328 |
+} |
329 |
+ |
330 |
+src_configure() { |
331 |
+ WINE_PREFIX=/usr/lib/${P} |
332 |
+ WINE_DATADIR=/usr/share/${P} |
333 |
+ |
334 |
+ local conf=( |
335 |
+ --prefix="${EPREFIX}"${WINE_PREFIX} |
336 |
+ --datadir="${EPREFIX}"${WINE_DATADIR} |
337 |
+ --includedir="${EPREFIX}"/usr/include/${P} |
338 |
+ --libdir="${EPREFIX}"${WINE_PREFIX} |
339 |
+ --mandir="${EPREFIX}"${WINE_DATADIR}/man |
340 |
+ |
341 |
+ # upstream (Valve) doesn't really support misc configurations (e.g. |
342 |
+ # adds vulkan code not always guarded by --with-vulkan), so force |
343 |
+ # some major options that are typically needed by games either way |
344 |
+ --with-freetype |
345 |
+ --with-mingw # needed by many, notably Blizzard titles |
346 |
+ --with-opengl |
347 |
+ --with-vulkan |
348 |
+ --with-x |
349 |
+ |
350 |
+ # ...and disable most options unimportant for games and unused by |
351 |
+ # Proton rather than expose as volatile USEs with little support |
352 |
+ --disable-tests # does not build and is disabled in Proton's Makefile |
353 |
+ --without-capi |
354 |
+ --without-cups |
355 |
+ --without-gphoto |
356 |
+ --without-gssapi |
357 |
+ --without-krb5 |
358 |
+ --without-ldap |
359 |
+ --without-netapi |
360 |
+ --without-opencl |
361 |
+ --without-pcap |
362 |
+ --without-sane |
363 |
+ ac_cv_lib_soname_odbc= |
364 |
+ |
365 |
+ $(use_enable gecko mshtml) |
366 |
+ $(use_enable mono mscoree) |
367 |
+ $(use_with alsa) |
368 |
+ $(use_with fontconfig) |
369 |
+ $(use_with gstreamer) |
370 |
+ $(use_with nls gettext) |
371 |
+ $(use_with openal) |
372 |
+ $(use_with osmesa) |
373 |
+ --without-oss # media-sound/oss is not packaged |
374 |
+ $(use_with pulseaudio pulse) |
375 |
+ $(use_with sdl) |
376 |
+ $(use_with ssl gnutls) |
377 |
+ $(use_with udev) |
378 |
+ $(use_with udisks dbus) # dbus is only used for udisks |
379 |
+ $(use_with unwind) |
380 |
+ $(use_with usb) |
381 |
+ $(use_with v4l v4l2) |
382 |
+ $(use_with vkd3d) |
383 |
+ $(use_with xcomposite) |
384 |
+ $(use_with xinerama) |
385 |
+ ) |
386 |
+ |
387 |
+ tc-ld-force-bfd #867097 |
388 |
+ use custom-cflags || strip-flags # can break in obscure ways, also no lto |
389 |
+ use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH} |
390 |
+ |
391 |
+ # build using upstream's way (--with-wine64) |
392 |
+ # order matters: configure+compile 64->32, install 32->64 |
393 |
+ local -i bits |
394 |
+ for bits in $(usev abi_x86_64 64) $(usev abi_x86_32 32); do |
395 |
+ ( |
396 |
+ einfo "Configuring ${PN} for ${bits}bits in ${WORKDIR}/build${bits} ..." |
397 |
+ |
398 |
+ mkdir ../build${bits} || die |
399 |
+ cd ../build${bits} || die |
400 |
+ |
401 |
+ # CROSSCC_amd64/x86 are unused by Wine, but recognized here for users |
402 |
+ if (( bits == 64 )); then |
403 |
+ : "${CROSSCC:=${CROSSCC_amd64:-x86_64-w64-mingw32-gcc}}" |
404 |
+ conf+=( --enable-win64 ) |
405 |
+ elif use amd64; then |
406 |
+ conf+=( |
407 |
+ $(usev abi_x86_64 --with-wine64=../build64) |
408 |
+ TARGETFLAGS=-m32 # for widl |
409 |
+ ) |
410 |
+ # _setup is optional, but use over Wine's auto-detect (+bug 472038) |
411 |
+ multilib_toolchain_setup x86 |
412 |
+ fi |
413 |
+ : "${CROSSCC:=${CROSSCC_x86:-i686-w64-mingw32-gcc}}" |
414 |
+ |
415 |
+ # use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu) |
416 |
+ : "${CROSSCFLAGS:=$(CC=${CROSSCC} test-flags-CC ${CFLAGS:--O2})}" |
417 |
+ : "${CROSSLDFLAGS:=$( |
418 |
+ filter-flags '-fuse-ld=*' |
419 |
+ CC=${CROSSCC} test-flags-CCLD ${LDFLAGS})}" |
420 |
+ export CROSS{CC,{C,LD}FLAGS} |
421 |
+ |
422 |
+ ECONF_SOURCE=${S} econf "${conf[@]}" |
423 |
+ ) |
424 |
+ done |
425 |
+} |
426 |
+ |
427 |
+src_compile() { |
428 |
+ use abi_x86_64 && emake -C ../build64 # do first |
429 |
+ use abi_x86_32 && emake -C ../build32 |
430 |
+} |
431 |
+ |
432 |
+src_install() { |
433 |
+ use abi_x86_32 && emake DESTDIR="${D}" -C ../build32 install |
434 |
+ use abi_x86_64 && emake DESTDIR="${D}" -C ../build64 install # do last |
435 |
+ |
436 |
+ # symlink for plain 'wine' and install its man pages if 64bit-only #404331 |
437 |
+ if use abi_x86_64 && use !abi_x86_32; then |
438 |
+ dosym wine64 ${WINE_PREFIX}/bin/wine |
439 |
+ dosym wine64-preloader ${WINE_PREFIX}/bin/wine-preloader |
440 |
+ local man |
441 |
+ for man in ../build64/loader/wine.*man; do |
442 |
+ : "${man##*/wine}" |
443 |
+ : "${_%.*}" |
444 |
+ insinto ${WINE_DATADIR}/man/${_:+${_#.}/}man1 |
445 |
+ newins ${man} wine.1 |
446 |
+ done |
447 |
+ fi |
448 |
+ |
449 |
+ use perl || rm "${ED}"${WINE_DATADIR}/man/man1/wine{dump,maker}.1 \ |
450 |
+ "${ED}"${WINE_PREFIX}/bin/{function_grep.pl,wine{dump,maker}} || die |
451 |
+ |
452 |
+ # create variant wrappers for eselect-wine, quotes are |
453 |
+ # enough to prevent bug #615218 if it somehow happens |
454 |
+ local bin |
455 |
+ for bin in "${ED}"${WINE_PREFIX}/bin/*; do |
456 |
+ make_wrapper "${bin##*/}-${P#wine-}" "${bin#"${ED}"}" |
457 |
+ done |
458 |
+ |
459 |
+ # don't let portage try to strip PE files with the wrong |
460 |
+ # strip executable and instead handle it here (saves ~120MB) |
461 |
+ dostrip -x ${WINE_PREFIX}/wine/{i386,x86_64}-windows |
462 |
+ use debug || |
463 |
+ find "${ED}"${WINE_PREFIX}/wine/*-windows -regex '.*\.\(a\|dll\|exe\)' \ |
464 |
+ -exec $(usex abi_x86_64 x86_64 i686)-w64-mingw32-strip --strip-unneeded {} + || die |
465 |
+ |
466 |
+ dodoc ANNOUNCE AUTHORS README* documentation/README* |
467 |
+ readme.gentoo_create_doc |
468 |
+} |
469 |
+ |
470 |
+wine-eselect() { |
471 |
+ ebegin "${1^}ing ${P} using eselect-wine" |
472 |
+ eselect wine ${1} ${P} && |
473 |
+ eselect wine ${1} --${PN#wine-} ${P} && |
474 |
+ eselect wine update --if-unset && |
475 |
+ eselect wine update --${PN#wine-} --if-unset |
476 |
+ eend ${?} || die -n "eselect failed, may need to manually handle ${P}" |
477 |
+} |
478 |
+ |
479 |
+pkg_preinst() { |
480 |
+ has_version ${CATEGORY}/${PN} && WINE_HAD_ANY_SLOT= |
481 |
+} |
482 |
+ |
483 |
+pkg_postinst() { |
484 |
+ wine-eselect register |
485 |
+ |
486 |
+ [[ -v WINE_HAD_ANY_SLOT ]] || readme.gentoo_print_elog |
487 |
+} |
488 |
+ |
489 |
+pkg_prerm() { |
490 |
+ nonfatal wine-eselect deregister |
491 |
+} |