summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 54d38c2cf1855c27e47cfbe9a887f85a40b86c85 (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
# Maintainer: Michael Picht <mipi@fsfe.org>
pkgdesc="Gnome: Organize the items of the top (menu)bar"
_pkgname="top-bar-organizer"
pkgname="gnome-shell-extension-${_pkgname}"
pkgver=9
pkgrel=1
arch=(any)
url="https://gitlab.gnome.org/julianschacher/top-bar-organizer"
license=(GPL3)
source=("https://gitlab.gnome.org/julianschacher/${_pkgname}/-/archive/v${pkgver}/${_pkgname}-v${pkgver}.tar.gz")
md5sums=('a3b34c2384f6c5a6976321049ab64e3c')
makedepends=(
  git
  glib2
)

build() {
  cd "${_pkgname}-v${pkgver}" || return
  glib-compile-schemas data/
}

package() {
  cd "${_pkgname}-v${pkgver}" || return

  # Retrieve extension name from metadata file and create target directory
  _extname=$(grep -Po '(?<="uuid": ")[^"]*' src/metadata.json) 
  _destdir="${pkgdir}/usr/share/gnome-shell/extensions/${_extname}"
  mkdir -p "$_destdir"

  # Copy relevant extension files to target directory
  cp -r src/* "${_destdir}/."
  cp -r data/{css,ui} "${_destdir}/."
  mkdir "${_destdir}/schemas"
  cp data/{*.xml,gschemas.compiled} "${_destdir}/schemas/."
}