Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/wine-staging/, app-emulation/wine-staging/files/
Date: Sat, 10 Sep 2022 09:48:34
Message-Id: 1662803235.a93609bbc6d8013ae7f10568a45db6589acc6005.ionen@gentoo
1 commit: a93609bbc6d8013ae7f10568a45db6589acc6005
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 9 17:37:48 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 10 09:47:15 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a93609bb
7
8 app-emulation/wine-staging: add 7.17 using new ebuild
9
10 See wine-vanilla-7.0-r3 commit for main list of changes,
11 mostly same beside handling the patchset.
12
13 For some notable staging-specific differences with original ebuilds:
14 - no IUSE=staging, not planning to do merged ebuild logic currently
15 - no IUSE=pipelight, not seeing a need to have a USE to disable this
16 tiny patchset (seems was formerly treated specially given it was
17 provided as unofficial patches in app-emulation/wine:0)
18 - add IUSE=xattr fwiw, @system packages keep it optional too and
19 disabling can have bit extra meaning for less multilib deps
20 - use an array to pass patchinstall.sh options
21 - add MY_WINE_STAGING_CONF for users to set their own exclusions
22 - for live, now fetching the wine commit that current staging been
23 based on by default (otherwise too volatile, users can still still
24 use EGIT_OVERRIDE_* if wanted)
25
26 Closes: https://bugs.gentoo.org/744829
27 Closes: https://bugs.gentoo.org/746338
28 Closes: https://bugs.gentoo.org/753698
29 Closes: https://bugs.gentoo.org/867097
30 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
31
32 app-emulation/wine-staging/Manifest | 2 +
33 .../files/wine-staging-7.17-llvm-libunwind.patch | 9 +
34 .../files/wine-staging-7.17-noexecstack.patch | 7 +
35 .../wine-staging/wine-staging-7.17.ebuild | 350 +++++++++++++++++++++
36 4 files changed, 368 insertions(+)
37
38 diff --git a/app-emulation/wine-staging/Manifest b/app-emulation/wine-staging/Manifest
39 index 9b30d5a26427..37ab11283809 100644
40 --- a/app-emulation/wine-staging/Manifest
41 +++ b/app-emulation/wine-staging/Manifest
42 @@ -4,8 +4,10 @@ DIST wine-7.13.tar.xz 28237664 BLAKE2B f65f6ab2ec159d0a25b44e6bcbc83db2c5ada6b0c
43 DIST wine-7.14.tar.xz 28274396 BLAKE2B 632c4c77a5b93597b8b217a04e34a4867d9e34497322cbcdf89d3bd2c98ee2ce27983582e1aa6737ec6bf5e080f64bcb4813f3e5c83b67cebd36895251a07e2f SHA512 6727be4a23b1911b36c44ac8d347be1c98bb53e67101355d6ae829d14a3a0867ba83f77a52f4dbc02a35c3b513291dd4800148a31d28f50069d199fdee04b6e9
44 DIST wine-7.15.tar.xz 28324772 BLAKE2B 2ae7f693acfa3477c5b925cb6bfc6e2c3094cf56049aae9a310206dce3ef26d32af74ab414f06020dc0e9cf782b8e3cf6b65739ae10b71e783415498b7339618 SHA512 9edf9f6169c26fd829255d323ebdda4fd606f9cf9dfebae2c0823c32a2ca40741e10acba6938e0d49a99dd15276795506887ab582fed296beb0202f77b2db1b4
45 DIST wine-7.16.tar.xz 28345428 BLAKE2B 6540dd196639c5b3e01af801439e4ca8d3d17ce6b9832c3ab7d0263909e0a963a5901b8baad00537242c32599af92d04ad58c9f51660583e28693b4ec1bdd803 SHA512 5085c7c1b0e762c508f33775f7f0aa41e94cb75805bb649093addad25f90f7f57d5101ba96227f58a6f18b3ae228bd004df11ec1c033692ad130e9b5279ea19e
46 +DIST wine-7.17.tar.xz 28379876 BLAKE2B 536af8f1ac9c4dd8bae2d16cba226c99c45cd64f0a9a2569022baefee61556801d3ee15f480fd18445baecb6c78dd7950f98542dc88a3282ee5d457d0e4ddfb1 SHA512 fd8017e6174db0047a3957db3045b2ad9024e07b1e2f81800521f0b7e7f7660add6a08e09bc60e3d140816cec70aae8324fe15643bd05e541f22f66ffda52508
47 DIST wine-staging-7.12.tar.gz 9644343 BLAKE2B 760b34abf245b8d2e5baed13db57a841bba73f9dd6652f958428fec3617000cdc00d6f3ac305f4b580cf462938a56ef9a6f0c6931306c25ce82b7fe4da314d9f SHA512 0cf7554011835052b75a836fca89c6cf9b5fa1653c96a82b0dcd3cf40147602eebaf81aa6b94348432371bef9550c8dc21c9cf7d78b49a422bd113e8a6a8e3b0
48 DIST wine-staging-7.13.tar.gz 9644182 BLAKE2B 1fecdd231e93de44d4327cceef0f72759de331b507ea16cd39749be3195716883a5327804f6379ca563e635fbf317d131d6cf87e4b49f177a45116ee3be55527 SHA512 f0fbd0d96272e457006d0eac350905e2fd27b472943d08771b4cd1cde88afefeb239e46f88979bcb7d45d525610f5d69c74bf8294b101e064ca2051494ab3127
49 DIST wine-staging-7.14.tar.gz 9644603 BLAKE2B d923321c1562e71c7826e73aec52bd0fb451bb8ff302841f7756428c23b80ea00f815d1a6cc5e3354a83ce87137b2af7ac3389c2c018344cf80afdae50f151b1 SHA512 40ffa7a64780a054bdace9fd5f294a45f7648f6db933ba0a74450b5412df5cc989b7aa442dcba1f185f8d0e5a7740a9508203f1ee323f26fd77867caa9d4fcb3
50 DIST wine-staging-7.15.tar.gz 9644942 BLAKE2B 1d04730b540785d03cec919ee643cd182c09c3ad022a6b9f5111348ea82a7c3e34e2108141e544855423224db15a5d954623840b3a0d3e3709d0cd23ad1e3236 SHA512 57b6145b3a39a8fb5e98648072e3c1f4f1528fdcfe1f8612f41dc7e0ea4fcc09e4e78d3bbe8fa7a5c14ff0708328306cf0eb8367016f6b2fda9e34f0f1be0621
51 DIST wine-staging-7.16.tar.gz 9640421 BLAKE2B 551a282c40de44a03afd7d6ef7edefac29e6ece53bd9eff854076edab400ed58c37f2d89737354c7a9d3ac9af7c576bc0ec68c61159842e9b46ac4d95c0d07ae SHA512 57003888580f3c442b9d9bc1b36c3e967bfe5b5d61b7fcd8d832a463cbea793c4bf6afce35da18ea9cee568237a0a919583e1dc6b3fea7bc09a7a13e9d9260ce
52 +DIST wine-staging-7.17.tar.gz 9558133 BLAKE2B ef56bae5168da021688766e1cfbc8bd510a18b0de670b0baab631389665d52230e4f9ecda2edff1f50cbd444098d33236fd0f685183e9074efc6d048665c6931 SHA512 2e9c260b56293d86a54833d128d98b2408f61a5601f0ef58db6ff02a9c5cb091d3e9acf7f6a616d7d065d9c02127936da6bdc30e6ee11b116d24aab579f512fb
53
54 diff --git a/app-emulation/wine-staging/files/wine-staging-7.17-llvm-libunwind.patch b/app-emulation/wine-staging/files/wine-staging-7.17-llvm-libunwind.patch
55 new file mode 100644
56 index 000000000000..a7f8772ab5c4
57 --- /dev/null
58 +++ b/app-emulation/wine-staging/files/wine-staging-7.17-llvm-libunwind.patch
59 @@ -0,0 +1,9 @@
60 +Note the dodgy _CONFIG_H_ check can be removed when >=llvm-libunwind-15
61 +(which adds _VERSION) is well established: https://reviews.llvm.org/D121015
62 +--- a/dlls/ntdll/unix/signal_x86_64.c
63 ++++ b/dlls/ntdll/unix/signal_x86_64.c
64 +@@ -1458,3 +1458,3 @@
65 +
66 +-#ifdef __APPLE__
67 ++#if defined(__APPLE__) || defined(_LIBUNWIND_VERSION) || defined(____LIBUNWIND_CONFIG_H__)
68 + rc = unw_getcontext( &unw_context );
69
70 diff --git a/app-emulation/wine-staging/files/wine-staging-7.17-noexecstack.patch b/app-emulation/wine-staging/files/wine-staging-7.17-noexecstack.patch
71 new file mode 100644
72 index 000000000000..4baa48cfc140
73 --- /dev/null
74 +++ b/app-emulation/wine-staging/files/wine-staging-7.17-noexecstack.patch
75 @@ -0,0 +1,7 @@
76 +Also write GNU-stack note on dummy files used for stub libraries.
77 +--- a/tools/winebuild/import.c
78 ++++ b/tools/winebuild/import.c
79 +@@ -1676,2 +1676,3 @@
80 + output( "\t.text\n" );
81 ++ output_gnu_stack_note();
82 + }
83
84 diff --git a/app-emulation/wine-staging/wine-staging-7.17.ebuild b/app-emulation/wine-staging/wine-staging-7.17.ebuild
85 new file mode 100644
86 index 000000000000..8b3f0ce65d88
87 --- /dev/null
88 +++ b/app-emulation/wine-staging/wine-staging-7.17.ebuild
89 @@ -0,0 +1,350 @@
90 +# Copyright 2022 Gentoo Authors
91 +# Distributed under the terms of the GNU General Public License v2
92 +
93 +EAPI=8
94 +
95 +MULTILIB_COMPAT=( abi_x86_{32,64} )
96 +inherit autotools flag-o-matic multilib multilib-build toolchain-funcs wrapper
97 +
98 +WINE_GECKO=2.47.3
99 +WINE_MONO=7.3.0
100 +
101 +if [[ ${PV} == *9999 ]]; then
102 + inherit git-r3
103 + EGIT_REPO_URI="https://github.com/wine-staging/wine-staging.git"
104 + WINE_EGIT_REPO_URI="https://gitlab.winehq.org/wine/wine.git"
105 +else
106 + (( $(ver_cut 2) )) && WINE_SDIR=$(ver_cut 1).x || WINE_SDIR=$(ver_cut 1).0
107 + SRC_URI="
108 + https://dl.winehq.org/wine/source/${WINE_SDIR}/wine-${PV}.tar.xz
109 + https://github.com/wine-staging/wine-staging/archive/v${PV}.tar.gz -> ${P}.tar.gz"
110 + KEYWORDS="-* ~amd64 ~x86"
111 +fi
112 +S="${WORKDIR}/wine-${PV}"
113 +
114 +DESCRIPTION="Free implementation of Windows(tm) on Unix, with Wine-Staging patchset"
115 +HOMEPAGE="https://www.winehq.org/"
116 +
117 +LICENSE="LGPL-2.1+ BSD-2 IJG MIT ZLIB gsm libpng2 libtiff"
118 +SLOT="${PV}"
119 +IUSE="
120 + +X +abi_x86_32 +abi_x86_64 +alsa capi crossdev-mingw cups dos
121 + llvm-libunwind debug custom-cflags +fontconfig +gecko gphoto2
122 + +gstreamer kerberos ldap +mingw +mono netapi nls odbc openal
123 + opencl +opengl osmesa pcap perl pulseaudio samba scanner +sdl
124 + selinux +ssl +truetype udev udisks +unwind usb v4l +vulkan xattr
125 + +xcomposite xinerama"
126 +REQUIRED_USE="
127 + X? ( truetype )
128 + crossdev-mingw? ( mingw )" # bug #551124 for truetype
129 +
130 +# tests are non-trivial to run, can hang easily, don't play well with
131 +# sandbox, and several need real opengl/vulkan or network access
132 +RESTRICT="test"
133 +
134 +# `grep WINE_CHECK_SONAME configure.ac` + if not directly linked
135 +WINE_DLOPEN_DEPEND="
136 + X? (
137 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
138 + x11-libs/libXfixes[${MULTILIB_USEDEP}]
139 + x11-libs/libXi[${MULTILIB_USEDEP}]
140 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
141 + x11-libs/libXrender[${MULTILIB_USEDEP}]
142 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
143 + opengl? (
144 + media-libs/libglvnd[X,${MULTILIB_USEDEP}]
145 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
146 + )
147 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
148 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
149 + )
150 + cups? ( net-print/cups[${MULTILIB_USEDEP}] )
151 + fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
152 + kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
153 + netapi? ( net-fs/samba[${MULTILIB_USEDEP}] )
154 + odbc? ( dev-db/unixODBC[${MULTILIB_USEDEP}] )
155 + sdl? ( media-libs/libsdl2[haptic,joystick,${MULTILIB_USEDEP}] )
156 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
157 + truetype? ( media-libs/freetype[${MULTILIB_USEDEP}] )
158 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
159 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
160 + vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )"
161 +WINE_COMMON_DEPEND="
162 + ${WINE_DLOPEN_DEPEND}
163 + X? (
164 + x11-libs/libX11[${MULTILIB_USEDEP}]
165 + x11-libs/libXext[${MULTILIB_USEDEP}]
166 + )
167 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
168 + capi? ( net-libs/libcapi:=[${MULTILIB_USEDEP}] )
169 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
170 + gstreamer? (
171 + dev-libs/glib:2[${MULTILIB_USEDEP}]
172 + media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
173 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
174 + )
175 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
176 + openal? ( media-libs/openal[${MULTILIB_USEDEP}] )
177 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
178 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
179 + pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
180 + scanner? ( media-gfx/sane-backends[${MULTILIB_USEDEP}] )
181 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
182 + unwind? (
183 + llvm-libunwind? ( sys-libs/llvm-libunwind[${MULTILIB_USEDEP}] )
184 + !llvm-libunwind? ( sys-libs/libunwind:=[${MULTILIB_USEDEP}] )
185 + )
186 + usb? ( dev-libs/libusb:1[${MULTILIB_USEDEP}] )
187 + xattr? ( sys-apps/attr[${MULTILIB_USEDEP}] )"
188 +RDEPEND="
189 + ${WINE_COMMON_DEPEND}
190 + app-emulation/wine-desktop-common
191 + dos? ( games-emulation/dosbox )
192 + gecko? ( app-emulation/wine-gecko:${WINE_GECKO}[${MULTILIB_USEDEP}] )
193 + gstreamer? ( media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}] )
194 + mono? ( app-emulation/wine-mono:${WINE_MONO} )
195 + perl? (
196 + dev-lang/perl
197 + dev-perl/XML-LibXML
198 + )
199 + samba? ( net-fs/samba[winbind] )
200 + selinux? ( sec-policy/selinux-wine )
201 + udisks? ( sys-fs/udisks:2 )"
202 +DEPEND="
203 + ${WINE_COMMON_DEPEND}
204 + sys-kernel/linux-headers
205 + X? ( x11-base/xorg-proto )"
206 +BDEPEND="
207 + dev-lang/perl
208 + sys-devel/bison
209 + sys-devel/flex
210 + virtual/pkgconfig
211 + mingw? ( !crossdev-mingw? ( dev-util/mingw64-toolchain[${MULTILIB_USEDEP}] ) )
212 + nls? ( sys-devel/gettext )"
213 +IDEPEND="app-eselect/eselect-wine"
214 +
215 +QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext
216 +
217 +PATCHES=(
218 + "${FILESDIR}"/${PN}-7.17-llvm-libunwind.patch
219 + "${FILESDIR}"/${PN}-7.17-noexecstack.patch
220 +)
221 +
222 +pkg_pretend() {
223 + [[ ${MERGE_TYPE} == binary ]] && return
224 +
225 + if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then
226 + local mingw=-w64-mingw32
227 + for mingw in $(usev abi_x86_64 x86_64${mingw}) $(usev abi_x86_32 i686${mingw}); do
228 + if ! type -P ${mingw}-gcc >/dev/null; then
229 + eerror "With USE=crossdev-mingw, you must prepare the MinGW toolchain"
230 + eerror "yourself by installing sys-devel/crossdev then running:"
231 + eerror
232 + eerror " crossdev --target ${mingw}"
233 + eerror
234 + eerror "For more information, please see: https://wiki.gentoo.org/wiki/Mingw"
235 + die "USE=crossdev-mingw is enabled, but ${mingw}-gcc was not found"
236 + fi
237 + done
238 + fi
239 +}
240 +
241 +src_unpack() {
242 + if [[ ${PV} == *9999 ]]; then
243 + EGIT_CHECKOUT_DIR=${WORKDIR}/${P}
244 + git-r3_src_unpack
245 +
246 + EGIT_COMMIT=$(<"${EGIT_CHECKOUT_DIR}"/staging/upstream-commit) || die
247 + EGIT_REPO_URI=${WINE_EGIT_REPO_URI}
248 + EGIT_CHECKOUT_DIR=${S}
249 + einfo "Fetching Wine commit matching the current patchset by default (${EGIT_COMMIT})"
250 + git-r3_src_unpack
251 + else
252 + default
253 + fi
254 +}
255 +
256 +src_prepare() {
257 + local staging=(
258 + ./patchinstall.sh DESTDIR="${S}"
259 + --all
260 + --backend=eapply
261 + --no-autoconf
262 + -W winemenubuilder-Desktop_Icon_Path #652176
263 + ${MY_WINE_STAGING_CONF}
264 + )
265 +
266 + # source patcher in a subshell so can use eapply as a backend
267 + ebegin "Running ${staging[*]}"
268 + ( cd ../${P}/patches && . "${staging[@]}" )
269 + eend ${?} || die "Failed to apply the patchset"
270 +
271 + # sanity check, bumping these has a history of oversights
272 + local geckomono=$(sed -En '/^#define (GECKO|MONO)_VER/{s/[^0-9.]//gp}' \
273 + dlls/appwiz.cpl/addons.c || die)
274 + if [[ ${WINE_GECKO}$'\n'${WINE_MONO} != "${geckomono}" ]]; then
275 + local gmfatal=
276 + [[ ${PV} == *9999 ]] && gmfatal=nonfatal
277 + ${gmfatal} die -n "gecko/mono mismatch in ebuild, has: " ${geckomono} " (please file a bug)"
278 + fi
279 +
280 + default
281 +
282 + # ensure .desktop calls this variant + slot
283 + sed -i "/^Exec=/s/wine /${P} /" loader/wine.desktop || die
284 +
285 + # always update for patches (including user's wrt #432348)
286 + eautoreconf
287 + tools/make_requests || die # perl
288 +}
289 +
290 +src_configure() {
291 + WINE_PREFIX=/usr/lib/${P}
292 + WINE_DATADIR=/usr/share/${P}
293 +
294 + local conf=(
295 + --prefix="${EPREFIX}"${WINE_PREFIX}
296 + --datadir="${EPREFIX}"${WINE_DATADIR}
297 + --includedir="${EPREFIX}"/usr/include/${P}
298 + --libdir="${EPREFIX}"${WINE_PREFIX}
299 + --mandir="${EPREFIX}"${WINE_DATADIR}/man
300 + $(use_enable gecko mshtml)
301 + $(use_enable mono mscoree)
302 + --disable-tests
303 + $(use_with X x)
304 + $(use_with alsa)
305 + $(use_with capi)
306 + $(use_with cups)
307 + $(use_with fontconfig)
308 + $(use_with gphoto2 gphoto)
309 + $(use_with gstreamer)
310 + $(use_with kerberos gssapi)
311 + $(use_with kerberos krb5)
312 + $(use_with ldap)
313 + $(use_with mingw)
314 + $(use_with netapi)
315 + $(use_with nls gettext)
316 + $(use_with openal)
317 + $(use_with opencl)
318 + $(use_with opengl)
319 + $(use_with osmesa)
320 + --without-oss # media-sound/oss is not packaged (OSSv4)
321 + $(use_with pcap)
322 + $(use_with pulseaudio pulse)
323 + $(use_with scanner sane)
324 + $(use_with sdl)
325 + $(use_with ssl gnutls)
326 + $(use_with truetype freetype)
327 + $(use_with udev)
328 + $(use_with udisks dbus) # dbus is only used for udisks
329 + $(use_with unwind)
330 + $(use_with usb)
331 + $(use_with v4l v4l2)
332 + $(use_with vulkan)
333 + $(use_with xattr)
334 + $(use_with xcomposite)
335 + $(use_with xinerama)
336 + $(usev !odbc ac_cv_lib_soname_odbc=)
337 + )
338 +
339 + tc-ld-force-bfd #867097
340 + use custom-cflags || strip-flags # can break in obscure ways, also no lto
341 + use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
342 +
343 + # build using upstream's way (--with-wine64)
344 + # order matters: configure+compile 64->32, install 32->64
345 + local -i bits
346 + for bits in $(usev abi_x86_64 64) $(usev abi_x86_32 32); do
347 + (
348 + einfo "Configuring ${PN} for ${bits}bits in ${WORKDIR}/build${bits} ..."
349 +
350 + mkdir ../build${bits} || die
351 + cd ../build${bits} || die
352 +
353 + # CROSSCC_amd64/x86 are unused by Wine, but recognized here for users
354 + if (( bits == 64 )); then
355 + : "${CROSSCC:=${CROSSCC_amd64:-x86_64-w64-mingw32-gcc}}"
356 + conf+=( --enable-win64 )
357 + elif use amd64; then
358 + conf+=(
359 + $(usev abi_x86_64 --with-wine64=../build64)
360 + TARGETFLAGS=-m32 # for widl
361 + )
362 + # _setup is optional, but use over Wine's auto-detect (+#472038)
363 + multilib_toolchain_setup x86
364 + fi
365 + : "${CROSSCC:=${CROSSCC_x86:-i686-w64-mingw32-gcc}}"
366 +
367 + # use *FLAGS for mingw, but strip unsupported (e.g. --hash-style=gnu)
368 + if use mingw; then
369 + : "${CROSSCFLAGS:=$(CC=${CROSSCC} test-flags-CC ${CFLAGS:--O2})}"
370 + : "${CROSSLDFLAGS:=$(
371 + filter-flags '-fuse-ld=*'
372 + CC=${CROSSCC} test-flags-CCLD ${LDFLAGS})}"
373 + export CROSS{CC,{C,LD}FLAGS}
374 + fi
375 +
376 + ECONF_SOURCE=${S} econf "${conf[@]}"
377 + )
378 + done
379 +}
380 +
381 +src_compile() {
382 + use abi_x86_64 && emake -C ../build64 # do first
383 + use abi_x86_32 && emake -C ../build32
384 +}
385 +
386 +src_install() {
387 + use abi_x86_32 && emake DESTDIR="${D}" -C ../build32 install
388 + use abi_x86_64 && emake DESTDIR="${D}" -C ../build64 install # do last
389 +
390 + # symlink for plain 'wine' and install its man pages if 64bit-only #404331
391 + if use abi_x86_64 && use !abi_x86_32; then
392 + dosym wine64 ${WINE_PREFIX}/bin/wine
393 + dosym wine64-preloader ${WINE_PREFIX}/bin/wine-preloader
394 + local man
395 + for man in ../build64/loader/wine.*man; do
396 + : "${man##*/wine}"
397 + : "${_%.*}"
398 + insinto ${WINE_DATADIR}/man/${_:+${_#.}/}man1
399 + newins ${man} wine.1
400 + done
401 + fi
402 +
403 + use perl || rm "${ED}"${WINE_DATADIR}/man/man1/wine{dump,maker}.1 \
404 + "${ED}"${WINE_PREFIX}/bin/{function_grep.pl,wine{dump,maker}} || die
405 +
406 + # create variant wrappers for eselect-wine
407 + local bin
408 + for bin in "${ED}"${WINE_PREFIX}/bin/*; do
409 + make_wrapper "${bin##*/}-${P#wine-}" "${bin#"${ED}"}"
410 + done
411 +
412 + # don't let portage try to strip PE files with the wrong
413 + # strip executable and instead handle it here (saves ~120MB)
414 + if use mingw; then
415 + dostrip -x ${WINE_PREFIX}/wine/{i386,x86_64}-windows
416 + use debug ||
417 + find "${ED}"${WINE_PREFIX}/wine/*-windows -regex '.*\.\(a\|dll\|exe\)' \
418 + -exec $(usex abi_x86_64 x86_64 i686)-w64-mingw32-strip --strip-unneeded {} + || die
419 + fi
420 +
421 + dodoc ANNOUNCE AUTHORS README* documentation/README*
422 +}
423 +
424 +wine-eselect() {
425 + ebegin "${1^}ing ${P} using eselect-wine"
426 + eselect wine ${1} ${P} &&
427 + eselect wine ${1} --${PN#wine-} ${P} &&
428 + eselect wine update --if-unset &&
429 + eselect wine update --${PN#wine-} --if-unset
430 + eend ${?} || die -n "eselect failed, may need to manually handle ${P}"
431 +}
432 +
433 +pkg_postinst() {
434 + wine-eselect register
435 +}
436 +
437 +pkg_prerm() {
438 + nonfatal wine-eselect deregister
439 +}