summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eb66fa047fc18920cf2b798a791fe2c1fb25bd9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: David Runge <dvzrv@archlinux.org>

_name=FoxDot
pkgname=foxdot
pkgver=0.8.12
pkgrel=3
pkgdesc="Live Coding with Python"
arch=(any)
url="https://foxdot.org"
license=(CCPL)
groups=(pro-audio)
depends=(
  python
  supercollider
  tk
)
makedepends=(
  gendesk
  imagemagick
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)
optdepends=('sc3-plugins: use additional UGens')
# pypi sdist doesn't contain tests: https://github.com/Qirky/FoxDot/issues/188
# source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${_name}-${pkgver}.tar.gz")
source=(
  $pkgname-$pkgver.tar.gz::https://github.com/Qirky/$pkgname/archive/v$pkgver.tar.gz
  $pkgname-0.8.12-python3.11.patch
)
sha512sums=('d0b59bb117871ba5a785c2ab3ce83048a6649f02e8d07f1248432868ec49262bcd44fdf98dc5cb2694e1f8a9b38d76c2ac111c21708ef43fda7ce0d4d8471d64'
            '38ce5f0ac54c295a241998399399692793073c039c3a6e61640756908bd09819c08e5fbb656683d70e7426b05e0cc94dc3ae8e9d385df325cac36b1840ac8a0f')
b2sums=('38bd7781daabb4abe3385444fcb254d36a24c532de789fc86063f35ddaacba8092e65bbf4e8b1eb62aff02f2705b35284fcebdfdacca5b0ad5260ffff7293989'
        'efb37ea9c8febc974142bd1127e4ba1ae7a60d458f0414ac97d73c9fe4e6d4ddc25cd12ee1e693b034cd77eb0bcb1e48ad089d89e3ced197099fea623bcb1d62')

prepare() {
  # replace inspect.getargspec with inspect.getfullargspec
  patch -Np1 -d $_name-$pkgver -i ../$pkgname-0.8.12-python3.11.patch
  cd $_name-$pkgver
  gendesk -n \
          --pkgname $pkgname \
          --name $_name \
          --exec $_name \
          --genericname "Live Coding Editor" \
          --categories "AudioVideo;Audio" \
          --comment "Live Coding with Python and SuperCollider"
}

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
  convert -verbose FoxDot/lib/Workspace/img/icon.gif +set date:create +set date:modify $pkgname.png
}

check() {
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")

  cd $_name-$pkgver
  python -m installer --destdir=test_dir dist/*.whl
  export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
  pytest -v
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 ./*.desktop -t "$pkgdir/usr/share/applications/"
  install -vDm 644 $pkgname.png -t "$pkgdir/usr/share/pixmaps/"
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -vDm 644 {README.md,changelog} -t "$pkgdir/usr/share/doc/$pkgname/"
}