pkgname=libdbusmenu
pkgver=16.04.0
_ver=${pkgver%.*}
slot="0"
pkgdesc="Library to pass menu structure across DBus"
homepage="https://launchpad.net/libdbusmenu"
license=("LGPL-2.1" "LGPL-3")
_patches=("libdbusmenu-16.04.0-configure-fix.patch"
  "libdbusmenu-16.04.0-werror.patch"
)
_patch_sums=("e872017556eb7e6b23a9c80e478b9e25be604bd2500be94879bad6634150265bb7b2979fc3cbe05a06dc9f3ca115ab57457853b37c6db622b5ec4bb23abff2bd"
  "ba1144695110cd8ecf89deaea28e0aacc40b00a500a1dc86c28e67754599117e0a2217c4d6066c1061fa009af82e463dd303ba78c479053857ef6e793959068e"
)
sources=("${pkgname}-${pkgver}.tar.gz"
  "${_patches[@]}"
)
urls=("https://launchpad.net/${pkgname/lib}/${_ver}/${pkgver}/+download/${sources[0]}"
  "${_patches[@]}"
)
sha512sums=("ee9654ac4ed94bdebc94a6db83b126784273a417a645b2881b2ba676a5f67d7fc95dd2bb37bfb0890aa47299ed73cb21ed7de8b75f3fed6b69bfd39065062241"
  "${_patch_sums[@]}"
)

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
  for _patch in ${_patches[@]}; do
    patch -p1 -i ${filedir}/${_patch}
  done
  autoconf
}

src_build() {
  CFLAGS+=" -Wno-error"

  local conf_args=(
    --prefix=/usr
    --docdir=/usr/share/doc/${pkgname}-${pkgver}
    --cache-file="${srcdir}"/config.cache
    --disable-static
    # dumper extra tool is only for GTK+-2.x
    --disable-dumper
    --disable-introspection
    --disable-vala
    --disable-massivedebugging
    --disable-tests
    --enable-gtk
    --with-gtk=3
  )
  ./configure "${conf_args[@]}"
  make
}

src_install() {
  make -j1 DESTDIR="$pkgdir" install
}

# vim:ft=sh syn=sh et sw=2:
