# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: ponsfoot <cabezon dot hashimoto at gmail dot com>
# Contributor: philacs

pkgname=libvisio
pkgver=0.1.10
pkgrel=2
pkgdesc='Library providing ability to interpret and import visio diagrams'
arch=('x86_64' 'aarch64')
url="https://wiki.documentfoundation.org/DLP/Libraries/libvisio"
license=('MPL-2.0')
depends=('libxml2' 'icu' 'librevenge'
         'gcc-libs' 'glibc')
makedepends=('boost' 'gperf' 'doxygen' 'cppunit')
source=(https://dev-www.libreoffice.org/src/$pkgname/$pkgname-$pkgver.tar.xz)
sha256sums=('9e9eff75112d4d92d92262ad7fc2599c21e26f8fc5ba54900efdc83c0501e472')

prepare() {
  cd $pkgname-$pkgver
  autoreconf -fiv
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

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