summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f231fe6be668e613a06a5ec41a15249546338e1d (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: metamuffin <metamuffin@disroot.org>

pkgname=jellything-git
pkgver=r617.0f17a9c
pkgrel=3
pkgdesc="Jellything media streaming server"
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
url="https://codeberg.org/metamuffin/jellything"
license=('AGPL-3.0-only')
depends=('dav1d' 'libavif' 'zstd')
optdepends=('ffmpeg: Transcoding')
makedepends=('rustup' 'esbuild' 'nasm' 'meson' 'ninja' 'cmake' 'mdbook' 'clang')
backup=('etc/jellything.yaml' 'etc/jellything_secrets.yaml')
install='jellything.install'
source=("git+https://codeberg.org/metamuffin/jellything.git"
        "jellything.service"
        "jellything.yaml"
        "jellything_secrets.yaml"
        "sysusers.conf")
sha256sums=("SKIP"
            "SKIP"
            "SKIP"
            "SKIP"
            "SKIP")


prepare() {
    cd "jellything"
    git submodule init
    git submodule update
}
pkgver() {
  cd "jellything"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
    cd "jellything"
    rustup default nightly
    # todo: aarch64 works by default, x86 requires clang, untested on i686 and arm
    CFLAGS+=" -ffat-lto-objects"
    CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang cargo +nightly build --release
    strip -s target/release/jellything
    strip -s target/release/jellytool
    ./target/release/generate_completions completions
    mdbook build doc
}
check() {
    cd "jellything"
    cargo test --release
}
package() {
    install -Dm755 jellything/target/release/jellything "$pkgdir/usr/bin/jellything"
    install -Dm755 jellything/target/release/jellytool "$pkgdir/usr/bin/jellytool"
    install -Dm644 jellything/completions/jellytool.fish "$pkgdir/usr/share/fish/completions/jellytool.fish"
    install -Dm644 jellything/completions/jellytool.bash "$pkgdir/usr/share/bash-completion/completions/jellytool"
    install -Dm644 jellything/completions/_jellytool "$pkgdir/usr/share/zsh/site-functions/_jellytool"
    install -Dm644 jellything/completions/jellytool.elv "$pkgdir/usr/share/elvish/lib/jellytool.elv"
    install -Dm644 jellything/COPYING "$pkgdir/usr/share/licenses/jellything/COPYING"
    install -Dm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/jellything.conf"
    install -Dm644 jellything.service "$pkgdir/usr/lib/systemd/system/jellything.service"
    install -Dm644 jellything.yaml "$pkgdir/etc/jellything.yaml"
    install -Dm640 jellything_secrets.yaml "$pkgdir/etc/jellything_secrets.yaml"
    mkdir -p "$pkgdir/usr/share/doc" && cp -r jellything/target/book "$pkgdir/usr/share/doc/jellything"
}