3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
MULTILIB_COMPAT=( abi_x86_{32,64} )
|
7 |
6 |
PYTHON_COMPAT=( python3_{11..14} )
|
8 |
|
inherit autotools edo flag-o-matic multilib multilib-build optfeature
|
9 |
|
inherit prefix python-any-r1 toolchain-funcs wrapper
|
|
7 |
inherit edo optfeature python-any-r1 wine
|
10 |
8 |
|
11 |
9 |
WINE_GECKO=2.47.4
|
12 |
|
WINE_MONO=9.4.0
|
|
10 |
WINE_MONO=10.1.0
|
13 |
11 |
WINE_P=wine-$(ver_cut 1-2)
|
14 |
12 |
|
15 |
|
if [[ ${PV} == *9999 ]]; then
|
|
13 |
if [[ ${PV} == 9999 ]]; then
|
16 |
14 |
inherit git-r3
|
17 |
15 |
EGIT_REPO_URI="https://gitlab.winehq.org/wine/wine-staging.git"
|
18 |
16 |
WINE_EGIT_REPO_URI="https://gitlab.winehq.org/wine/wine.git"
|
... | ... | |
20 |
18 |
(( $(ver_cut 2) )) && WINE_SDIR=$(ver_cut 1).x || WINE_SDIR=$(ver_cut 1).0
|
21 |
19 |
SRC_URI="
|
22 |
20 |
https://dl.winehq.org/wine/source/${WINE_SDIR}/${WINE_P}.tar.xz
|
23 |
|
https://github.com/wine-staging/wine-staging/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
24 |
|
KEYWORDS="-* ~amd64 ~x86"
|
|
21 |
https://github.com/wine-staging/wine-staging/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
|
22 |
"
|
|
23 |
KEYWORDS="-* ~amd64 ~arm64 ~x86"
|
25 |
24 |
fi
|
26 |
25 |
|
27 |
26 |
DESCRIPTION="Free implementation of Windows(tm) on Unix, with Wine-Staging patchset"
|
... | ... | |
29 |
28 |
https://wiki.winehq.org/Wine-Staging
|
30 |
29 |
https://gitlab.winehq.org/wine/wine-staging/
|
31 |
30 |
"
|
|
31 |
S=${WORKDIR}/${WINE_P}
|
32 |
32 |
|
33 |
|
S="${WORKDIR}/${WINE_P}"
|
34 |
|
|
35 |
|
LICENSE="LGPL-2.1+ BSD BSD-2 IJG MIT OPENLDAP ZLIB gsm libpng2 libtiff"
|
|
33 |
LICENSE="
|
|
34 |
LGPL-2.1+
|
|
35 |
BSD BSD-2 IJG MIT OPENLDAP ZLIB gsm libpng2 libtiff
|
|
36 |
|| ( WTFPL-2 public-domain )
|
|
37 |
"
|
36 |
38 |
SLOT="${PV}"
|
37 |
39 |
IUSE="
|
38 |
|
+X +abi_x86_32 +abi_x86_64 +alsa capi crossdev-mingw cups +dbus dos
|
39 |
|
llvm-libunwind custom-cflags ffmpeg +fontconfig +gecko gphoto2
|
40 |
|
+gstreamer kerberos +mingw +mono netapi nls odbc opencl +opengl
|
41 |
|
pcap perl pulseaudio samba scanner +sdl selinux smartcard +ssl
|
42 |
|
+strip +truetype udev +unwind usb v4l +vulkan wayland wow64
|
43 |
|
+xcomposite xinerama
|
|
40 |
+X +alsa bluetooth capi cups +dbus dos llvm-libunwind ffmpeg
|
|
41 |
+fontconfig +gecko gphoto2 +gstreamer kerberos +mono netapi
|
|
42 |
nls odbc opencl +opengl pcap perl pulseaudio samba scanner
|
|
43 |
+sdl selinux smartcard +ssl +truetype udev +unwind usb v4l
|
|
44 |
+vulkan wayland +xcomposite xinerama
|
44 |
45 |
"
|
45 |
|
# bug #551124 for truetype
|
46 |
|
# TODO: wow64 can be done without mingw if using clang (needs bug #912237)
|
47 |
46 |
REQUIRED_USE="
|
48 |
47 |
X? ( truetype )
|
49 |
|
crossdev-mingw? ( mingw )
|
|
48 |
bluetooth? ( dbus )
|
50 |
49 |
opengl? ( || ( X wayland ) )
|
51 |
|
wow64? ( abi_x86_64 !abi_x86_32 mingw )
|
52 |
50 |
"
|
53 |
51 |
|
54 |
52 |
# tests are non-trivial to run, can hang easily, don't play well with
|
... | ... | |
58 |
56 |
# `grep WINE_CHECK_SONAME configure.ac` + if not directly linked
|
59 |
57 |
WINE_DLOPEN_DEPEND="
|
60 |
58 |
X? (
|
61 |
|
x11-libs/libXcursor[${MULTILIB_USEDEP}]
|
62 |
|
x11-libs/libXfixes[${MULTILIB_USEDEP}]
|
63 |
|
x11-libs/libXi[${MULTILIB_USEDEP}]
|
64 |
|
x11-libs/libXrandr[${MULTILIB_USEDEP}]
|
65 |
|
x11-libs/libXrender[${MULTILIB_USEDEP}]
|
66 |
|
x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
|
67 |
|
xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
|
68 |
|
xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
|
69 |
|
)
|
70 |
|
cups? ( net-print/cups[${MULTILIB_USEDEP}] )
|
71 |
|
dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
|
72 |
|
fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
|
73 |
|
kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
|
74 |
|
netapi? ( net-fs/samba[${MULTILIB_USEDEP}] )
|
75 |
|
odbc? ( dev-db/unixODBC[${MULTILIB_USEDEP}] )
|
76 |
|
opengl? ( media-libs/libglvnd[X?,${MULTILIB_USEDEP}] )
|
77 |
|
sdl? ( media-libs/libsdl2[haptic,joystick,${MULTILIB_USEDEP}] )
|
78 |
|
ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
|
79 |
|
truetype? ( media-libs/freetype[${MULTILIB_USEDEP}] )
|
80 |
|
v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
|
81 |
|
vulkan? ( media-libs/vulkan-loader[X?,wayland?,${MULTILIB_USEDEP}] )
|
|
59 |
x11-libs/libXcursor[${WINE_USEDEP}]
|
|
60 |
x11-libs/libXfixes[${WINE_USEDEP}]
|
|
61 |
x11-libs/libXi[${WINE_USEDEP}]
|
|
62 |
x11-libs/libXrandr[${WINE_USEDEP}]
|
|
63 |
x11-libs/libXrender[${WINE_USEDEP}]
|
|
64 |
x11-libs/libXxf86vm[${WINE_USEDEP}]
|
|
65 |
xcomposite? ( x11-libs/libXcomposite[${WINE_USEDEP}] )
|
|
66 |
xinerama? ( x11-libs/libXinerama[${WINE_USEDEP}] )
|
|
67 |
)
|
|
68 |
cups? ( net-print/cups[${WINE_USEDEP}] )
|
|
69 |
dbus? ( sys-apps/dbus[${WINE_USEDEP}] )
|
|
70 |
fontconfig? ( media-libs/fontconfig[${WINE_USEDEP}] )
|
|
71 |
kerberos? ( virtual/krb5[${WINE_USEDEP}] )
|
|
72 |
netapi? ( net-fs/samba[${WINE_USEDEP}] )
|
|
73 |
odbc? ( dev-db/unixODBC[${WINE_USEDEP}] )
|
|
74 |
opengl? ( media-libs/libglvnd[X?,${WINE_USEDEP}] )
|
|
75 |
sdl? ( media-libs/libsdl2[haptic,joystick,${WINE_USEDEP}] )
|
|
76 |
ssl? ( net-libs/gnutls:=[${WINE_USEDEP}] )
|
|
77 |
truetype? ( media-libs/freetype[${WINE_USEDEP}] )
|
|
78 |
v4l? ( media-libs/libv4l[${WINE_USEDEP}] )
|
|
79 |
vulkan? ( media-libs/vulkan-loader[X?,wayland?,${WINE_USEDEP}] )
|
82 |
80 |
"
|
83 |
81 |
WINE_COMMON_DEPEND="
|
84 |
82 |
${WINE_DLOPEN_DEPEND}
|
85 |
83 |
X? (
|
86 |
|
x11-libs/libX11[${MULTILIB_USEDEP}]
|
87 |
|
x11-libs/libXext[${MULTILIB_USEDEP}]
|
|
84 |
x11-libs/libX11[${WINE_USEDEP}]
|
|
85 |
x11-libs/libXext[${WINE_USEDEP}]
|
88 |
86 |
)
|
89 |
|
alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
|
90 |
|
capi? ( net-libs/libcapi:=[${MULTILIB_USEDEP}] )
|
91 |
|
ffmpeg? ( media-video/ffmpeg:=[${MULTILIB_USEDEP}] )
|
92 |
|
gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
|
|
87 |
alsa? ( media-libs/alsa-lib[${WINE_USEDEP}] )
|
|
88 |
capi? ( net-libs/libcapi:=[${WINE_USEDEP}] )
|
|
89 |
ffmpeg? ( media-video/ffmpeg:=[${WINE_USEDEP}] )
|
|
90 |
gphoto2? ( media-libs/libgphoto2:=[${WINE_USEDEP}] )
|
93 |
91 |
gstreamer? (
|
94 |
|
dev-libs/glib:2[${MULTILIB_USEDEP}]
|
95 |
|
media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
|
96 |
|
media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
|
97 |
|
)
|
98 |
|
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
|
99 |
|
pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
|
100 |
|
pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
|
101 |
|
scanner? ( media-gfx/sane-backends[${MULTILIB_USEDEP}] )
|
102 |
|
smartcard? ( sys-apps/pcsc-lite[${MULTILIB_USEDEP}] )
|
103 |
|
udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
|
|
92 |
dev-libs/glib:2[${WINE_USEDEP}]
|
|
93 |
media-libs/gst-plugins-base:1.0[${WINE_USEDEP}]
|
|
94 |
media-libs/gstreamer:1.0[${WINE_USEDEP}]
|
|
95 |
)
|
|
96 |
opencl? ( virtual/opencl[${WINE_USEDEP}] )
|
|
97 |
pcap? ( net-libs/libpcap[${WINE_USEDEP}] )
|
|
98 |
pulseaudio? ( media-libs/libpulse[${WINE_USEDEP}] )
|
|
99 |
scanner? ( media-gfx/sane-backends[${WINE_USEDEP}] )
|
|
100 |
smartcard? ( sys-apps/pcsc-lite[${WINE_USEDEP}] )
|
|
101 |
udev? ( virtual/libudev:=[${WINE_USEDEP}] )
|
104 |
102 |
unwind? (
|
105 |
|
llvm-libunwind? ( llvm-runtimes/libunwind[${MULTILIB_USEDEP}] )
|
106 |
|
!llvm-libunwind? ( sys-libs/libunwind:=[${MULTILIB_USEDEP}] )
|
|
103 |
llvm-libunwind? ( llvm-runtimes/libunwind[${WINE_USEDEP}] )
|
|
104 |
!llvm-libunwind? ( sys-libs/libunwind:=[${WINE_USEDEP}] )
|
107 |
105 |
)
|
108 |
|
usb? ( dev-libs/libusb:1[${MULTILIB_USEDEP}] )
|
|
106 |
usb? ( dev-libs/libusb:1[${WINE_USEDEP}] )
|
109 |
107 |
wayland? (
|
110 |
|
dev-libs/wayland[${MULTILIB_USEDEP}]
|
111 |
|
x11-libs/libxkbcommon[${MULTILIB_USEDEP}]
|
|
108 |
dev-libs/wayland[${WINE_USEDEP}]
|
|
109 |
x11-libs/libxkbcommon[${WINE_USEDEP}]
|
112 |
110 |
)
|
113 |
111 |
"
|
114 |
112 |
RDEPEND="
|
... | ... | |
121 |
119 |
)
|
122 |
120 |
)
|
123 |
121 |
gecko? (
|
124 |
|
app-emulation/wine-gecko:${WINE_GECKO}[${MULTILIB_USEDEP}]
|
|
122 |
app-emulation/wine-gecko:${WINE_GECKO}[${WINE_USEDEP}]
|
125 |
123 |
wow64? ( app-emulation/wine-gecko[abi_x86_32] )
|
126 |
124 |
)
|
127 |
|
gstreamer? ( media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}] )
|
|
125 |
gstreamer? ( media-plugins/gst-plugins-meta:1.0[${WINE_USEDEP}] )
|
128 |
126 |
mono? ( app-emulation/wine-mono:${WINE_MONO} )
|
129 |
127 |
perl? (
|
130 |
128 |
dev-lang/perl
|
... | ... | |
137 |
135 |
${WINE_COMMON_DEPEND}
|
138 |
136 |
sys-kernel/linux-headers
|
139 |
137 |
X? ( x11-base/xorg-proto )
|
|
138 |
bluetooth? ( net-wireless/bluez )
|
140 |
139 |
"
|
141 |
|
# gitapply.sh "can" work without git but that is hardly tested
|
142 |
|
# and known failing with some versions, so force real git
|
143 |
140 |
BDEPEND="
|
144 |
141 |
${PYTHON_DEPS}
|
145 |
|
|| (
|
146 |
|
sys-devel/binutils
|
147 |
|
llvm-core/lld
|
148 |
|
)
|
149 |
|
dev-lang/perl
|
150 |
142 |
dev-vcs/git
|
151 |
143 |
sys-devel/bison
|
152 |
144 |
sys-devel/flex
|
153 |
145 |
virtual/pkgconfig
|
154 |
|
mingw? ( !crossdev-mingw? (
|
155 |
|
>=dev-util/mingw64-toolchain-10.0.0_p1-r2[${MULTILIB_USEDEP}]
|
156 |
|
wow64? ( dev-util/mingw64-toolchain[abi_x86_32] )
|
157 |
|
) )
|
158 |
146 |
nls? ( sys-devel/gettext )
|
159 |
147 |
wayland? ( dev-util/wayland-scanner )
|
160 |
148 |
"
|
161 |
|
IDEPEND=">=app-eselect/eselect-wine-2"
|
162 |
149 |
|
163 |
150 |
QA_CONFIG_IMPL_DECL_SKIP=(
|
164 |
151 |
__clear_cache # unused on amd64+x86 (bug #900334)
|
... | ... | |
170 |
157 |
"${FILESDIR}"/${PN}-7.17-noexecstack.patch
|
171 |
158 |
"${FILESDIR}"/${PN}-7.20-unwind.patch
|
172 |
159 |
"${FILESDIR}"/${PN}-8.13-rpath.patch
|
173 |
|
"${FILESDIR}"/${PN}-10.0-binutils2.44.patch
|
174 |
160 |
)
|
175 |
161 |
|
176 |
|
pkg_pretend() {
|
177 |
|
[[ ${MERGE_TYPE} == binary ]] && return
|
178 |
|
|
179 |
|
if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then
|
180 |
|
local mingw=-w64-mingw32
|
181 |
|
for mingw in $(usev abi_x86_64 x86_64${mingw}) \
|
182 |
|
$(use abi_x86_32 || use wow64 && echo i686${mingw}); do
|
183 |
|
if ! type -P ${mingw}-gcc >/dev/null; then
|
184 |
|
eerror "With USE=crossdev-mingw, you must prepare the MinGW toolchain"
|
185 |
|
eerror "yourself by installing sys-devel/crossdev then running:"
|
186 |
|
eerror
|
187 |
|
eerror " crossdev --target ${mingw}"
|
188 |
|
eerror
|
189 |
|
eerror "For more information, please see: https://wiki.gentoo.org/wiki/Mingw"
|
190 |
|
die "USE=crossdev-mingw is enabled, but ${mingw}-gcc was not found"
|
191 |
|
fi
|
192 |
|
done
|
193 |
|
fi
|
194 |
|
}
|
195 |
|
|
196 |
162 |
src_unpack() {
|
197 |
|
if [[ ${PV} == *9999 ]]; then
|
|
163 |
if [[ ${PV} == 9999 ]]; then
|
198 |
164 |
EGIT_CHECKOUT_DIR=${WORKDIR}/${P}
|
199 |
165 |
git-r3_src_unpack
|
200 |
166 |
|
... | ... | |
221 |
187 |
|
222 |
188 |
edo "${PYTHON}" ../${P}/staging/patchinstall.py "${patchinstallargs[@]}"
|
223 |
189 |
|
224 |
|
# sanity check, bumping these has a history of oversights
|
225 |
|
local geckomono=$(sed -En '/^#define (GECKO|MONO)_VER/{s/[^0-9.]//gp}' \
|
226 |
|
dlls/appwiz.cpl/addons.c || die)
|
227 |
|
if [[ ${WINE_GECKO}$'\n'${WINE_MONO} != "${geckomono}" ]]; then
|
228 |
|
local gmfatal=
|
229 |
|
[[ ${PV} == *9999 ]] && gmfatal=nonfatal
|
230 |
|
${gmfatal} die -n "gecko/mono mismatch in ebuild, has: " ${geckomono} " (please file a bug)"
|
231 |
|
fi
|
232 |
|
|
233 |
|
default
|
234 |
|
|
235 |
|
if tc-is-clang; then
|
236 |
|
if use mingw; then
|
237 |
|
# -mabi=ms was ignored by <clang:16 then turned error in :17
|
238 |
|
# if used without --target *-windows, then gets used in install
|
239 |
|
# phase despite USE=mingw, drop as a quick fix for now
|
240 |
|
sed -i '/MSVCRTFLAGS=/s/-mabi=ms//' configure.ac || die
|
241 |
|
else
|
242 |
|
# fails in ./configure unless --enable-archs is passed, allow to
|
243 |
|
# bypass with EXTRA_ECONF but is currently considered unsupported
|
244 |
|
# (by Gentoo) as additional work is needed for (proper) support
|
245 |
|
# note: also fails w/ :17, but unsure if safe to drop w/o mingw
|
246 |
|
[[ ${EXTRA_ECONF} == *--enable-archs* ]] ||
|
247 |
|
die "building ${PN} with clang is only supported with USE=mingw"
|
248 |
|
fi
|
249 |
|
fi
|
250 |
|
|
251 |
|
# ensure .desktop calls this variant + slot
|
252 |
|
sed -i "/^Exec=/s/wine /${P} /" loader/wine.desktop || die
|
253 |
|
|
254 |
|
# datadir is not where wine-mono is installed, so prefixy alternate paths
|
255 |
|
hprefixify -w /get_mono_path/ dlls/mscoree/metahost.c
|
256 |
|
|
257 |
|
# always update for patches (including user's wrt #432348)
|
258 |
|
eautoreconf
|
259 |
|
tools/make_requests || die # perl
|
260 |
|
# tip: if need more for user patches, with portage can e.g. do
|
261 |
|
# echo "post_src_prepare() { tools/make_specfiles || die; }" \
|
262 |
|
# > /etc/portage/env/app-emulation/wine-staging
|
|
190 |
wine_src_prepare
|
263 |
191 |
}
|
264 |
192 |
|
265 |
193 |
src_configure() {
|
266 |
|
WINE_PREFIX=/usr/lib/${P}
|
267 |
|
WINE_DATADIR=/usr/share/${P}
|
268 |
|
|
269 |
|
local conf=(
|
270 |
|
--prefix="${EPREFIX}"${WINE_PREFIX}
|
271 |
|
--datadir="${EPREFIX}"${WINE_DATADIR}
|
272 |
|
--includedir="${EPREFIX}"/usr/include/${P}
|
273 |
|
--libdir="${EPREFIX}"${WINE_PREFIX}
|
274 |
|
--mandir="${EPREFIX}"${WINE_DATADIR}/man
|
275 |
|
|
276 |
|
$(usev wow64 --enable-archs=x86_64,i386)
|
277 |
|
|
|
194 |
local wineconfargs=(
|
278 |
195 |
$(use_enable gecko mshtml)
|
279 |
196 |
$(use_enable mono mscoree)
|
280 |
197 |
--disable-tests
|
... | ... | |
290 |
207 |
$(use_with gstreamer)
|
291 |
208 |
$(use_with kerberos gssapi)
|
292 |
209 |
$(use_with kerberos krb5)
|
293 |
|
$(use_with mingw)
|
294 |
210 |
$(use_with netapi)
|
295 |
211 |
$(use_with nls gettext)
|
296 |
212 |
$(use_with opencl)
|
297 |
213 |
$(use_with opengl)
|
298 |
|
--without-osmesa # media-libs/mesa no longer supports this
|
299 |
214 |
--without-oss # media-sound/oss is not packaged (OSSv4)
|
300 |
215 |
$(use_with pcap)
|
301 |
216 |
$(use_with pulseaudio pulse)
|
... | ... | |
312 |
227 |
$(use_with wayland)
|
313 |
228 |
$(use_with xcomposite)
|
314 |
229 |
$(use_with xinerama)
|
315 |
|
$(usev !odbc ac_cv_lib_soname_odbc=)
|
316 |
|
)
|
317 |
|
|
318 |
|
filter-lto # build failure
|
319 |
|
filter-flags -Wl,--gc-sections # runtime issues (bug #931329)
|
320 |
|
use custom-cflags || strip-flags # can break in obscure ways at runtime
|
321 |
|
|
322 |
|
# broken with gcc-15's c23 default (TODO: try w/o occasionally, bug #943849)
|
323 |
|
append-cflags -std=gnu17
|
324 |
|
|
325 |
|
# wine uses linker tricks unlikely to work with non-bfd/lld (bug #867097)
|
326 |
|
# (do self test until https://github.com/gentoo/gentoo/pull/28355)
|
327 |
|
if [[ $(LC_ALL=C $(tc-getCC) ${LDFLAGS} -Wl,--version 2>/dev/null) != @(LLD|GNU\ ld)* ]]
|
328 |
|
then
|
329 |
|
has_version -b sys-devel/binutils &&
|
330 |
|
append-ldflags -fuse-ld=bfd ||
|
331 |
|
append-ldflags -fuse-ld=lld
|
332 |
|
strip-unsupported-flags
|
333 |
|
fi
|
334 |
230 |
|
335 |
|
if use mingw; then
|
336 |
|
use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
|
337 |
|
|
338 |
|
# CROSSCC was formerly recognized by wine, thus been using similar
|
339 |
|
# variables (subject to change, esp. if ever make a mingw.eclass).
|
340 |
|
local mingwcc_amd64=${CROSSCC:-${CROSSCC_amd64:-x86_64-w64-mingw32-gcc}}
|
341 |
|
local mingwcc_x86=${CROSSCC:-${CROSSCC_x86:-i686-w64-mingw32-gcc}}
|
342 |
|
local -n mingwcc=mingwcc_$(usex abi_x86_64 amd64 x86)
|
343 |
|
|
344 |
|
conf+=(
|
345 |
|
ac_cv_prog_x86_64_CC="${mingwcc_amd64}"
|
346 |
|
ac_cv_prog_i386_CC="${mingwcc_x86}"
|
347 |
|
|
348 |
|
CROSSCFLAGS="${CROSSCFLAGS:-$(
|
349 |
|
filter-flags '-fstack-protector*' #870136
|
350 |
|
filter-flags '-mfunction-return=thunk*' #878849
|
351 |
|
|
352 |
|
# some bashrc-mv users tend to do CFLAGS="${LDFLAGS}" and then
|
353 |
|
# strip-unsupported-flags miss these during compile-only tests
|
354 |
|
# (primarily done for 23.0 profiles' -z, not full coverage)
|
355 |
|
filter-flags '-Wl,-z,*'
|
356 |
|
|
357 |
|
# -mavx with mingw-gcc has a history of issues and still see
|
358 |
|
# users have problems despite -mpreferred-stack-boundary=2
|
359 |
|
append-cflags -mno-avx
|
360 |
|
|
361 |
|
CC=${mingwcc} test-flags-CC ${CFLAGS:--O2}
|
362 |
|
)}"
|
363 |
|
|
364 |
|
CROSSLDFLAGS="${CROSSLDFLAGS:-$(
|
365 |
|
filter-flags '-fuse-ld=*'
|
366 |
|
|
367 |
|
CC=${mingwcc} test-flags-CCLD ${LDFLAGS}
|
368 |
|
)}"
|
369 |
|
)
|
370 |
|
fi
|
371 |
|
|
372 |
|
# order matters with multilib: configure+compile 64->32, install 32->64
|
373 |
|
local -i bits
|
374 |
|
for bits in $(usev abi_x86_64 64) $(usev abi_x86_32 32); do
|
375 |
|
(
|
376 |
|
einfo "Configuring ${PN} for ${bits}bits in ${WORKDIR}/build${bits} ..."
|
377 |
|
|
378 |
|
mkdir ../build${bits} || die
|
379 |
|
cd ../build${bits} || die
|
380 |
|
|
381 |
|
if (( bits == 64 )); then
|
382 |
|
conf+=( --enable-win64 )
|
383 |
|
elif use amd64; then
|
384 |
|
conf+=(
|
385 |
|
$(usev abi_x86_64 --with-wine64=../build64)
|
386 |
|
TARGETFLAGS=-m32 # for widl
|
387 |
|
)
|
388 |
|
# _setup is optional, but use over Wine's auto-detect (+#472038)
|
389 |
|
multilib_toolchain_setup x86
|
390 |
|
fi
|
391 |
|
|
392 |
|
ECONF_SOURCE=${S} econf "${conf[@]}"
|
|
231 |
$(usev !bluetooth '
|
|
232 |
ac_cv_header_bluetooth_bluetooth_h=no
|
|
233 |
ac_cv_header_bluetooth_rfcomm_h=no
|
|
234 |
')
|
|
235 |
$(usev !odbc ac_cv_lib_soname_odbc=)
|
393 |
236 |
)
|
394 |
|
done
|
395 |
|
}
|
396 |
237 |
|
397 |
|
src_compile() {
|
398 |
|
use abi_x86_64 && emake -C ../build64 # do first
|
399 |
|
use abi_x86_32 && emake -C ../build32
|
|
238 |
wine_src_configure
|
400 |
239 |
}
|
401 |
240 |
|
402 |
241 |
src_install() {
|
403 |
|
use abi_x86_32 && emake DESTDIR="${D}" -C ../build32 install
|
404 |
|
use abi_x86_64 && emake DESTDIR="${D}" -C ../build64 install # do last
|
405 |
|
|
406 |
|
# Ensure both wine64 and wine are available if USE=abi_x86_64 (wow64,
|
407 |
|
# -abi_x86_32, and/or EXTRA_ECONF could cause varying scenarios where
|
408 |
|
# one or the other could be missing and that is unexpected for users
|
409 |
|
# and some tools like winetricks)
|
410 |
|
if use abi_x86_64; then
|
411 |
|
if [[ -e ${ED}${WINE_PREFIX}/bin/wine64 && ! -e ${ED}${WINE_PREFIX}/bin/wine ]]; then
|
412 |
|
dosym wine64 ${WINE_PREFIX}/bin/wine
|
413 |
|
dosym wine64-preloader ${WINE_PREFIX}/bin/wine-preloader
|
414 |
|
|
415 |
|
# also install wine(1) man pages (incl. translations)
|
416 |
|
local man
|
417 |
|
for man in ../build64/loader/wine.*man; do
|
418 |
|
: "${man##*/wine}"
|
419 |
|
: "${_%.*}"
|
420 |
|
insinto ${WINE_DATADIR}/man/${_:+${_#.}/}man1
|
421 |
|
newins ${man} wine.1
|
422 |
|
done
|
423 |
|
elif [[ ! -e ${ED}${WINE_PREFIX}/bin/wine64 && -e ${ED}${WINE_PREFIX}/bin/wine ]]; then
|
424 |
|
dosym wine ${WINE_PREFIX}/bin/wine64
|
425 |
|
dosym wine-preloader ${WINE_PREFIX}/bin/wine64-preloader
|
426 |
|
fi
|
427 |
|
fi
|
428 |
|
|
429 |
|
use perl || rm "${ED}"${WINE_DATADIR}/man/man1/wine{dump,maker}.1 \
|
430 |
|
"${ED}"${WINE_PREFIX}/bin/{function_grep.pl,wine{dump,maker}} || die
|
|
242 |
use perl || local WINE_SKIP_INSTALL=(
|
|
243 |
${WINE_DATADIR}/man/man1/wine{dump,maker}.1
|
|
244 |
${WINE_PREFIX}/bin/{function_grep.pl,wine{dump,maker}}
|
|
245 |
)
|
431 |
246 |
|
432 |
|
# create variant wrappers for eselect-wine
|
433 |
|
local bin
|
434 |
|
for bin in "${ED}"${WINE_PREFIX}/bin/*; do
|
435 |
|
make_wrapper "${bin##*/}-${P#wine-}" "${bin#"${ED}"}"
|
436 |
|
done
|
437 |
|
|
438 |
|
if use mingw; then
|
439 |
|
# don't let portage try to strip PE files with the wrong
|
440 |
|
# strip executable and instead handle it here (saves ~120MB)
|
441 |
|
dostrip -x ${WINE_PREFIX}/wine/{i386,x86_64}-windows
|
442 |
|
|
443 |
|
if use strip; then
|
444 |
|
ebegin "Stripping Windows (PE) binaries"
|
445 |
|
find "${ED}"${WINE_PREFIX}/wine/*-windows -regex '.*\.\(a\|dll\|exe\)' \
|
446 |
|
-exec $(usex abi_x86_64 x86_64 i686)-w64-mingw32-strip --strip-unneeded {} +
|
447 |
|
eend ${?} || die
|
448 |
|
fi
|
449 |
|
fi
|
|
247 |
wine_src_install
|
450 |
248 |
|
451 |
249 |
dodoc ANNOUNCE* AUTHORS README* documentation/README*
|
452 |
250 |
}
|
453 |
251 |
|
454 |
252 |
pkg_postinst() {
|
455 |
|
if use !abi_x86_32 && use !wow64; then
|
456 |
|
ewarn "32bit support is disabled. While 64bit applications themselves will"
|
457 |
|
ewarn "work, be warned that it is not unusual that installers or other helpers"
|
458 |
|
ewarn "will attempt to use 32bit and fail. If do not want full USE=abi_x86_32,"
|
459 |
|
ewarn "note the experimental/WIP USE=wow64 can allow 32bit without multilib."
|
460 |
|
elif use abi_x86_32 && { use opengl || use vulkan; }; then
|
461 |
|
# difficult to tell what is needed from here, but try to warn
|
462 |
|
if has_version 'x11-drivers/nvidia-drivers'; then
|
463 |
|
if has_version 'x11-drivers/nvidia-drivers[-abi_x86_32]'; then
|
464 |
|
ewarn "x11-drivers/nvidia-drivers is installed but is built without"
|
465 |
|
ewarn "USE=abi_x86_32 (ABI_X86=32), hardware acceleration with 32bit"
|
466 |
|
ewarn "applications under ${PN} will likely not be usable."
|
467 |
|
ewarn "Multi-card setups may need this on media-libs/mesa as well."
|
468 |
|
fi
|
469 |
|
elif has_version 'media-libs/mesa[-abi_x86_32]'; then
|
470 |
|
ewarn "media-libs/mesa seems to be in use but is built without"
|
471 |
|
ewarn "USE=abi_x86_32 (ABI_X86=32), hardware acceleration with 32bit"
|
472 |
|
ewarn "applications under ${PN} will likely not be usable."
|
473 |
|
fi
|
474 |
|
fi
|
|
253 |
wine_pkg_postinst
|
475 |
254 |
|
476 |
255 |
optfeature "/dev/hidraw* access used for *some* controllers (e.g. DualShock4)" \
|
477 |
256 |
games-util/game-device-udev-rules
|
478 |
|
|
479 |
|
eselect wine update --if-unset || die
|
480 |
|
}
|
481 |
|
|
482 |
|
pkg_postrm() {
|
483 |
|
if has_version -b app-eselect/eselect-wine; then
|
484 |
|
eselect wine update --if-unset || die
|
485 |
|
fi
|
486 |
257 |
}
|