summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 74217d6d77f6066edb60efab5d04491bdc580419 (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
# Maintainer: Jacek Szafarkiewicz <szafar@linux.pl>

pkgname=paperspace
pkgver=11.4.0.3932
pkgrel=1
pkgdesc='Paperspace Receiver'
arch=('x86_64')
license=('custom')
url='https://www.paperspace.com/app'
makedepends=('patchelf')
depends=('gcc-libs' 'libglvnd' 'libxext' 'libxcb')
optdepends=('libva: For hardware accelerated decoding')
source=("https://assets.paperspace.com/native-app/prod/linux/PaperspaceInstaller-${pkgver}"
        paperspace-installer-noninteractive.qs.in
        paperspace.sh)
sha256sums=('d01a41840136af6cb3257820cfa70c6e20fb8683aae34198d078877f2abd3337'
            '4dddf0c7212de5db2c51a8b212b95632bfc92d635e46a136e299308f9de8db0c'
            '32231f483b9ad1369936b7157d5160597014fb418b453f7216b51b9e2b074772')

prepare() {
    cd "$srcdir"

    sed "s;@INSTALL_DIR@;$srcdir/paperspace;" paperspace-installer-noninteractive.qs.in > paperspace-installer-noninteractive.qs

    chmod +x ./PaperspaceInstaller-${pkgver}
    ./PaperspaceInstaller-${pkgver} -platform minimal --verbose --script paperspace-installer-noninteractive.qs

    mv "$HOME/.local/share/applications/Paperspace.desktop" .
    rm paperspace/InstallationLog.txt
}

build() {
    cd "$srcdir"

    sed -i Paperspace.desktop \
        -e "/^Exec=/ s;=.*;=/usr/bin/paperspace;" \
        -e "/^Icon=/ s;=.*;=paperspace;"

    patchelf --set-rpath '$ORIGIN/lib' paperspace/Paperspace
    find paperspace/lib -type f -exec patchelf --set-rpath '$ORIGIN' {} +
}

package() {
    cd "$srcdir"
    mkdir -pv "$pkgdir/usr/bin" "$pkgdir/usr/lib"
    
    cp -av "$srcdir/paperspace" "$pkgdir/usr/lib/paperspace"

    install -Dvm755 "$srcdir/paperspace.sh" "$pkgdir/usr/bin/paperspace"
    install -Dvm644 "$srcdir/Paperspace.desktop" "$pkgdir/usr/share/applications/paperspace.desktop"
    install -Dvm644 "$srcdir/paperspace/linux-icon-310x310.png" "$pkgdir/usr/share/pixmaps/paperspace.png"
}