# Maintainer: Sven-Hendrik Haase <svenstaro@gmail.com>
# Contributor: Lone_Wolf <lonewolf@xs4all.nl>
# Contributor: sausageandeggs <s_stoakley at hotmail.co.uk>

pkgname=singularity
pkgver=1.00
pkgrel=3
pkgdesc="Endgame: Singularity - simulation of true AI"
arch=('any')
url="http://emhsoft.com/singularity/index.html"
license=('GPL2' 'custom')
depends=('python' 'python-pygame' 'python-numpy')
makedepends=('python-setuptools')
source=("https://github.com/singularity/singularity/releases/download/v${pkgver}/singularity-${pkgver}.tar.gz"{,.asc}
        https://github.com/singularity/singularity-music/archive/025e2696638bcc3bf7690679c3a17c0b46823bbe.tar.gz
        "singularity.desktop")
validpgpkeys=('B3131A451DBFDF7CA05B4197054BBB9F7D806442')
sha512sums=('f3581048c5a535fdbd28d2af1ac596f5396fd712b716931f17de75f8b170f0e226deb2c113023357e21e7de1294e4a632515962df9ee43768baf0fb4bbaa08da'
            'SKIP'
            '9ec095e8882aa3981a4bbfe551f8d61c876fc6d0ee082f558f8e0f3015bfb65d23d76e5c3557a3e9ab41ddfe896eff618934c043ce8cee58709548f02fa81625'
            '8dd0b8bf52594a8f485ce536dbc4bb3ef512bccc7ed577706a7cc549f0dca740149dc229eddca17741163229c427fff4012dd8cf79a4e726baa926de4d10b2c4')

prepare() {
  cd "$pkgname-$pkgver"

  mv "$srcdir"/singularity-music-* singularity/music
  sed -i "s|prune|recursive-include singularity/music *|g" MANIFEST.in
}

build() {
  cd "$pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
  mv run_singularity.sh "$pkgdir"/usr/bin/singularity

  install -Dm644 "$srcdir/singularity.desktop" "$pkgdir/usr/share/applications/singularity.desktop"
  install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE.cc0.txt LICENSE.CC-BY-SA-3.txt LICENSE.gpl.txt LICENSE.txt
}
# vim: sw=2:ts=2 et:
