summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cbdbf95bae44a79babbb0abb6c5c4ed3864203e0 (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
# Maintainer: Your Name <your.email@example.com>
pkgname=coppelia-git
pkgver=r10.840f54a
pkgrel=1
pkgdesc="A refined, cross-platform Jellyfin-focused music player"
arch=('x86_64')
url="https://github.com/j6k4m8/coppelia"
license=('Apache')
depends=('gtk3' 'mpv')
makedepends=('git' 'flutter' 'cmake' 'ninja' 'pkgconf')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+https://github.com/j6k4m8/coppelia.git"
        "coppelia.desktop")
sha256sums=('SKIP'
            'SKIP')

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

prepare() {
  cd "$srcdir/${pkgname%-git}"
  flutter clean
  flutter pub get
}

build() {
  cd "$srcdir/${pkgname%-git}"
  flutter build linux --release
}

package() {
  cd "$srcdir/${pkgname%-git}"

  # Install binary and bundle
  install -d "${pkgdir}/opt/${pkgname%-git}"
  cp -r build/linux/*/release/bundle/* "${pkgdir}/opt/${pkgname%-git}/"

  # Link the executable
  install -d "${pkgdir}/usr/bin"
  ln -s "/opt/${pkgname%-git}/${pkgname%-git}" "${pkgdir}/usr/bin/${pkgname%-git}"

  # Install desktop file
  install -Dm644 "$srcdir/coppelia.desktop" "${pkgdir}/usr/share/applications/${pkgname%-git}.desktop"

  # Install icon
  install -Dm644 assets/logo.png "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"
  install -Dm644 assets/logo.svg "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname%-git}.svg"
}