summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b80806f3c6a9a10fde089fd44f2b952dbcaec2d1 (plain)
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
# Maintainer: HurricanePootis <hurricanepootis@protonmail.com>
# Contributor: éclairevoyant
# Contributor: David Husička <contact at bydave dot net>

pkgbase=libdxvk
pkgname=('libdxvk' 'lib32-libdxvk')
pkgver=2.5.1
pkgrel=1
pkgdesc="Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux"
arch=(x86_64)
url="https://github.com/doitsujin/dxvk"
license=(Zlib)
_depends=(glibc sdl2 sdl3 vulkan-icd-loader)
_32depends=(lib32-glibc lib32-sdl2 lib32-sdl3 lib32-vulkan-icd-loader)
makedepends=(git glslang meson ${_depends[@]} ${_32depends[@]})
provides=(libdxvk_dxgi.so libdxvk_d3d8.so libdxvk_d3d9.so libdxvk_d3d10core.so
	  libdxvk_d3d11.so)
source=("git+$url.git#tag=v${pkgver}"
	"git+https://github.com/Joshua-Ashton/mingw-directx-headers.git"
	"git+https://github.com/KhronosGroup/Vulkan-Headers.git"
	"git+https://github.com/KhronosGroup/SPIRV-Headers.git"
	"git+https://gitlab.freedesktop.org/JoshuaAshton/libdisplay-info.git")
sha256sums=('f97561db57859e548a222d57a3763b43a9ab87567a23a4dc4ce8371882fafb07'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')

prepare() {
	cd dxvk
	[[ -d "$srcdir/build" ]] && rm -rf "$srcdir/build"
	[[ -d "$srcdir/build32" ]] && rm -rf "$srcdir/build32"
	git submodule init
	git config submodule.include/native/directx.url "$srcdir/mingw-directx-headers"
	git config submodule.include/vulkan.url "$srcdir/Vulkan-Headers"
	git config submodule.include/spirv.url "$srcdir/SPIRV-Headers"
	git config submodule.subprojects/libdisplay-info.url "$srcdir/libdisplay-info"
	git -c protocol.file.allow=always submodule update
}

build() {
	cd "$srcdir"
	arch-meson -Dbuild_id=true \
	--force-fallback-for=libdisplay-info \
	dxvk build

	meson compile -C build

	CC="gcc -m32" CXX="g++ -m32" \
	LDFLAGS="$LDFLAGS -m32" \
	arch-meson -Dbuild_id=true \
	--force-fallback-for=libdisplay-info \
	--pkg-config="/usr/lib32/pkgconfig" \
	--libdir=lib32 \
	dxvk build32

	meson compile -C build32
}

package_libdxvk() {
	depends=(${_depends[@]})

	meson install -C build --destdir "$pkgdir"
	install -Dm644 dxvk/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

package_lib32-libdxvk() {
	pkgdesc+=" (32-bit)"
	depends=(${_32depends[@]})
	optdepends=('libdxvk: DXVK headers')

	install -Dm644 dxvk/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
	meson install -C build32 --destdir "$pkgdir"
	rm -rf "${pkgdir}/usr/include"
}