From 835b5b8bf6233fd32517a73da7b7db9d01064b90 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 13 May 2022 18:56:38 +0200 Subject: [PATCH] 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: https://schlomp.space/tastytea/overlay/issues/2185 Signed-off-by: tastytea --- app-emulation/dxvk/dxvk-1.10.1.ebuild | 36 +++++++++++++------------ app-emulation/dxvk/dxvk-9999.ebuild | 38 ++++++++++++++------------- app-emulation/dxvk/metadata.xml | 2 ++ 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/app-emulation/dxvk/dxvk-1.10.1.ebuild b/app-emulation/dxvk/dxvk-1.10.1.ebuild index f8a3425..3909f15 100644 --- a/app-emulation/dxvk/dxvk-1.10.1.ebuild +++ b/app-emulation/dxvk/dxvk-1.10.1.ebuild @@ -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 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 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 " or email." diff --git a/app-emulation/dxvk/dxvk-9999.ebuild b/app-emulation/dxvk/dxvk-9999.ebuild index 2e7032a..816b22a 100644 --- a/app-emulation/dxvk/dxvk-9999.ebuild +++ b/app-emulation/dxvk/dxvk-9999.ebuild @@ -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 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 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 " or email." diff --git a/app-emulation/dxvk/metadata.xml b/app-emulation/dxvk/metadata.xml index 722bd23..09a02e7 100644 --- a/app-emulation/dxvk/metadata.xml +++ b/app-emulation/dxvk/metadata.xml @@ -13,5 +13,7 @@ Build D3D10 Build D3D11 Build DXGI + Do not check if the toolchain + is installed correctly