summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ccf048a0d236c5bbc32bfb5605ef5678ad0d0491 (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
# Maintainer: Mark Collins <tera_1225 [aaht] hotmail ðot com>
# Contributor: Caltlgin Stsodaat <contact@fossdaily.xyz>

_name='krop'
pkgname="${_name}-git"
pkgver=r114.e96d42b
pkgrel=2
pkgdesc='Simple graphical tool to crop the pages of PDF files'
arch=('any')
url='https://github.com/arminstraub/krop'
license=('GPL-3.0-or-later')
depends=(
  'python'
  'python-pikepdf'
  'python-poppler-qt5' # AUR
  'python-pyqt5'
)
optdepends=(
  'python-mupdf: alternate backend to pikepdf, initial support only'
  'python-pypdf: alternate backend to pikepdf' # AUR
  'python-pypdf2: alternate backend to pikepdf' # AUR
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
)
provides=("${_name}")
conflicts=("${_name}")
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
  # There are tags, but the last one dates back to 2020 so ignore them
  cd "$_name"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

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

package() {
  cd "$_name"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dvm644 'README.md' -t "${pkgdir}/usr/share/doc/${_pkgname}"
}