summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d1234f4e764a3199cb9b52c13f47ef7a2b2716eb (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
# Maintainer: Jacek Szafarkiewicz <szafar at linux dot pl>
# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pkgname=sunshine
pkgname=${_pkgname}-git
pkgver=0.9.0.541.5ff5942
pkgrel=1
pkgdesc="Open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield"
url="https://github.com/loki-47-6F-64/sunshine"
arch=('x86_64' 'i686')
license=('GPL3')

depends=('boost-libs' 'ffmpeg' 'openssl' 'libpulse' 'opus' 'libxtst' 'libx11' 'libxfixes' 'libevdev' 'libxcb' 'udev')
makedepends=('git' 'cmake' 'boost' 'make')

provides=('sunshine')
conflicts=("sunshine")

source=("$_pkgname::git+https://github.com/loki-47-6F-64/sunshine.git"
        "udev.rules")
sha256sums=('SKIP'
            '5ce01689247cb01d3f119cac32c731607d99bb875dcdd39c92b547f76d2befa0')
install=sunshine.install

_assets_path=/usr/share/$_pkgname

pkgver() {
    cd "$_pkgname"
    printf "%s.%s.%s" "$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$_pkgname"
    git submodule update --recursive --init
}

build() {
    export CFLAGS="${CFLAGS/-Werror=format-security/}"
    export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"

    cmake \
        -S "$_pkgname" \
        -B build \
        -Wno-dev \
        -D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
        -D SUNSHINE_ASSETS_DIR="$_assets_path"

    make -C build
}

package() {
    install -Dm644 "$_pkgname/assets/sunshine.conf" "$pkgdir/$_assets_path/sunshine.conf"
    install -Dm644 "$_pkgname/assets/apps_linux.json" "$pkgdir/$_assets_path/apps_linux.json"

    find "$_pkgname/assets/web" -type f -print0 | xargs -0 -I {} install -Dm644 {} "$pkgdir/$_assets_path/web/{}"
    find "$_pkgname/assets/shaders/opengl" -type f -print0 | xargs -0 -I {} install -Dm644 {} "$pkgdir/$_assets_path/shaders/opengl/{}" \;

    install -Dm755 build/sunshine "$pkgdir/usr/bin/sunshine"
    install -Dm755 build/sunshine.service "$pkgdir/usr/lib/systemd/user/sunshine.service"

    install -Dm644 udev.rules "$pkgdir/usr/lib/udev/rules.d/85-$_pkgname.rules"
}

# vim: ts=2 sw=2 et: