summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a832e22879dece8042a6033e71b2be250bbd3aee (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
# 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.5.1.r0.g819b366
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-pillow python-pikepdf)
makedepends=(git python-setuptools python-build 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)

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|Joint Photographic Experts Group JFIF format|JPEG|g' \
        -e 's|JPEG-2000 File Format Syntax|JP2|g' \
        -e 's|Portable Network Graphics|PNG|g' \
        -e 's|Tagged Image File Format|TIFF|g' \
        -e 's|CompuServe graphics interchange format|GIF|g' \
        -i src/img2pdf_test.py
    sed 's|usr/share/color/icc/sRGB.icc|usr/share/color/icc/colord/sRGB.icc|g' -i src/img2pdf_test.py
    # Failures with depth
    pytest -vv --color=yes || echo "Tests failed"
}

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

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