#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=gnumeric
pkgver=1.12.53
pkgrel=01
pkgdesc="A GNOME-less spreadsheet program"
arch=('x86_64')
url="http://www.gnumeric.org/"
depends=('goffice')
makedepends=('intltool' 'itstool' 'yelp-tools')
#_commit=858ea03fa5efd3beccc82e8dc269f35b76133d94
conflicts=('gnumeric-minimal')
provides=('gnumeric')
options=('libtool')
source=(https://gitlab.gnome.org/GNOME/gnumeric/-/archive/GNUMERIC_${pkgver//./_}/gnumeric-GNUMERIC_${pkgver//./_}.tar.bz2
		revert-warnings.patch)
#source=("git+https://gitlab.gnome.org/GNOME/gnumeric.git#commit=$_commit"
#         revert-warnings.patch)

prepare() {
  cd ${pkgname}-GNUMERIC_${pkgver//./_}
  patch -Np0 -i ../revert-warnings.patch
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd ${pkgname}-GNUMERIC_${pkgver//./_}
  ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
              --disable-schemas-install --disable-ssindex \
              --without-gnome --without-psiconv --without-perl \
              --without-python --without-gda --without-systemd \
	      --with-help-dir=/usr/share/gnome/help
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

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

  rm -rf "${pkgdir}"/etc/gconf
}

#---- license gpg-key sha256sums ----

license=('GPL')

sha256sums=(295a6c68b37c2c771eab27c929018eb9b1e12b52013988df23fddfe3455bfbd4 # gnumeric-GNUMERIC_1_12_53.tar.bz2
	bcafca016b809000c2a5bf911e2e3dfa4de28f9e541d9964574cac5c7ce09e53) # revert-warnings.patch


