description='Common library for X-Apps project.'
url='https://github.com/linuxmint/xapp'

license="GPL3 LGPL3"

packager="spiky <spiky@nutyx.org>"
contributors="Fanch,Tnut"

makedepends=(meson gobject-introspection gtk3
            python-gobject libgnomekbd vala libdbusmenu-gtk)

name=xapp
version=2.8.5

PKGMK_KEEP_SOURCES="no"
source=(https://github.com/linuxmint/xapp/archive/$version.tar.gz)

build() {

  meson setup $name-$version build \
  --prefix=/usr \
  --libexecdir=lib \
  --buildtype=debugoptimized

  meson compile -C build

  DESTDIR=$PKG meson install -C build

    
# rm useless scripts
  rm -r ${PKG}/usr/bin

# byte-compile python modules since meson does not implement autotools'
# py-compile.
# This is kind of ugly but removes traces of the build root.
  while read -rd '' _file; do
    _destdir="$(dirname "${_file#${PKG}}")"
    python -m compileall -d "${_destdir}" "${_file}"
    python -O -m compileall -d "${_destdir}" "${_file}"
  done < <(find "${PKG}"/usr/lib/python* -name '*.py' -print0)

install -Dm644 $SRC/$name-$version/COPYING $PKG/usr/share/licenses/$name/COPYING
install -Dm644 $SRC/$name-$version/COPYING.LESSER $PKG/usr/share/licenses/$name/COPYING.LESSER
}
