# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=libimobiledevice-glue
pkgver=1.3.2
pkgrel=1
pkgdesc='A library with common code used by libraries and tools around the libimobiledevice project'
arch=(x86_64 aarch64)
url='https://libimobiledevice.org/'
license=(LGPL-2.1-or-later)
depends=(
  glibc
  libplist
)
makedepends=(git)
source=("git+https://github.com/libimobiledevice/libimobiledevice-glue.git#tag=$pkgver")
b2sums=('576e499809b0f881247e3750d1dcb183f6cf778f98231fd8ccaf2ea866c4018e009057c33249062576ca1e5c3a1346a8d9c698d9d84e5cd76b430c3dd0a524fd')

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
)

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