# Maintainer: Llewelyn Trahaearn pkgname=gnome-shell-extension-vitals-git pkgver=66.0.0.r0.gc2348f1 pkgrel=1 pkgdesc="Displays system vitals in a GNOME Shell top bar pop-down." arch=('any') url="https://github.com/corecoding/Vitals" license=('GPL') depends=('dconf' 'gnome-shell' 'libgtop' 'lm_sensors') makedepends=('gettext' 'git') provides=("${pkgname%-*}") conflicts=("${pkgname%-*}") source=("${pkgname%-*}::git+${url}") sha512sums=('SKIP') pkgver() { cd "${pkgname%-*}" ( set -o pipefail git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" ) } build() { cd "${pkgname%-*}"/locale for locale in */ do msgfmt -o "${locale}/LC_MESSAGES"/vitals.mo "${locale}/LC_MESSAGES"/vitals.po done } package() { # Locate the extension. cd "$(dirname $(find -name 'metadata.json' -print -quit))" _extname=$(grep -Po '(?<="uuid": ")[^"]*' metadata.json) _destdir="${pkgdir}/usr/share/gnome-shell/extensions/${_extname}" # Copy extension files into place. find -maxdepth 1 \( -iname '*.js*' -or -iname '*.css' -or -iname '*.ui' \) -exec install -Dm644 -t "${_destdir}" '{}' + find -name '*.xml' -exec install -Dm644 -t "${pkgdir}/usr/share/glib-2.0/schemas/" '{}' + cp -r --no-preserve=ownership,mode helpers icons "${_destdir}" cd locale for locale in */ do install -Dm644 -t "${pkgdir}/usr/share/locale/${locale}/LC_MESSAGES" "${locale}/LC_MESSAGES"/*.mo done }