summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 479d800508a3f11a4e984e39c010532f541928e1 (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
# Maintainer: a821 at (nospam) mail de
# Contributor: Bruno Pagani <archange@archlinux.org>
# Contributor: Darren Ng <$(base64 --decode <<<VW4xR2ZuQGdtYWlsLmNvbQo=)>
# Contributor : Özgür Sarıer <echo b3pndXJzYXJpZXIxMDExNjAxMTE1QGdtYWlsLmNvbQo= | base64 -d>
# Contributor: Brandon Invergo <brandon@invergo.net>

pkgname=img2pdf-git
pkgver=0.6.3.r3.g8bd5855
pkgrel=1
epoch=1
pkgdesc='Losslessly convert raster images to PDF'
arch=(any)
url="https://gitlab.mister-muffin.de/josch/img2pdf"
license=('LGPL-3.0-or-later')
depends=(
    python
    python-dateutil
    python-packaging
    python-pillow
    python-pikepdf
)
makedepends=(git python-build python-flit-core python-installer python-wheel)
checkdepends=(python-pytest python-numpy python-scipy python-lxml
              colord ghostscript imagemagick mupdf-tools openjpeg2 poppler perl-image-exiftool netpbm)
provides=('img2pdf')
conflicts=('img2pdf')
source=("git+${url}")
md5sums=(SKIP)

prepare() {
    cd ${pkgname%-git}
    # remove flit-core version restriction
    sed -i 's/,<4//' pyproject.toml
}

pkgver() {
    cd ${pkgname%-git}
    git describe --long --tags | sed 's/^v//;s/-/.r/;s/-/./'
}

build() {
    cd ${pkgname%-git}
    python -m build --wheel --no-isolation
}

check() {
    cd ${pkgname%-git}
    # Different output on Arch?
    sed -e 's|JPEG-2000 File Format Syntax|JP2|g' \
        -i src/img2pdf_test.py

    # Failures with depth
    pytest -vv --color=yes \
        --deselect 'src/img2pdf_test.py::test_miff_cmyk8[internal]' \
        --deselect 'src/img2pdf_test.py::test_miff_cmyk8[pikepdf]' \
        --deselect 'src/img2pdf_test.py::test_miff_cmyk16[internal]' \
        --deselect 'src/img2pdf_test.py::test_miff_cmyk16[pikepdf]'
}

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

# vim: set ts=4 sw=4 et: