1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# Maintainer: loathingkernel <loathingkernel @at gmail .dot com>
pkgname=dxvk-nvapi-mingw
pkgver=0.8.0
pkgrel=3
pkgdesc='Alternative NVAPI implementation on top of DXVK'
arch=('x86_64')
url="https://github.com/jp7677/dxvk-nvapi"
license=('MIT')
makedepends=('ninja' 'meson>=0.43' 'glslang' 'git' 'mingw-w64-gcc')
provides=('dxvk-nvapi' "dxvk-nvapi=$pkgver")
conflicts=('dxvk-nvapi')
options=(!lto !staticlibs)
source=(
"git+https://github.com/jp7677/dxvk-nvapi.git#tag=v${pkgver}"
"dxvk-nvapi-extraopts.patch"
"setup_dxvk_nvapi.sh"
"setup_dxvk_nvapi"
)
prepare() {
cd dxvk-nvapi
# Explicitly set origin URL for submodules using relative paths
git remote set-url origin https://github.com/jp7677/dxvk-nvapi.git
git submodule update --init --filter=tree:0 --recursive
# Uncomment to enable extra optimizations
# Patch crossfiles with extra optimizations from makepkg.conf
patch -p1 -i "$srcdir"/dxvk-nvapi-extraopts.patch
# By default export FLAGS used by proton and ignore makepkg
# This overrides FLAGS from makepkg.conf, if you comment these you are on your own
local -a split=($CFLAGS)
local -A flags
for opt in "${split[@]}"; do flags["${opt%%=*}"]="${opt##*=}"; done
local march="${flags["-march"]:-nocona}"
local mtune="${flags["-mtune"]:-core-avx2}"
CFLAGS="-O3 -march=$march -mtune=$mtune -pipe"
CXXFLAGS="-O3 -march=$march -mtune=$mtune -pipe"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
# These flags are taken from Proton
CFLAGS+=" -mfpmath=sse -fwrapv -fno-strict-aliasing"
CXXFLAGS+=" -mfpmath=sse -fwrapv -fno-strict-aliasing"
LDFLAGS+=" -Wl,--file-alignment,4096"
export CFLAGS CXXFLAGS LDFLAGS
local cross_ldflags="$LDFLAGS"
local cross_cflags="$CFLAGS -mcmodel=small"
local cross_cxxflags="$CXXFLAGS -mcmodel=small"
sed -i build-win64.txt \
-e "s|@CARGS@|\'${cross_cflags// /\',\'}\'|g" \
-e "s|@CXXARGS@|\'${cross_cxxflags// /\',\'}\'|g" \
-e "s|@LDARGS@|\'${cross_ldflags// /\',\'}\'|g"
local cross_cflags="$CFLAGS -mstackrealign -mpreferred-stack-boundary=2"
local cross_cxxflags="$CXXFLAGS -mstackrealign -mpreferred-stack-boundary=2"
sed -i build-win32.txt \
-e "s|@CARGS@|\'${cross_cflags// /\',\'}\'|g" \
-e "s|@CXXARGS@|\'${cross_cxxflags// /\',\'}\'|g" \
-e "s|@LDARGS@|\'${cross_ldflags// /\',\'}\'|g"
}
build() {
meson setup dxvk-nvapi "build/x64" \
--cross-file dxvk-nvapi/build-win64.txt \
--prefix "/usr/share/dxvk-nvapi/x64" \
--bindir "" --libdir "" \
--buildtype "plain" \
-Denable_tests=false \
-Db_ndebug=false \
--strip
ninja -C "build/x64" -v
meson setup dxvk-nvapi "build/x32" \
--cross-file dxvk-nvapi/build-win32.txt \
--prefix "/usr/share/dxvk-nvapi/x32" \
--bindir "" --libdir "" \
--buildtype "plain" \
-Denable_tests=false \
-Db_ndebug=false \
--strip
ninja -C "build/x32" -v
}
package() {
depends=('vulkan-icd-loader' 'lib32-vulkan-icd-loader' 'wine' 'dxvk' 'bash')
DESTDIR="$pkgdir" ninja -C "build/x32" install
DESTDIR="$pkgdir" ninja -C "build/x64" install
install -Dm 755 -t "$pkgdir/usr/share/dxvk-nvapi" setup_dxvk_nvapi.sh
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" dxvk-nvapi/README.md
install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname" dxvk-nvapi/LICENSE
install -Dm 755 -t "$pkgdir/usr/bin" setup_dxvk_nvapi
}
sha256sums=('200b05ee195799c9d849c249d7171e8b26698872a4e5e3aa996bb0277bde102f'
'dff5ecd1a35a94a4dc1fa5fd08c10b5c88703797520d6b315207124ff1adeef8'
'83e0f91a3ba8662e92a7a869490d36af13df7097c841f7dcf7503876854e85cf'
'1f4934c5bfcf208e288a0eda2f385f82acc9e78a4b0ac2a77b5af14c64c8e21e')
|