summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3a5821b6621d4e4a0d83db7d6c95e1c8ac84e619 (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
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
pkgname=gnome-shell-extension-battery-status-git
_uuid=battery-status@atareao.es
pkgver=4.r25.gf486cb7
pkgrel=2
pkgdesc="Get information about your battery status"
arch=('any')
url="https://github.com/atareao/battery-status"
license=('MIT')
depends=('gnome-shell<=1:44.6')
makedepends=('git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('git+https://github.com/atareao/battery-status.git')
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/battery-status"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/battery-status"
  gnome-extensions pack \
    --extra-source=icons \
    --extra-source=aboutpage.js \
    --extra-source=dialogwidgets.js \
    --extra-source=piechart.js \
    --extra-source=preferenceswidget.js \
    --force
}

package() {
  cd "$srcdir/battery-status"
  install -d "$pkgdir/usr/share/gnome-shell/extensions/$_uuid"
  bsdtar xvf "$_uuid.shell-extension.zip" -C \
    "$pkgdir/usr/share/gnome-shell/extensions/$_uuid/" --no-same-owner

  mv "$pkgdir/usr/share/gnome-shell/extensions/$_uuid/locale" "$pkgdir/usr/share/"

  install -Dm644 schemas/es.atareao.battery-status.gschema.xml -t \
    "$pkgdir/usr/share/glib-2.0/schemas/"
  rm -rf "$pkgdir/usr/share/gnome-shell/extensions/$_uuid/schemas"
}