# $Id: PKGBUILD 138410 2015-08-16 13:50:23Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Blue Peppers <bluepeppers@archlinux.us>
# Contributor: Stefan Husmann< stefan-husmann@t-online.de>

pkgname=tint2
pkgver=0.12.2
pkgrel=1
pkgdesc='Basic, good-looking task manager for WMs'
arch=('x86_64' 'i686')
url='https://gitlab.com/o9000/tint2'
license=('GPL2')
conflicts=('ttm-svn')
depends=('gtk2' 'imlib2' 'startup-notification')
makedepends=('cmake' 'startup-notification' 'git' 'ninja')
source=("$pkgname-$pkgver.tgz::https://gitlab.com/o9000/tint2/repository/archive.tar.gz?ref=$pkgver"
        'zombie-fix.patch')
sha256sums=('65dbc8e43fdf6d89ce42bc8bbd65a52d103dbd7f94da5f629de86ced22e640ec'
            'a1e942ca3bef05885989f899c0eaaf63f538f7b84cb43d1517d5d39aa64a4ef9')

prepare() {
  cd "$pkgname.git"

  # Applying all available patches
  for f in ../*.patch; do
    echo -e "--- ${f##*/} ---"
    patch -Np1 -i $f && echo "${f##*/} OK!" || echo "${f##*/} FAILED!"
  done
}

build() {
  cd "$pkgname.git"

  # Generating Ninja project files
  mkdir -p build && cd build
  cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_TINT2CONF=1 -G Ninja

  # Compiling
  ninja 
}

package() {
  DESTDIR="$pkgdir" ninja -C "$pkgname.git/build" install
}

# vim:set ts=2 sw=2 et:
