summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aab365a5759bf6890b812d24ebd88b51a31b88a4 (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: Andreas Baumann <mail@andreasbaumann.cc>

pkgname=pdfalto
pkgver=0.6.3
pkgrel=1
pkgdesc='PDF to XML ALTO file converter'
arch=('x86_64')
url='https://github.com/kermitt2/pdfalto'
license=('GPL2')
depends=('libtiff' 'freetype2' 'icu' 'libpng14' 'libxml2' 'zlib' 'fontconfig' 'libpaper')
makedepends=('cmake' 'gcc12' 'git')
source=("pdfalto-${pkgver}.tar.gz::https://github.com/kermitt2/pdfalto/archive/refs/tags/v${pkgver}.tar.gz"
        "pdfalto-libpaper-from-system.patch")
md5sums=('74eaf4236cbac1d19fbcfaf821ac9f85'
         'f5af9f957d51267405017f1b3be20877')

prepare()
{
	cd "$srcdir"/$pkgname-$pkgver

	# submodules don't work in the tarball, fetch directly
	git clone https://github.com/lfoppiano/xpdf-4.05.git
	
	# libpaper missing, linking against the system library -lpaper
	patch -Np1 -i "$srcdir/pdfalto-libpaper-from-system.patch"

	cd ../..
}

build()
{
	cd "$srcdir"/$pkgname-$pkgver

	export CC=gcc-12
	export CXX=g++-12
	cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .
	make
	cd ../..
}

package()
{
	cd "$srcdir"/$pkgname-$pkgver

	# Install pdfalto binary
	install -Dm775 pdfalto "$pkgdir"/usr/bin/pdfalto

	# Additional files
	install -Dm644 "$srcdir"/pdfalto-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}