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

pkgname=pluma
pkgver=1.26.0
pkgrel=1
pkgdesc="A powerful text editor for MATE"
url="https://mate-desktop.org"
arch=('x86_64')
license=('GPL')
depends=('iso-codes' 'mate-desktop' 'zenity' 'gtksourceview4' 'libpeas' 'python' 'gettext')
makedepends=('itstool' 'gobject-introspection' 'python' 'mate-common' 'yelp-tools' 'autoconf-archive')
optdepends=('python-gobject: to use the python plugins')
groups=('mate-extra')
conflicts=('pluma-gtk3')
replaces=('pluma-gtk3')
source=("https://pub.mate-desktop.org/releases/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz")
sha512sums=('a6c0cee7110f4863e44af51b19bb528f0f3570eab8db98038152bf142eedde97ac13b896deff7051b941a0f43c6fe14e316a97eba40fe5d4854d76038450245f')

build() {
    	cd "${pkgname}-${pkgver}"
    	./autogen.sh
    	PYTHON=/usr/bin/python ./configure \
        	--prefix=/usr \
        	--libexecdir=/usr/lib/${pkgname} \
        	--enable-gtk-doc=no \
        	--enable-python

    	#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
}
