# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=lib32-libmbim
pkgver=1.20.0
pkgrel=1
pkgdesc='MBIM modem protocol helper library'
arch=(x86_64)
url=https://www.freedesktop.org/wiki/Software/libmbim/
license=(GPL2)
depends=(
  lib32-glib2
  lib32-glibc
  lib32-libgudev
  libmbim
)
makedepends=(
  git
  python
)
source=(git+https://gitlab.freedesktop.org/mobile-broadband/libmbim.git#tag=376824c586fbf72ea0aeda3c8fb0df38c213a99e)
sha256sums=(SKIP)

pkgver() {
  cd libmbim

  git describe --tags
}

prepare() {
  cd libmbim

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd libmbim

  export CC='gcc -m32'
  export PKG_CONFIG_PATH=/usr/lib32/pkgconfig

  ./configure \
    --prefix=/usr \
    --libdir=/usr/lib32 \
    --libexecdir=/usr/lib32/libmbim \
    --localstatedir=/var \
    --sysconfdir=/etc \
    --disable-gtk-doc-html \
    --disable-static
  make
}

package() {
  make DESTDIR="${pkgdir}" -C libmbim install
  rm -rf "${pkgdir}"/usr/{bin,include,share}
}

# vim: ts=2 sw=2 et:
