summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e4154b2799cd7438520cffb5d95960c6af8f1407 (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
# Maintainer:
# Contributor: Lubosz Sarnecki <lubosz@gmail.com>

_pkgname="novelwriter"
pkgname="$_pkgname-git"
pkgver=2.5.r4.gb7da56a
pkgrel=1
pkgdesc="A markdown-like document editor for writing novels"
url="https://github.com/vkbo/novelWriter"
license=('GPL-3.0-or-later')
arch=('any')

depends=(
  'python'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)

provides=("$_pkgname")
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='v*[a-zA-Z]*' \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd "$_pkgsrc"
  python -m build --no-isolation --wheel
}

package() {
  depends+=(
    'python-pyenchant'
    'python-pyqt5'
  )

  cd "$_pkgsrc"
  python -m installer --destdir="$pkgdir" "$(ls -1 dist/*.whl | sort -rV | head -1)"

  install -Dm644 setup/data/x-novelwriter-project.xml -t "$pkgdir/usr/share/mime/packages"
  install -Dm644 setup/data/novelwriter.desktop -t "$pkgdir/usr/share/applications/"

  install -Dm644 setup/data/hicolor/512x512/apps/novelwriter.png \
    -t "$pkgdir/usr/share/pixmaps/"

  install -Dm644 setup/data/hicolor/512x512/mimetypes/application-x-novelwriter-project.png \
    -t "$pkgdir/usr/share/pixmaps/"
}