summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 06e68064991e8bc66e864e917ede04702f73bfcb (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
# Maintainer: Jiří Klimeš <blueowl@centrum.cz>
# Contributor: Edoardo Brogiolo <edoardo@brogiolo.eu>
# Contributor: Jelle van der Waa <jelle@vdwaa.nl>
# Contributor: Paulo Matias <matiasΘarchlinux-br·org>

pkgname=pdf2djvu
pkgver=0.9.19
pkgrel=3
pkgdesc="Creates DjVu files from PDF files"
arch=('x86_64')
url="https://jwilk.net/software/pdf2djvu"
license=('GPL')
depends=('poppler' 'djvulibre' 'gcc-libs' 'graphicsmagick' 'exiv2')
makedepends=('ttf-liberation' 'boost')
checkdepends=('python-nose' 'poppler-data')
source=(
  "https://github.com/jwilk/pdf2djvu/releases/download/${pkgver}/pdf2djvu-${pkgver}.tar.xz"
  "pdf2djvu-tests-python-3.patch"
)
sha256sums=(
  'eb45a480131594079f7fe84df30e4a5d0686f7a8049dc7084eebe22acc37aa9a'
  'fe6f45c09dee733c7b96a68556e635a47e1faf69bb47aca35599dc6117d22dc2'
)

prepare() {
  # Migrate tests to Python 3
  # (It may not be ideal, but it works.)
  patch -p1 < "$srcdir"/pdf2djvu-tests-python-3.patch

  # fix tests - assert_regexp_matches has been deprecated in nose
  sed -i -e 's/assert_regexp_matches as assert_regex/assert_regex/' "$srcdir"/${pkgname}-${pkgver}/tests/tools.py

  # fix build with poppler >= 24.04.00 (that is built with C++20 standard)
  sed -i -e 's/CXXFLAGS = /CXXFLAGS = -std=c++20 /' "$srcdir"/${pkgname}-${pkgver}/autoconf.mk.in
}

build() {
    cd ${pkgname}-${pkgver}

    ./configure --prefix=/usr
    make
}

check() {
    cd ${pkgname}-${pkgver}

   make PYTHON=python test
}

package() {
    cd ${pkgname}-${pkgver}

    make install DESTDIR="${pkgdir}"
}