summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2efe2ec30ea2652be6973e1e56c69c08634ab226 (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
# Maintainer:  Berrit Birkner <aur at bbirkner.de>
# Contributor:  Alois Nespor <alium at artixlinux.org>

pkgname=pdfarranger-git
pkgver=1.10.1.r1165.a38e057
pkgrel=1
pkgdesc="Helps merge or split pdf documents and rotate, crop and rearrange pages."
arch=('any')
url="https://github.com/pdfarranger/pdfarranger"
license=('GPL3')
depends=('gtk3'
    'python-gobject'
    'python-cairo'
    'python-pikepdf'
    'python-dateutil'
    'ghostscript'
    'poppler-glib'
    'python-importlib-metadata'
)
makedepends=('git'
    'python-installer'
    'python-setuptools'
    'python-build'
    'python-wheel'
)
optdepends=(
    'img2pdf: support for image files'
    'libhandy: alternate graphics backend'
)
conflicts=('pdfshuffler' 'pdfshuffler-git' 'pdfarranger')
provides=('pdfarranger')
source=($pkgname::"git+https://github.com/pdfarranger/pdfarranger.git")
md5sums=('SKIP')

pkgver () {
    cd "$srcdir/$pkgname"
    _SETUPPY_VERSION="$(python setup.py --version)"
    [[ "$_SETUPPY_VERSION" = "1.10.0" ]] && _VERSION=1.10.1 || _VERSION="$_SETUPPY_VERSION"
    printf "%s.r%s.%s" "$_VERSION" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build () {
    cd "$srcdir/$pkgname"
    sed -i "s/1.10.0/1.10.1/" pdfarranger/pdfarranger.py setup.py
    python -m build --wheel --no-isolation
}

package () {
    cd "$srcdir/$pkgname"
    python -m installer --destdir="${pkgdir}" dist/*.whl
}