summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3f91dcc2d7605d4644cf70ba3230af157eff3a10 (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
76
77
# Maintainer: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
# Contributor: Torge Matthies <openglfreak@googlemail.com>
# Contributor: TheBill2001 <tuantran1632001@gmail.com>

_pkgname=latencyflex
pkgname=(latencyflex-git latencyflex-wine-git)
pkgver=r61.0470806
pkgrel=1
pkgdesc="Vendor and game agnostic latency reduction middleware"
arch=('x86_64')
url="https://github.com/ishitatsuyuki/LatencyFleX"
license=('Apache')
makedepends=('git' 'cmake' 'meson' 'vulkan-headers' 'vulkan-validation-layers' 'wine' 'mingw-w64-gcc')
source=("git+https://github.com/ishitatsuyuki/LatencyFleX.git"
        "git+https://github.com/kubo/funchook.git"
        "git+https://github.com/gdabah/distorm.git"
        "git+https://android.googlesource.com/platform/external/perfetto"
        "git+https://github.com/ishitatsuyuki/unhollowed-assemblies.git"
        "latencyflex-wine.install")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            '30861957636eed47ee70461dc377e8dcd23b1acfa8b7bb570196e1347d121bb6')

_vcsname=LatencyFleX

pkgver() {
    cd "$srcdir/$_vcsname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$srcdir/$_vcsname"

    git submodule init
    git config submodule.layer/funchook.url "$srcdir/funchook"
    git config submodule.layer/subprojects/perfetto.url "$srcdir/perfetto"
    git config submodule.layer/unity/unhollowed.url "$srcdir/unhollowed-assemblies"
    git -c protocol.file.allow=always submodule update

    git -C layer/subprojects/funchook submodule init
    git -C layer/subprojects/funchook config submodule.distorm.url "$srcdir/distorm"
    git -c protocol.file.allow=always -C layer/subprojects/funchook submodule update
}

build() {
    cd "$srcdir/$_vcsname/layer"
    arch-meson build
    meson compile -C build
    cd "$srcdir/$_vcsname/layer/wine"
    export LIBRARY_PATH="$PWD/../build/"
    # Bug: Meson leaks LDFLAGS into cross targets
    LDFLAGS= meson --prefix=/usr build-wine64 --cross cross-wine64.txt
    meson compile -C build-wine64
    LDFLAGS= meson --prefix=/usr build-mingw64 --cross cross-mingw64.txt
    meson compile -C build-mingw64
}

package_latencyflex-git() {
    depends=()
    provides=('latencyflex')
    conflicts=('latencyflex')
    cd "$srcdir/$_vcsname/layer"
    DESTDIR="$pkgdir" meson install -C build --skip-subprojects
}

package_latencyflex-wine-git() {
    depends=('latencyflex-git')
    provides=('latencyflex-wine')
    conflicts=('latencyflex-wine')
    install='latencyflex-wine.install'
    cd "$srcdir/$_vcsname/layer/wine"
    DESTDIR="$pkgdir" meson install -C build-wine64 --skip-subprojects
    DESTDIR="$pkgdir" meson install -C build-mingw64 --skip-subprojects
}