# Maintainer: XZS # Contributor: Carl George < arch at cgtx dot us > # Contributor: Janne Haapsaari # Contributor: Christopher Krooß # This PKGBUILD is maintained on GitHub . # You may find it convenient to file issues and pull requests there. pkgname=gnome-shell-extension-dash-to-dock pkgver=53 pkgrel=1 pkgdesc="move the dash out of the overview transforming it in a dock for an easier launching of applications and a faster switching between windows and desktops" arch=('any') url="https://micheleg.github.io/dash-to-dock/" license=('GPL') depends=('dconf') makedepends=('intltool') source=("https://micheleg.github.io/dash-to-dock/releases.html") md5sums=('SKIP') pkgver() { grep -Pom1 '(?<=Version )[[:digit:]]+' releases.html } prepare() { if [ ! -f *.shell-extension.zip ]; then curl -OL $(grep -om1 \ 'https://extensions.gnome.org/.*/[[:digit:]]\+.shell-extension.zip' \ releases.html) fi unzip -o *.shell-extension.zip } package() { for function in $(declare -F | grep -Po 'package_[[:digit:]]+[[:alpha:]_]*$') do $function done } package_01_locate() { msg2 'Locating extension...' cd "$(dirname $(find -name 'metadata.json' -print -quit))" extname=$(grep -Po '(?<="uuid": ")[^"]*' metadata.json) destdir="$pkgdir/usr/share/gnome-shell/extensions/$extname" } package_02_install() { msg2 'Installing extension code...' find -maxdepth 1 \( -iname '*.js*' -or -iname '*.css' -or -iname '*.ui' \) -exec install -Dm644 -t "$destdir" '{}' + } package_09_media() { cp -r --no-preserve=ownership,mode media "$destdir" } package_10_locale() { msg2 'Installing translations...' ( cd locale for locale in */ do install -Dm644 -t "$pkgdir/usr/share/locale/$locale/LC_MESSAGES" "$locale/LC_MESSAGES"/*.mo done ) } if [ -z "$install" ] then install=gschemas.install fi package_10_schemas() { msg2 'Installing schemas...' find -name '*.xml' -exec install -Dm644 -t "$pkgdir/usr/share/glib-2.0/schemas" '{}' + } depends[125]=gnome-shell package_20_version() { local compatibles=($(\ find -path ./pkg -type d -prune -o \ -name metadata.json -exec cat '{}' \; | \ tr -d '\n' | grep -Po '(?<="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] }