summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStelios Tsampas2021-11-28 01:54:55 +0200
committerStelios Tsampas2021-11-28 01:54:55 +0200
commit4633cdcd821a7ccb67eb096c483868768feea277 (patch)
tree1f27f1be94fba4e5192c1696be2888d9e2366f50
parent466758f18b09d6b2c096ffdcb4f1624c1ef63763 (diff)
downloadaur-4633cdcd821a7ccb67eb096c483868768feea277.tar.gz
cleanup: split c and cpp flags
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD90
-rw-r--r--dxvk-extraopts.patch4
3 files changed, 57 insertions, 45 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9922c118e57f..b3806323abd3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = dxvk-mingw
pkgdesc = Vulkan-based implementation of D3D9, D3D10 and D3D11 for Linux / Wine, MingW version
pkgver = 1.9.2
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/doitsujin/dxvk
arch = x86_64
license = zlib/libpng
@@ -21,15 +21,15 @@ pkgbase = dxvk-mingw
conflicts = d9vk
options = !lto
options = !staticlibs
- source = git+https://github.com/doitsujin/dxvk.git#tag=v1.9.2
- source = https://raw.githubusercontent.com/Sporif/dxvk-async/1.9.2/dxvk-async.patch
+ source = git+https://github.com/doitsujin/dxvk.git#tag=v
+ source = dxvk-async-1.9.2.patch::https://raw.githubusercontent.com/Sporif/dxvk-async/1.9.2/dxvk-async.patch
source = dxvk-async-conf.patch
source = dxvk-extraopts.patch
source = setup_dxvk
sha256sums = SKIP
sha256sums = 9212a9c42ac8c9c7b9ba7378685b27e7ea0e7a8a8aaac1f3f4d37590ada3e991
sha256sums = c9c2f02bce1e1e93d511aff73484208456835d4d7601a36ab4524939472fc401
- sha256sums = 2bf3515ce9a3ee426c2632aa3355b2556ee8fe5dd8d88e088f90803e3d5f10a6
+ sha256sums = bcc15521e4c7f966a0192a1dabb7fb4935b33db39344ab5b861f9d81486f1362
sha256sums = b2413cabd8cca56e2d308ef5513edf1c7f909036ed2ccfeae17536a0e864dc96
pkgname = dxvk-mingw
diff --git a/PKGBUILD b/PKGBUILD
index eff6222d8b08..8f85b8db58fe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,9 +1,9 @@
# Maintainer: loathingkernel <loathingkernel @at gmail .dot com>
pkgname=dxvk-mingw
-_dxvkver=1.9.2
-pkgver=$_dxvkver
-pkgrel=1
+pkgver=1.9.2
+_asyncver=$pkgver
+pkgrel=2
pkgdesc='Vulkan-based implementation of D3D9, D3D10 and D3D11 for Linux / Wine, MingW version'
arch=('x86_64')
url="https://github.com/doitsujin/dxvk"
@@ -15,18 +15,11 @@ conflicts=('dxvk' 'd9vk')
options=(!lto !staticlibs)
source=(
"git+https://github.com/doitsujin/dxvk.git#tag=v$_dxvkver"
- "https://raw.githubusercontent.com/Sporif/dxvk-async/$_dxvkver/dxvk-async.patch"
+ "dxvk-async-${_asyncver}.patch::https://raw.githubusercontent.com/Sporif/dxvk-async/${_asyncver}/dxvk-async.patch"
"dxvk-async-conf.patch"
"dxvk-extraopts.patch"
"setup_dxvk"
)
-sha256sums=(
- 'SKIP'
- '9212a9c42ac8c9c7b9ba7378685b27e7ea0e7a8a8aaac1f3f4d37590ada3e991'
- 'c9c2f02bce1e1e93d511aff73484208456835d4d7601a36ab4524939472fc401'
- '2bf3515ce9a3ee426c2632aa3355b2556ee8fe5dd8d88e088f90803e3d5f10a6'
- 'b2413cabd8cca56e2d308ef5513edf1c7f909036ed2ccfeae17536a0e864dc96'
-)
prepare() {
cd dxvk
@@ -35,32 +28,38 @@ prepare() {
# Enable at your own risk. If you don't know what it is,
# and its implications, leave it as is. You have been warned.
# I am not liable if anything happens to you by using it.
- #patch -p1 -i "$srcdir"/dxvk-async.patch
+ #patch -p1 -i "$srcdir"/dxvk-async-${_asyncver}.patch
#patch -p1 -i "$srcdir"/dxvk-async-conf.patch
- # Export CFLAGS used by proton
- # -O2 is adjusted to -O3 since AVX is disabled
- # This overrides CFLAGS from makepkg.conf, if you comment these you are on your own
- # If you want the "best" possbile optimizations for your system you can use
+ # Filter known bad flags before applying optimizations
+ # Filter fstack-protector{ ,-all,-strong} flag for MingW.
+ # https://github.com/Joshua-Ashton/d9vk/issues/476
+ CFLAGS="${CFLAGS// -fstack-protector*([\-all|\-strong])/}"
+ CXXFLAGS="${CXXFLAGS// -fstack-protector*([\-all|\-strong])/}"
+ # Doesn't compile with these flags in MingW so remove them.
+ # They are also filtered in Wine PKGBUILDs so remove them
+ # for winelib versions too.
+ CFLAGS="${CFLAGS/ -fno-plt/}"
+ CXXFLAGS="${CXXFLAGS/ -fno-plt/}"
+ LDFLAGS="${LDFLAGS/,-z,now/}"
+ LDFLAGS="${LDFLAGS/,-z,relro/}"
+
+ # 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
+ # If you want the "best" possible optimizations for your system you can use
# `-march=native` and remove the `-mtune=core-avx2` option.
+ # `-O2` is adjusted to `-O3` since AVX is disabled
export CFLAGS="-O3 -march=nocona -mtune=core-avx2 -pipe"
export CXXFLAGS="-O3 -march=nocona -mtune=core-avx2 -pipe"
+ export LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
# Uncomment to enable extra optimizations
# Patch crossfiles with extra optimizations from makepkg.conf
patch -p1 -i "$srcdir"/dxvk-extraopts.patch
- local dxvk_cflags="$CFLAGS"
- local dxvk_ldflags="$LDFLAGS"
- # Filter known bad flags before applying optimizations
- # Filter fstack-protector{ ,-all,-strong} flag for MingW.
- # https://github.com/Joshua-Ashton/d9vk/issues/476
- dxvk_cflags="${dxvk_cflags// -fstack-protector*([\-all|\-strong])/}"
- # Doesn't compile with these flags in MingW so remove them.
- # They are also filtered in Wine PKGBUILDs so remove them
- # for winelib versions too.
- dxvk_cflags="${dxvk_cflags/ -fno-plt/}"
- dxvk_ldflags="${dxvk_ldflags/,-z,now/}"
- dxvk_ldflags="${dxvk_ldflags/,-z,relro/}"
+ local cross_cflags="$CFLAGS"
+ local cross_cxxflags="$CXXFLAGS"
+ local cross_ldflags="$LDFLAGS"
+
# If using -march=native and the CPU supports AVX, launching a d3d9
# game can cause an Unhandled exception. The cause seems to be the
# combination of AVX instructions and tree vectorization (implied by O3),
@@ -73,19 +72,25 @@ prepare() {
# Relevant Wine issues
# https://bugs.winehq.org/show_bug.cgi?id=45289
# https://bugs.winehq.org/show_bug.cgi?id=43516
- dxvk64_cflags="$dxvk_cflags -mno-avx -mno-avx2"
- dxvk32_cflags="$dxvk_cflags -mno-avx -mno-avx2"
+ cross_cflags+=" -mno-avx -mno-avx2"
+ cross_cxxflags+=" -mno-avx -mno-avx2"
+
# These flags are taken from Proton, I don't know if there are issues with Arch wine.
- dxvk64_cflags="$dxvk_cflags -mfpmath=sse -fwrapv -fno-strict-aliasing -gdwarf-2 -gstrict-dwarf"
- dxvk32_cflags="$dxvk_cflags -mfpmath=sse -fwrapv -fno-strict-aliasing -gdwarf-2 -gstrict-dwarf"
- dxvk_ldflags="$dxvk_ldflags -Wl,--file-alignment,4096"
+ cross_cflags+=" -mfpmath=sse -fwrapv -fno-strict-aliasing -gdwarf-2 -gstrict-dwarf"
+ cross_cxxflags+=" -mfpmath=sse -fwrapv -fno-strict-aliasing -gdwarf-2 -gstrict-dwarf -std=c++17"
+ cross_ldflags+=" -Wl,--file-alignment,4096"
sed -i build-win64.txt \
- -e "s|@CARGS@|\'${dxvk64_cflags// /\',\'}\'|g" \
- -e "s|@LDARGS@|\'${dxvk_ldflags// /\',\'}\'|g"
+ -e "s|@CARGS@|\'${cross_cflags// /\',\'}\'|g" \
+ -e "s|@CXXARGS@|\'${cross_cxxflags// /\',\'}\'|g" \
+ -e "s|@LDARGS@|\'${cross_ldflags// /\',\'}\'|g"
+
+ cross_cflags+=" -mstackrealign"
+ cross_cxxflags+=" -mstackrealign"
sed -i build-win32.txt \
- -e "s|@CARGS@|\'${dxvk32_cflags// /\',\'}\'|g" \
- -e "s|@LDARGS@|\'${dxvk_ldflags// /\',\'}\'|g"
+ -e "s|@CARGS@|\'${cross_cflags// /\',\'}\'|g" \
+ -e "s|@CXXARGS@|\'${cross_cxxflags// /\',\'}\'|g" \
+ -e "s|@LDARGS@|\'${cross_ldflags// /\',\'}\'|g"
}
build() {
@@ -93,7 +98,7 @@ build() {
--cross-file dxvk/build-win64.txt \
--prefix "/usr/share/dxvk/x64" \
--bindir "" --libdir "" \
- --buildtype "release" \
+ --buildtype "plain" \
--strip \
-Denable_tests=false
ninja -C "build/x64" -v
@@ -102,7 +107,7 @@ build() {
--cross-file dxvk/build-win32.txt \
--prefix "/usr/share/dxvk/x32" \
--bindir "" --libdir "" \
- --buildtype "release" \
+ --buildtype "plain" \
--strip \
-Denable_tests=false
ninja -C "build/x32" -v
@@ -116,3 +121,10 @@ package() {
install -Dm 644 -t "$pkgdir/usr/share/$pkgname" dxvk/LICENSE
install -Dm 755 -t "$pkgdir/usr/bin" setup_dxvk
}
+
+sha256sums=('SKIP'
+ '9212a9c42ac8c9c7b9ba7378685b27e7ea0e7a8a8aaac1f3f4d37590ada3e991'
+ 'c9c2f02bce1e1e93d511aff73484208456835d4d7601a36ab4524939472fc401'
+ 'bcc15521e4c7f966a0192a1dabb7fb4935b33db39344ab5b861f9d81486f1362'
+ 'b2413cabd8cca56e2d308ef5513edf1c7f909036ed2ccfeae17536a0e864dc96')
+
diff --git a/dxvk-extraopts.patch b/dxvk-extraopts.patch
index 79a9b498c97b..49a77f486f42 100644
--- a/dxvk-extraopts.patch
+++ b/dxvk-extraopts.patch
@@ -8,7 +8,7 @@ index a1406832..748f5c1e 100644
+[built-in options]
+c_args=[@CARGS@]
-+cpp_args=[@CARGS@]
++cpp_args=[@CXXARGS@]
+c_link_args = [@LDARGS@]
+cpp_link_args = [@LDARGS@]
+
@@ -25,7 +25,7 @@ index 1aee4626..7d2e84f4 100644
+[built-in options]
+c_args=[@CARGS@]
-+cpp_args=[@CARGS@]
++cpp_args=[@CXXARGS@]
+c_link_args = [@LDARGS@]
+cpp_link_args = [@LDARGS@]
+