# Maintainer : Martin Wimpress <code@flexion.org>

pkgname=mate-desktop
pkgver=1.8.2
pkgrel=1
pkgdesc="Library with common API for various MATE modules"
url="http://mate-desktop.org"
arch=('i686' 'x86_64')
license=(GPL LGPL)
depends=('dconf' 'gtk2' 'hicolor-icon-theme' 'libunique' 'python2'
         'startup-notification')
makedepends=('mate-common' 'perl-xml-parser' 'yelp-tools')
groups=('mate')
source=("http://pub.mate-desktop.org/releases/1.8/${pkgname}-${pkgver}.tar.xz")
sha1sums=('4d3f77d73709631d22528b55d3ffb1cbe4d1ddab')
install=${pkgname}.install

prepare() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    sed -i 's|\/usr\/bin\/python|\/usr\/bin\/env python2|' tools/mpaste
}

build() {
    # See the following for '--disable-desktop-docs' justification
    #  - https://github.com/mate-desktop/mate-desktop/issues/68
    cd "${srcdir}/${pkgname}-${pkgver}"
    PYTHON=/usr/bin/python2 ./configure \
        --prefix=/usr \
        --with-gtk=2.0 \
        --enable-mpaste \
        --disable-static \
        --disable-schemas-compile \
        --disable-desktop-docs \
        --enable-gtk-doc
    make
}

package() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    make DESTDIR="${pkgdir}" install
}
