# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Gabriel Martinez < reitaka at gmail dot com >

pkgname=libimobiledevice
pkgver=1.3.0
pkgrel=3
pkgdesc="Library that talks the protocols to support iPhone and iPod Touch devices on Linux"
url="https://libimobiledevice.org/"
arch=('x86_64')
license=('GPL2' 'LGPL2.1')
depends=('libusbmuxd' 'usbmuxd' 'gnutls')
makedepends=('python' 'cython' 'libplist' 'autoconf-archive'
             'git' 'python-setuptools')
_commit=15f8652126664e3a4b980e5d1c039b9053ce8566
source=("git+https://github.com/libimobiledevice/libimobiledevice#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  # Update ac_python_devel.m4 to newer ax_python_devel.m4
  git cherry-pick -n eea4f1be91
  NOCONFIGURE=1 ./autogen.sh
}

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

check() {
  cd $pkgname
  make check
}

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

# vim:set sw=2 et:
