# $Id: PKGBUILD 241525 2015-06-30 20:27:19Z arojas $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=kig
pkgver=15.04.3
pkgrel=1
pkgdesc="Interactive Geometry"
url="http://kde.org/applications/education/kig/"
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'FDL')
groups=('kde-applications' 'kdeedu')
depends=('ktexteditor' 'kdelibs4support' 'boost-libs')
makedepends=('extra-cmake-modules' 'kdoctools' 'python' 'python2' 'boost')
replaces=('kdeedu-kig')
conflicts=('kdeedu-kig')
install=${pkgname}.install
source=("http://download.kde.org/stable/applications/${pkgver}/src/kig-${pkgver}.tar.xz")
sha1sums=('7940e6efa165b22e2fd2f52b48bc30ee80d3fad2')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../kig-${pkgver} \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TESTING=OFF \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
  make
}

package() {
  cd build
  make DESTDIR="${pkgdir}" install

  # Use the python2 executable
  sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' "${pkgdir}"/usr/bin/pykig.py
}
