# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Gabriel Martinez < reitaka at gmail dot com >

pkgname=libplist
pkgver=2.7.0
pkgrel=1
pkgdesc='Library to handle Apple Property List files'
arch=(x86_64 aarch64)
url='https://libimobiledevice.org/'
license=(LGPL-2.1-or-later)
depends=(
  gcc-libs
  glibc
)
makedepends=(
  cython
  git
  python-setuptools
)
optdepends=('python: Python bindings')
source=("git+https://github.com/libimobiledevice/libplist.git#tag=$pkgver")
b2sums=('11c3255893c3ccc1f7aa3538d3b6cda6180aafdcd46a40c2d41bf160c738d67516e151317cfb68e4b400b1a1865b81400451df1e1378497c49fff10dad164c62')

prepare() {
  cd $pkgname
  autoreconf -fi
}

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

check() {    
  cd $pkgname
  make check  
}

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