summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 899102e9502698a13fa45cd3957683a44e59cfe8 (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
# Maintainer: txtsd <aur.archlinux@ihavea.quest>
# Contributor: John Gerritse <tyrannis dot hawk at gmail dot com>
# Contributor: tdy <tdy@archlinux.info>

pkgname=trelby
pkgver=2.4.14
pkgrel=1
pkgdesc='The free, multiplatform, feature-rich screenwriting program!'
arch=(any)
url='https://github.com/trelby/trelby'
license=('GPL-2.0-or-later')
depends=(
  python
  python-lxml
  python-reportlab
  python-wxpython
)
makedepends=(
  docbook-xsl
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)
options=(!debug)
source=(
  "${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz"
  "${pkgname}.xml"
  0001-chore-Adjust-docbook-patch-for-Arch.patch
)
sha256sums=('18574463c10f3e6d080ad266688a0b7894c36f41365e991b53d18fd05f5eda3e'
            'eb9332ff5bd22988ac87231851876df76220a581e1f5bfc5b782cff10ccffe42'
            'fecea43670ce96944bbd0af7e7e5b39c000982ad67941e960e304ec1628a83ba')

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

  patch -Np1 -i ../0001-chore-Adjust-docbook-patch-for-Arch.patch
}

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

  make -C doc manpage
  python -m build --wheel --no-isolation
}

check() {
  cd ${pkgname}-${pkgver}

  pytest
}

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

  python -m installer --destdir="${pkgdir}" dist/*.whl

  local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
  rm -rf "${pkgdir}/usr/lib/python${python_version}/site-packages/tests/"

  install -Dm644 trelby/resources/trelby.desktop "${pkgdir}/usr/share/applications/trelby.desktop"
  install -Dm644 trelby/resources/icon256.png "${pkgdir}/usr/share/trelby/resources/icon256.png"
  install -Dm644 "${srcdir}/${pkgname}.xml" "${pkgdir}/usr/share/mime/packages/${pkgname}.xml"
  install -Dm644 "doc/${pkgname}.1.gz" "${pkgdir}/usr/share/man/man1/${pkgname}.1.gz"
}