# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Kritoke <typeolinux@yahoo.com>

pkgname=gnumeric
pkgver=1.12.59
pkgrel=3
pkgdesc="Spreadsheet application for GNOME"
arch=('x86_64')
url="http://www.gnumeric.org/"
license=('GPL')
depends=(
  at-spi2-core
  cairo
  dconf
  gdk-pixbuf2
  glib2
  glibc
  goffice
  gtk3
  hicolor-icon-theme
  libgsf
  libxml2
  pango
  zlib
)
makedepends=(
  docbook-xml
  glib2-devel
  gobject-introspection
  gtk-doc
  intltool
  python-gobject
  python-setuptools
  yelp-tools
)
optdepends=(
  'perl: for perl plugin support'
  'python-gobject: for python plugin support'
  'yelp: for viewing the help manual'
)
source=(https://download.gnome.org/sources/gnumeric/1.12/gnumeric-$pkgver.tar.xz
        revert-warnings.patch)
sha256sums=('cb3750b176d641f9423df721b831658c829557552f8887fedf8a53d907eceb51'
            'bcafca016b809000c2a5bf911e2e3dfa4de28f9e541d9964574cac5c7ce09e53')

prepare() {
  cd $pkgname-$pkgver
  patch -Np0 -i ../revert-warnings.patch
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --disable-schemas-compile --enable-introspection --disable-silent-rules

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

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