app-emulation/dxvk: Add USE-flag skip-toolchain-check

The checks assume that the toolchain was installed with crossdev. The
flag disables the checks for cases where the toolchain was installed
with some other method.

Bug: tastytea/overlay#2185
Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
tastytea 2022-05-13 18:56:38 +02:00
parent 8b79f2fd2c
commit 835b5b8bf6
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
3 changed files with 41 additions and 35 deletions

View File

@ -22,7 +22,7 @@ SLOT="0"
if [[ "${PV}" != *9999* ]]; then
KEYWORDS="~amd64"
fi
IUSE="+d3d9 +d3d10 +d3d11 debug +dxgi video_cards_nvidia test"
IUSE="+d3d9 +d3d10 +d3d11 debug +dxgi video_cards_nvidia skip-toolchain-check test"
DEPEND="
dev-util/vulkan-headers
@ -47,26 +47,28 @@ PATCHES=(
RESTRICT="!test? ( test )"
pkg_pretend () {
local -a categories
use abi_x86_64 && categories+=("cross-x86_64-w64-mingw32")
use abi_x86_32 && categories+=("cross-i686-w64-mingw32")
if ! use skip-toolchain-check; then
local -a categories
use abi_x86_64 && categories+=("cross-x86_64-w64-mingw32")
use abi_x86_32 && categories+=("cross-i686-w64-mingw32")
for cat in ${categories[@]}; do
local thread_model="$(LC_ALL=C ${cat/cross-/}-gcc -v 2>&1 \
for cat in ${categories[@]}; do
local thread_model="$(LC_ALL=C ${cat/cross-/}-gcc -v 2>&1 \
| grep 'Thread model' | cut -d' ' -f3)" || die
if ! has_version -b ">=${cat}/mingw64-runtime-8.0.0[libraries]" ||
! has_version -b "${cat}/gcc" ||
[[ "${thread_model}" != "posix" ]]; then
eerror "The ${cat} toolchain is not properly installed."
eerror "Make sure to install ${cat}/mingw64-runtime >= 8.0.0 with USE=\"libraries\""
eerror "and ${cat}/gcc with EXTRA_ECONF=\"--enable-threads=posix\"."
eerror "See <https://wiki.gentoo.org/wiki/DXVK> for more information."
if ! has_version -b ">=${cat}/mingw64-runtime-8.0.0[libraries]" ||
! has_version -b "${cat}/gcc" ||
[[ "${thread_model}" != "posix" ]]; then
eerror "The ${cat} toolchain is not properly installed."
eerror "Make sure to install ${cat}/mingw64-runtime >= 8.0.0 with USE=\"libraries\""
eerror "and ${cat}/gcc with EXTRA_ECONF=\"--enable-threads=posix\"."
eerror "See <https://wiki.gentoo.org/wiki/DXVK> for more information."
einfo "Alternatively you can install app-emulation/dxvk-bin from the “guru” repo."
einfo "Alternatively you can install app-emulation/dxvk-bin from the “guru” repo."
die "${cat} toolchain is not properly installed."
fi
done
die "${cat} toolchain is not properly installed."
fi
done
fi
einfo "Please report build errors first to the package maintainer via"
einfo "<https://schlomp.space/tastytea/overlay/issues> or email."

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -24,7 +24,7 @@ if [[ "${PV}" == "9999" ]]; then
else
KEYWORDS="~amd64"
fi
IUSE="+d3d9 +d3d10 +d3d11 debug +dxgi video_cards_nvidia test"
IUSE="+d3d9 +d3d10 +d3d11 debug +dxgi video_cards_nvidia skip-toolchain-check test"
DEPEND="
dev-util/vulkan-headers
@ -49,26 +49,28 @@ PATCHES=(
RESTRICT="!test? ( test )"
pkg_pretend () {
local -a categories
use abi_x86_64 && categories+=("cross-x86_64-w64-mingw32")
use abi_x86_32 && categories+=("cross-i686-w64-mingw32")
if ! use skip-toolchain-check; then
local -a categories
use abi_x86_64 && categories+=("cross-x86_64-w64-mingw32")
use abi_x86_32 && categories+=("cross-i686-w64-mingw32")
for cat in ${categories[@]}; do
local thread_model="$(LC_ALL=C ${cat/cross-/}-gcc -v 2>&1 \
for cat in ${categories[@]}; do
local thread_model="$(LC_ALL=C ${cat/cross-/}-gcc -v 2>&1 \
| grep 'Thread model' | cut -d' ' -f3)" || die
if ! has_version -b "${cat}/mingw64-runtime[libraries]" ||
! has_version -b "${cat}/gcc" ||
[[ "${thread_model}" != "posix" ]]; then
eerror "The ${cat} toolchain is not properly installed."
eerror "Make sure to install ${cat}/mingw64-runtime with USE=\"libraries\""
eerror "and ${cat}/gcc with EXTRA_ECONF=\"--enable-threads=posix\"."
eerror "See <https://wiki.gentoo.org/wiki/DXVK> for more information."
if ! has_version -b "${cat}/mingw64-runtime[libraries]" ||
! has_version -b "${cat}/gcc" ||
[[ "${thread_model}" != "posix" ]]; then
eerror "The ${cat} toolchain is not properly installed."
eerror "Make sure to install ${cat}/mingw64-runtime with USE=\"libraries\""
eerror "and ${cat}/gcc with EXTRA_ECONF=\"--enable-threads=posix\"."
eerror "See <https://wiki.gentoo.org/wiki/DXVK> for more information."
einfo "Alternatively you can install app-emulation/dxvk-bin from the “guru” repo."
einfo "Alternatively you can install app-emulation/dxvk-bin from the “guru” repo."
die "${cat} toolchain is not properly installed."
fi
done
die "${cat} toolchain is not properly installed."
fi
done
fi
einfo "Please report build errors first to the package maintainer via"
einfo "<https://schlomp.space/tastytea/overlay/issues> or email."

View File

@ -13,5 +13,7 @@
<flag name="d3d10">Build D3D10</flag>
<flag name="d3d11">Build D3D11</flag>
<flag name="dxgi">Build DXGI</flag>
<flag name="skip-toolchain-check">Do not check if the toolchain
is installed correctly</flag>
</use>
</pkgmetadata>