summaryrefslogtreecommitdiff
path: root/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-08-10 15:32:41 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-08-10 15:32:41 +0100
commit56e9cc62c11546e2c081f8dc14a9cc965f14787c (patch)
tree6dd5cbe22a937288e8c471e95a9f92bffb5d5707 /app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
parentd087665a0d6764fc223d2f88a04db01d76af9cc0 (diff)
gentoo auto-resync : 10:08:2023 - 15:32:40
Diffstat (limited to 'app-emulation/wine-vanilla/wine-vanilla-9999.ebuild')
-rw-r--r--app-emulation/wine-vanilla/wine-vanilla-9999.ebuild115
1 files changed, 77 insertions, 38 deletions
diff --git a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild b/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
index 11ed198a2f98..6a19271a4121 100644
--- a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
+++ b/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
@@ -4,7 +4,8 @@
EAPI=8
MULTILIB_COMPAT=( abi_x86_{32,64} )
-inherit autotools flag-o-matic multilib multilib-build toolchain-funcs wrapper
+inherit autotools flag-o-matic multilib multilib-build
+inherit prefix toolchain-funcs wrapper
WINE_GECKO=2.47.4
WINE_MONO=8.0.0
@@ -31,11 +32,13 @@ IUSE="
llvm-libunwind custom-cflags +fontconfig +gecko gphoto2 +gstreamer
kerberos +mingw +mono netapi nls odbc opencl +opengl osmesa pcap
perl pulseaudio samba scanner +sdl selinux smartcard +ssl +strip
- +truetype udev udisks +unwind usb v4l +vulkan wayland +xcomposite
- xinerama"
+ +truetype udev udisks +unwind usb v4l +vulkan wayland wow64
+ +xcomposite xinerama"
+# bug #551124 for truetype
REQUIRED_USE="
X? ( truetype )
- crossdev-mingw? ( mingw )" # bug #551124 for truetype
+ crossdev-mingw? ( mingw )
+ wow64? ( abi_x86_64 !abi_x86_32 mingw )"
# tests are non-trivial to run, can hang easily, don't play well with
# sandbox, and several need real opengl/vulkan or network access
@@ -103,7 +106,10 @@ RDEPEND="
games-emulation/dosbox-staging
)
)
- gecko? ( app-emulation/wine-gecko:${WINE_GECKO}[${MULTILIB_USEDEP}] )
+ gecko? (
+ app-emulation/wine-gecko:${WINE_GECKO}[${MULTILIB_USEDEP}]
+ wow64? ( app-emulation/wine-gecko[abi_x86_32] )
+ )
gstreamer? ( media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}] )
mono? ( app-emulation/wine-mono:${WINE_MONO} )
perl? (
@@ -125,6 +131,7 @@ BDEPEND="
virtual/pkgconfig
mingw? ( !crossdev-mingw? (
>=dev-util/mingw64-toolchain-10.0.0_p1-r2[${MULTILIB_USEDEP}]
+ wow64? ( dev-util/mingw64-toolchain[abi_x86_32] )
) )
nls? ( sys-devel/gettext )
wayland? ( dev-util/wayland-scanner )"
@@ -146,7 +153,8 @@ pkg_pretend() {
if use crossdev-mingw && [[ ! -v MINGW_BYPASS ]]; then
local mingw=-w64-mingw32
- for mingw in $(usev abi_x86_64 x86_64${mingw}) $(usev abi_x86_32 i686${mingw}); do
+ for mingw in $(usev abi_x86_64 x86_64${mingw}) \
+ $(use abi_x86_32 || use wow64 && echo i686${mingw}); do
if ! type -P ${mingw}-gcc >/dev/null; then
eerror "With USE=crossdev-mingw, you must prepare the MinGW toolchain"
eerror "yourself by installing sys-devel/crossdev then running:"
@@ -175,6 +183,9 @@ src_prepare() {
# ensure .desktop calls this variant + slot
sed -i "/^Exec=/s/wine /${P} /" loader/wine.desktop || die
+ # datadir is not where wine-mono is installed, so prefixy alternate paths
+ hprefixify -w /get_mono_path/ dlls/mscoree/metahost.c
+
# always update for patches (including user's wrt #432348)
eautoreconf
tools/make_requests || die # perl
@@ -190,9 +201,13 @@ src_configure() {
--includedir="${EPREFIX}"/usr/include/${P}
--libdir="${EPREFIX}"${WINE_PREFIX}
--mandir="${EPREFIX}"${WINE_DATADIR}/man
+
+ $(usev wow64 --enable-archs=x86_64,i386)
+
$(use_enable gecko mshtml)
$(use_enable mono mscoree)
--disable-tests
+
$(use_with X x)
$(use_with alsa)
$(use_with capi)
@@ -228,19 +243,56 @@ src_configure() {
$(usev !odbc ac_cv_lib_soname_odbc=)
)
- tc-ld-force-bfd # builds with non-bfd but broken at runtime (bug #867097)
+ # builds with non-bfd but broken at runtime (bug #867097)
+ # TODO: retest mold and lld, and figure out what's wrong if
+ # still broken given (at least) lld is supposed to work
+ tc-ld-force-bfd
+
filter-lto # build failure
- use mingw || filter-flags -fno-plt # build failure
use custom-cflags || strip-flags # can break in obscure ways at runtime
- use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
# temporary workaround for tc-ld-force-bfd not yet enforcing with mold
# https://github.com/gentoo/gentoo/pull/28355
[[ $($(tc-getCC) ${LDFLAGS} -Wl,--version 2>/dev/null) == mold* ]] &&
append-ldflags -fuse-ld=bfd
- # build using upstream's way (--with-wine64)
- # order matters: configure+compile 64->32, install 32->64
+ if use mingw; then
+ use crossdev-mingw || PATH=${BROOT}/usr/lib/mingw64-toolchain/bin:${PATH}
+
+ filter-flags -fno-plt # build failure
+
+ # CROSSCC was formerly recognized by wine, thus been using similar
+ # variables (subject to change, esp. if ever make a mingw.eclass).
+ local mingwcc_amd64=${CROSSCC:-${CROSSCC_amd64:-x86_64-w64-mingw32-gcc}}
+ local mingwcc_x86=${CROSSCC:-${CROSSCC_x86:-i686-w64-mingw32-gcc}}
+ local -n mingwcc=mingwcc_$(usex abi_x86_64 amd64 x86)
+
+ conf+=(
+ ac_cv_prog_x86_64_CC="${mingwcc_amd64}"
+ ac_cv_prog_i386_CC="${mingwcc_x86}"
+
+ CROSSCFLAGS="$(
+ filter-flags '-fstack-protector*' #870136
+ filter-flags '-mfunction-return=thunk*' #878849
+
+ # -mavx with mingw-gcc has a history of obscure issues and
+ # disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
+ # crashes with -march=skylake >=wine-8.10, similar issues with
+ # znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+ use custom-cflags || append-cflags -mno-avx
+
+ CC=${mingwcc} test-flags-CC ${CFLAGS:--O2}
+ )"
+
+ CROSSLDFLAGS="$(
+ filter-flags '-fuse-ld=*'
+
+ CC=${mingwcc} test-flags-CCLD ${LDFLAGS}
+ )"
+ )
+ fi
+
+ # order matters with multilib: configure+compile 64->32, install 32->64
local -i bits
for bits in $(usev abi_x86_64 64) $(usev abi_x86_32 32); do
(
@@ -249,10 +301,7 @@ src_configure() {
mkdir ../build${bits} || die
cd ../build${bits} || die
- pe_arch=i386
if (( bits == 64 )); then
- pe_arch=x86_64
- : "${CROSSCC:=${CROSSCC_amd64:-x86_64-w64-mingw32-gcc}}"
conf+=( --enable-win64 )
elif use amd64; then
conf+=(
@@ -262,28 +311,6 @@ src_configure() {
# _setup is optional, but use over Wine's auto-detect (+#472038)
multilib_toolchain_setup x86
fi
- : "${CROSSCC:=${CROSSCC_x86:-i686-w64-mingw32-gcc}}"
-
- if use mingw; then
- # CROSSCC is no longer recognized by Wine, but still use for now
- # (future handling for CROSS* variables is subject to changes)
- conf+=( ac_cv_prog_${pe_arch}_CC="${CROSSCC}" )
-
- # use *FLAGS for mingw, but strip unsupported
- : "${CROSSCFLAGS:=$(
- filter-flags '-fstack-protector*' #870136
- filter-flags '-mfunction-return=thunk*' #878849
- # -mavx with mingw-gcc has a history of obscure issues and
- # disabling is seen as safer, e.g. `WINEARCH=win32 winecfg`
- # crashes with -march=skylake >=wine-8.10, similar issues with
- # znver4: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
- append-cflags -mno-avx
- CC=${CROSSCC} test-flags-CC ${CFLAGS:--O2})}"
- : "${CROSSLDFLAGS:=$(
- filter-flags '-fuse-ld=*'
- CC=${CROSSCC} test-flags-CCLD ${LDFLAGS})}"
- export CROSS{C,LD}FLAGS
- fi
ECONF_SOURCE=${S} econf "${conf[@]}"
)
@@ -299,8 +326,13 @@ src_install() {
use abi_x86_32 && emake DESTDIR="${D}" -C ../build32 install
use abi_x86_64 && emake DESTDIR="${D}" -C ../build64 install # do last
- # symlink for plain 'wine' and install its man pages if 64bit-only #404331
- if use abi_x86_64 && use !abi_x86_32; then
+ if use wow64; then
+ # compat symlinks, albeit ideally no one should call "wine64"
+ dosym wine ${WINE_PREFIX}/bin/wine64
+ dosym wine-preloader ${WINE_PREFIX}/bin/wine64-preloader
+ elif use abi_x86_64 && use !abi_x86_32; then
+ # if no 32bit support it instead only installs "wine64" which may
+ # come as unexpected, so provide "wine" alongside its man page
dosym wine64 ${WINE_PREFIX}/bin/wine
dosym wine64-preloader ${WINE_PREFIX}/bin/wine-preloader
local man
@@ -338,6 +370,13 @@ src_install() {
}
pkg_postinst() {
+ if use !abi_x86_32 && use !wow64; then
+ ewarn "32bit support is disabled. While 64bit applications themselves will"
+ ewarn "work, be warned that it is not unusual that installers or other helpers"
+ ewarn "will attempt to use 32bit and fail. If do not want full USE=abi_x86_32,"
+ ewarn "note that the experimental USE=wow64 can allow 32bit without multilib."
+ fi
+
eselect wine update --if-unset || die
}