summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a3421ded4a194a3b1386d2acad6ff019fa820dd8 (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
65
66
67
68
# Maintainer: Angelo Verlain SHEMA (https://vixalien.com)

pkgname=decibels
pkgver=0.1.7
pkgrel=1
pkgdesc="Play audio files"
arch=('any')
url="https://github.com/vixalien/decibels"
license=(GPL-3.0)
depends=(
  gjs
  gst-plugins-bad-libs
  gst-plugins-base
  gst-plugins-good
  gtk4
  libadwaita
)
makedepends=(
  git
  gobject-introspection
  meson
  typescript
)
checkdepends=(
  appstream-glib
)
source=("git+https://github.com/vixalien/decibels#tag=$pkgver"
        'git+https://gitlab.gnome.org/BrainBlasted/gi-typescript-definitions.git')
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git config submodule.gi-types.url "$srcdir/gi-typescript-definitions"
  git -c protocol.file.allow=always submodule update

  # Fix build:
  sed -i "s/tsc, '--outDir'/tsc, '--project', files('..\/tsconfig.json'), '--outDir'/g" src/meson.build

  # Replace service exec with `decibels`
  sed -i "s/Exec=@application_id@/Exec=$pkgname/g" data/com.vixalien.decibels.service.in
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs || :
}

package() {
  meson install -C build --destdir "$pkgdir"

  cd $pkgname

  install -Dm644 LICENCE -t "$pkgdir/usr/share/licenses/$pkgname/"

  ln -s "/usr/bin/com.vixalien.decibels" "$pkgdir/usr/bin/$pkgname"
}