# $Id: PKGBUILD 138991 2015-08-30 19:08:27Z alucryd $
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Ner0 <darkelfdarkelf666@yahoo.co.uk>

pkgname=scratch-text-editor
pkgver=2.2.0
pkgrel=2
pkgdesc='The Pantheon Text Editor'
arch=('i686' 'x86_64')
url='https://launchpad.net/scratch'
license=('GPL3')
depends=('desktop-file-utils' 'glib2' 'glibc' 'gtk3' 'gtksourceview3' 'libgee'
         'libpeas' 'pango' 'zeitgeist'
         'libgranite.so')
makedepends=('cmake' 'gobject-introspection' 'gtkspell3' 'vala' 'vte3'
             'webkitgtk')
optdepends=('gtkspell3: Spell Check extension'
            'vala: Outline extension'
            'vte3: Terminal extension'
            'webkitgtk: Browser Preview extension')
install='scratch-text-editor.install'
source=("https://launchpad.net/scratch/${pkgver%.*.*}.x/${pkgver%.*}/+download/scratch-text-editor-${pkgver}.tar.xz")
sha256sums=('18fdfbdba51c92caaf879da70de9bdeac1a9e2befbdfc7052fb6a1a2f428efdc')

prepare() {
  cd scratch-text-editor-${pkgver}

  if [[ -d build ]]; then
    rm -rf build
  fi
  mkdir build
}

build() {
  cd scratch-text-editor-${pkgver}/build

  cmake .. \
    -DCMAKE_BUILD_TYPE='Release' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DCMAKE_INSTALL_LIBDIR='/usr/lib' \
    -DGSETTINGS_COMPILE='FALSE'
  make
}

package() {
  cd scratch-text-editor-${pkgver}/build

  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
