summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3a0f178b75e2eb8e08a43bc3da4bbdc8f019cf28 (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
74
75
76
77
78
# Maintainer: txtsd <aur.archlinux@ihavea.quest>
# Contributor: bitwave <github@oomlu.de>
# Contributor: Stanislas H.B. Sodonon <bidossessi@linuxbenin.com>

pkgname=trelby-git
_pkgname=trelby
pkgver=2.4.13.r4.gdd1b514
pkgrel=1
pkgdesc='The free, multiplatform, feature-rich screenwriting program!'
url='https://github.com/trelby/trelby'
arch=(any)
license=('GPL-2.0-or-later')
depends=(
  python
  python-lxml
  python-reportlab
  python-wxpython
)
makedepends=(
  docbook-xsl
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)
provides=("${_pkgname}")
conflicts=("${_pkgname}")
options=(!debug)
source=(
  "git+${url}.git"
  "${_pkgname}.xml"
  "0001-chore-Adjust-docbook-patch-for-Arch.patch"
)
sha256sums=('SKIP'
            'eb9332ff5bd22988ac87231851876df76220a581e1f5bfc5b782cff10ccffe42'
            'fecea43670ce96944bbd0af7e7e5b39c000982ad67941e960e304ec1628a83ba')

pkgver() {
  cd "${_pkgname}"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${_pkgname}"

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

build() {
  cd "${_pkgname}"

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

}

check() {
  cd "${_pkgname}"

  pytest
}

package() {
  cd "${_pkgname}"

  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"
}