# Maintainer: Brad Fanella <cesura@archlinux.org>
# Contributor: Martin Wimpress <code@flexion.org>

pkgname=mate-panel
pkgver=1.26.0
pkgrel=3
pkgdesc="The MATE Panel"
url="https://mate-desktop.org"
arch=('x86_64')
license=('GPL')
depends=('dbus-glib' 'libwnck3' 'libcanberra' 'libmateweather' 'libsm' 'mate-menus' 'mate-desktop' 'gettext' 'gtk-layer-shell')
makedepends=('itstool' 'gobject-introspection' 'mate-common' 'yelp-tools' 'autoconf-archive')
source=("https://pub.mate-desktop.org/releases/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"
         https://github.com/mate-desktop/mate-panel/commit/808032fc.patch)
groups=('mate')
conflicts=('mate-panel-gtk3')
replaces=('mate-panel-gtk3')
sha256sums=('092e1ed2177b3a13cfb7df19667b06083009210e48294c18c8a68b9b3c47ea64'
            'aefa14360b28f1eec2d1b749eb640b826b0f1fad59e1d06fd840e8e1d69e39ce')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 < ../808032fc.patch # Fix mozo
  ./autogen.sh
}

build() {
    	cd "${pkgname}-${pkgver}" 
    	./configure \
        	--prefix=/usr \
        	--libexecdir=/usr/lib/${pkgname} \
        	--sysconfdir=/etc \
        	--localstatedir=/var \
        	--enable-introspection

    	#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}-${pkgver}"
    	make DESTDIR="${pkgdir}" install
}
