summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fd578f59062a74745b90b4735f8479317aba33b4 (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
_pkgbase=obs-vkcapture
pkgbase=${_pkgbase}-git
pkgname=('obs-vkcapture-git' 'lib32-obs-vkcapture-git')
pkgver=r46.0645e74
pkgrel=1
url='https://github.com/nowrep/obs-vkcapture'
license=('GPL2')
arch=('x86_64')
depends=('vulkan-icd-loader' 'libgl' 'obs-studio>=27')
makedepends=('git' 'gcc' 'cmake' 'vulkan-headers' 'lib32-gcc-libs' 'lib32-vulkan-icd-loader' 'lib32-libgl')
source=("$_pkgbase::git+$url")
sha512sums=('SKIP')

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

build() {
    cmake -B build -S "$_pkgbase" -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_INSTALL_DATADIR=/share \
        -DCMAKE_BUILD_TYPE=Release
    make -C build

    export CFLAGS="-m32 ${CFLAGS}"
    export CXXFLAGS="-m32 ${CXXFLAGS}"
    export LDFLAGS="-m32 ${LDFLAGS}"

    cmake -B build32 -S "$_pkgbase" -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib32 \
        -DCMAKE_INSTALL_DATADIR=/share \
        -DCMAKE_LIBRARY_PATH=/usr/lib32 \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_PLUGIN=OFF
    make -C build32
}

package_obs-vkcapture-git() {
    pkgdesc='OBS Linux Vulkan/OpenGL game capture'
    conflicts=('obs-vkcapture')
    provides=('obs-vkcapture')

    make -C build DESTDIR="$pkgdir" install
}

package_lib32-obs-vkcapture-git() {
    pkgdesc='OBS Linux Vulkan/OpenGL game capture (32-bit)'
    depends=('lib32-vulkan-icd-loader' 'lib32-libgl')
    conflicts=('lib32-obs-vkcapture')
    provides=('lib32-obs-vkcapture')

    make -C build32 DESTDIR="$pkgdir" install
    rm -r "$pkgdir/usr/bin"
}