summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2021-06-25 22:05:38 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2021-06-25 22:05:43 -0400
commit16913863c91a5df647a66be93570ad25be66af56 (patch)
tree8058f61399fab1c3222bfb57e64910f482f81882
parentfad053addbbd3f0768a6c68506c9e78f24d0b7f4 (diff)
downloadgentoo-overlay-16913863c91a5df647a66be93570ad25be66af56.tar.xz
gentoo-overlay-16913863c91a5df647a66be93570ad25be66af56.zip
app-emulation/dxvk: new package
-rw-r--r--app-emulation/dxvk/Manifest1
-rw-r--r--app-emulation/dxvk/dxvk-1.8.1.ebuild118
-rw-r--r--app-emulation/dxvk/files/dxvk-1.8_add-compiler-flags.patch44
-rw-r--r--app-emulation/dxvk/metadata.xml14
4 files changed, 177 insertions, 0 deletions
diff --git a/app-emulation/dxvk/Manifest b/app-emulation/dxvk/Manifest
new file mode 100644
index 0000000..5e1355c
--- /dev/null
+++ b/app-emulation/dxvk/Manifest
@@ -0,0 +1 @@
+DIST dxvk-1.8.1.tar.gz 1086640 BLAKE2B 9b30ddeb2ae2850171b83fc1048d7529a0429aa3bdaa067f25a9b77cecd0d91f96269a0ad6ca467a7ee97e9acf0eeb65c7f04b0cd6551f47cbe66b6ae02ad4a0 SHA512 e25190c20079e4d750d4efb7494b03f57de55664e4db734e34e337259ac9f8f3170f287d299e725140bd5465c6798ccab2d615b93a859e92e9c80b445ddfddcc
diff --git a/app-emulation/dxvk/dxvk-1.8.1.ebuild b/app-emulation/dxvk/dxvk-1.8.1.ebuild
new file mode 100644
index 0000000..acb6291
--- /dev/null
+++ b/app-emulation/dxvk/dxvk-1.8.1.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit flag-o-matic meson multilib-minimal
+
+DESCRIPTION="Vulkan-based implementation of D3D9, D3D10 and D3D11 for Linux / Wine"
+HOMEPAGE="https://github.com/doitsujin/dxvk"
+if [[ "${PV}" == "9999" ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/doitsujin/dxvk.git"
+else
+ SRC_URI="https://github.com/doitsujin/dxvk/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+LICENSE="ZLIB"
+SLOT="0"
+if [[ "${PV}" == "9999" ]]; then
+ KEYWORDS=""
+else
+ KEYWORDS="~amd64"
+fi
+IUSE="+d3d9 +d3d10 +d3d11 debug +dxgi test"
+
+DEPEND="
+ abi_x86_32? ( cross-i686-w64-mingw32/gcc )
+ abi_x86_64? ( cross-x86_64-w64-mingw32/gcc )
+ dev-util/vulkan-headers
+ dev-util/glslang
+"
+RDEPEND="
+ media-libs/vulkan-loader[${MULTILIB_USEDEP}]
+ || (
+ >=app-emulation/wine-staging-4.5[${MULTILIB_USEDEP},vulkan]
+ >=app-emulation/wine-vanilla-4.5[${MULTILIB_USEDEP},vulkan]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/dxvk-1.8_add-compiler-flags.patch"
+)
+
+RESTRICT="!test? ( test )"
+
+patch_build_flags() {
+ local bits="${MULTILIB_ABI_FLAG:8:2}"
+
+ # Fix installation directory.
+ sed -i "s|\"x${bits}\"|\"usr/$(get_libdir)/dxvk\"|" setup_dxvk.sh || die
+
+ # Add *FLAGS to cross-file.
+ sed -i \
+ -e "s!@CFLAGS@!$(_meson_env_array "${CFLAGS}")!" \
+ -e "s!@CXXFLAGS@!$(_meson_env_array "${CXXFLAGS}")!" \
+ -e "s!@LDFLAGS@!$(_meson_env_array "${LDFLAGS}")!" \
+ "build-win${bits}.txt" || die
+}
+
+src_prepare() {
+ default
+
+ sed -i "s|^basedir=.*$|basedir=\"${EPREFIX}\"|" setup_dxvk.sh || die
+
+ # Delete installation instructions for unused ABIs.
+ if ! use abi_x86_64; then
+ sed -i '/installFile "$win64_sys_path"/d' setup_dxvk.sh || die
+ fi
+ if ! use abi_x86_32; then
+ sed -i '/installFile "$win32_sys_path"/d' setup_dxvk.sh || die
+ fi
+
+ multilib_foreach_abi patch_build_flags
+
+ # Load configuration file from /etc/dxvk.conf.
+ sed -Ei 's|filePath = "^(\s+)dxvk.conf";$|\1filePath = "/etc/dxvk.conf";|' \
+ src/util/config/config.cpp || die
+}
+
+multilib_src_configure() {
+ local bits="${MULTILIB_ABI_FLAG:8:2}"
+
+ local emesonargs=(
+ --libdir="$(get_libdir)/dxvk"
+ --bindir="$(get_libdir)/dxvk"
+ --cross-file="${S}/build-win${bits}.txt"
+ --buildtype="release"
+ $(usex debug "" "--strip")
+ $(meson_use d3d9 "enable_d3d9")
+ $(meson_use d3d10 "enable_d3d10")
+ $(meson_use d3d11 "enable_d3d11")
+ $(meson_use dxgi "enable_dxgi")
+ $(meson_use test "enable_tests")
+ )
+ meson_src_configure
+}
+
+multilib_src_compile() {
+ EMESON_SOURCE="${S}"
+ meson_src_compile
+}
+
+multilib_src_install() {
+ meson_src_install
+}
+
+multilib_src_install_all() {
+ # The .a files are needed during the install phase.
+ find "${D}" -name '*.a' -delete -print
+
+ dobin setup_dxvk.sh
+
+ insinto etc
+ doins "dxvk.conf"
+
+ default
+}
diff --git a/app-emulation/dxvk/files/dxvk-1.8_add-compiler-flags.patch b/app-emulation/dxvk/files/dxvk-1.8_add-compiler-flags.patch
new file mode 100644
index 0000000..bd58737
--- /dev/null
+++ b/app-emulation/dxvk/files/dxvk-1.8_add-compiler-flags.patch
@@ -0,0 +1,44 @@
+From fa1ead4a488b90593c05f5ce634fd3f9e8dd6b81 Mon Sep 17 00:00:00 2001
+From: tastytea <tastytea@tastytea.de>
+Date: Wed, 13 Jan 2021 16:35:34 +0100
+Subject: [PATCH] Add compiler and linker flags.
+
+---
+ build-win32.txt | 5 +++++
+ build-win64.txt | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/build-win32.txt b/build-win32.txt
+index a1406832..c3c9521c 100644
+--- a/build-win32.txt
++++ b/build-win32.txt
+@@ -7,6 +7,11 @@ strip = 'i686-w64-mingw32-strip'
+ [properties]
+ needs_exe_wrapper = true
+
++c_args = @CFLAGS@
++cpp_args = @CXXFLAGS@
++c_link_args = @LDFLAGS@
++cpp_link_args = @LDFLAGS@
++
+ [host_machine]
+ system = 'windows'
+ cpu_family = 'x86'
+diff --git a/build-win64.txt b/build-win64.txt
+index 1aee4626..50960343 100644
+--- a/build-win64.txt
++++ b/build-win64.txt
+@@ -7,6 +7,11 @@ strip = 'x86_64-w64-mingw32-strip'
+ [properties]
+ needs_exe_wrapper = true
+
++c_args = @CFLAGS@
++cpp_args = @CXXFLAGS@
++c_link_args = @LDFLAGS@
++cpp_link_args = @LDFLAGS@
++
+ [host_machine]
+ system = 'windows'
+ cpu_family = 'x86_64'
+--
+2.26.2
diff --git a/app-emulation/dxvk/metadata.xml b/app-emulation/dxvk/metadata.xml
new file mode 100644
index 0000000..df04ea0
--- /dev/null
+++ b/app-emulation/dxvk/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>alex_y_xu@yahoo.ca</email>
+ <name>Alex Xu (Hello71)</name>
+ </maintainer>
+ <use>
+ <flag name="d3d9">Direct3D 9 support</flag>
+ <flag name="d3d10">Direct3D 10 support</flag>
+ <flag name="d3d11">Direct3D 11 support</flag>
+ <flag name="dxgi">DXGI support</flag>
+ </use>
+</pkgmetadata>