# Maintainer: XZS # Contributor: Morris Jobke # Contributor: alucryd # This PKGBUILD is maintained on GitHub . # You may find it convenient to file issues and pull requests there. pkgname=gnome-shell-extension-mediaplayer-git pkgver=r545 pkgrel=1 pkgdesc='A mediaplayer indicator for the Gnome Shell' arch=('any') url='https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer' license=('GPL2') makedepends=('gnome-common' 'intltool') optdepends=('mpdris2-git: MPD support') install=gschemas.install makedepends+=('git') source+=("${_gitname:=${pkgname%-git}}::${_giturl:-git+$url}") md5sums+=('SKIP') provides+=("$_gitname=$pkgver") conflicts+=("$_gitname") pkgver() { cd ${_gitname:-$pkgname} git describe --long --tags 2>/dev/null | sed 's/[^[:digit:]]*\(.\+\)-\([[:digit:]]\+\)-g\([[:xdigit:]]\{7\}\)/\1.r\2.g\3/;t;q1' [ ${PIPESTATUS[0]} -ne 0 ] && \ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { cd "$_gitname" ./autogen.sh ./configure --prefix='/usr' --disable-schemas-compile make } package() { for function in $(declare -F | grep -Po 'package_[[:digit:]]+[[:alpha:]_]*$') do $function done } package_01_make_install() { cd "$_gitname" make DESTDIR="${pkgdir}" install } depends[125]=gnome-shell package_20_version() { local compatibles=($(\ find -path ./pkg -type d -prune -o \ -name metadata.json -exec grep -Pzo '(?s)(?<="shell-version": \[)[^\[\]]*(?=\])' '{}' \; | \ tr '\n," ' '\n' | sed 's/3\.//g;/^$/d' | sort -n -t. -k 1,1)) depends+=("gnome-shell>=3.${compatibles[0]}") local max="${compatibles[-1]}" if [ "3.$max" != $( gnome-shell --version | grep -Po '(?<=GNOME Shell 3\.)[[:digit:]]+' ) ]; then depends+=("gnome-shell<3.$((${max%%.*} + 1))") fi unset depends[125] }