# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gnome-panel
pkgver=3.34.0
pkgrel=1
pkgdesc="Panel of GNOME Flashback"
arch=('x86_64')
url="https://wiki.gnome.org/Projects/GnomePanel"
license=('GPL')
depends=('evolution-data-server' 'gnome-desktop' 'gnome-menus' 'libgdm' 'libwnck3' 'nautilus' 'polkit')
makedepends=('intltool' 'itstool' 'python' 'git' 'gtk-doc' 'yelp-tools' 'autoconf-archive')
optdepends=('alacarte: Main menu editor'
            'gnome-applets: Extra applets for the panel')
_commit=e78941f27e5edd560338da44e76cadfc0fc6ce9b  # tags/3.34.0^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-panel.git#commit=$_commit"
        gettext.diff)
sha256sums=('SKIP'
            '0049e87e4d671ad4890239d3cb9a8652eabc616c2597a5930bcdd2ee31162127')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  patch -Np1 -i ../gettext.diff  # Unbreak build with gettext 0.20
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib/$pkgname \
              --disable-schemas-compile --enable-compile-warnings=minimum --enable-gtk-doc

  #https://bugzilla.gnome.org/show_bug.cgi?id=656231
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
