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

pkgname=mate-desktop
pkgver=1.8.0
pkgrel=3
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' 'ttf-dejavu')
makedepends=('mate-common' 'perl-xml-parser' 'yelp-tools')
optdepends=('lightdm-gtk2-greeter: A lightweight display manager'
            'onboard: On-screen keyboard useful for mobility impaired users'
            'orca: Screen reader for blind or visually impaired individuals'
            'yelp: for reading MATE help documents')
options=('!emptydirs')
groups=('mate')
source=("http://pub.mate-desktop.org/releases/1.8/${pkgname}-${pkgver}.tar.xz")
sha1sums=('1e722d18a198751b209fcf255ad5d3653cb8f6e6')
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
}
