# $Id: PKGBUILD 237508 2015-04-19 15:53:38Z arojas $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=cantor
pkgver=15.04.0
pkgrel=1
pkgdesc="KDE Frontend to Mathematical Software"
url="http://kde.org/applications/education/cantor/"
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'FDL')
groups=('kde-applications' 'kdeedu')
depends=('analitza' 'libspectre' 'libqalculate' 'kdelibs4support' 'kpty' 'ktexteditor' 'knewstuff')
makedepends=('extra-cmake-modules' 'python' 'python2' 'kdoctools' 'luajit' 'r')
optdepends=('maxima: Maxima backend'
            'octave: Octave backend'
            'r: R backend'
            'luajit: LUA backend'
            'python: Python 3 backend'
	    'python2: Python 2 backend'
            'sage-mathematics: Sage backend')
conflicts=('kdeedu-cantor')
replaces=('kdeedu-cantor')
install=${pkgname}.install
source=("http://download.kde.org/stable/applications/${pkgver}/src/cantor-${pkgver}.tar.xz")
sha1sums=('22e95c16e5a5d624b41b80024d213fdcb9898a69')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../cantor-${pkgver} \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TESTING=OFF \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
    -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \
    -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so
  make
}

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