aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mupdf/APKBUILD
blob: 8246d53b2df277c4417acaf06bead84291f59c58 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Michael Zhou <zhoumichaely@gmail.com>
pkgname=mupdf
pkgver=1.9a
pkgrel=5
pkgdesc="A lightweight PDF and XPS viewer"
url="http://mupdf.com"
arch="all"
license="AGPL3+"
depends=""
makedepends="freetype-dev jpeg-dev jbig2dec-dev libx11-dev libxext-dev
	openjpeg-dev harfbuzz-dev glfw-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-x11:_x11
	$pkgname-gl:_gl $pkgname-tools:_tools"
source="http://mupdf.com/downloads/archive/$pkgname-$pkgver-source.tar.gz
	shared-lib.patch
	openjpeg-2.1.1.patch
	CVE-2016-6265.patch
	CVE-2016-6525.patch
	"

builddir="$srcdir/$pkgname-$pkgver-source"
prepare() {
	default_prepare || return 1

	cd "$builddir"
	for file in thirdparty/*; do
		[ "${file##*/}" != "mujs" ] && rm -rf "$file"
	done

	sed '/^JBIG2DEC_CFLAGS :=/s|$| -I./include/mupdf|' \
		-i Makethird || return 1
}

build() {
	make HAVE_GLFW=yes SYS_GLFW_LIBS="-lglfw -lGL" \
		prefix=/usr -C "$builddir" || return 1
}

package() {
	make HAVE_GLFW=yes \
		prefix=/usr DESTDIR="$pkgdir" \
		-C "$builddir" install || return 1

	ln -s libmupdf.so.0 "$pkgdir"/usr/lib/libmupdf.so
	ln -s libmupdfthird.so.0 "$pkgdir"/usr/lib/libmupdfthird.so
}

_x11() {
	pkgdesc="A lightweight PDF and XPS viewer with X11 backend"
	depends="!mupdf-gl mupdf"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/mupdf-x11 \
		"$subpkgdir"/usr/bin/ || return 1
	ln -s /usr/bin/mupdf-x11 "$subpkgdir"/usr/bin/mupdf
}

_gl() {
	pkgdesc="A lightweight PDF and XPS viewer with OpenGL backend"
	depends="!mupdf-x11 mupdf"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/mupdf-gl \
		"$subpkgdir"/usr/bin/ || return 1
	ln -s /usr/bin/mupdf-gl "$subpkgdir"/usr/bin/mupdf
}

_tools() {
	pkgdesc="Tools for a lightweight PDF and XPS viewer"
	depends="mupdf"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/mutool \
		"$pkgdir"/usr/bin/mujstest \
		"$subpkgdir"/usr/bin/ || return 1
}

md5sums="658b90788a57d858dcb069cf326e11c3  mupdf-1.9a-source.tar.gz
8c4c5ec03c3df7e87a672c79302f6df5  shared-lib.patch
ba8b6171c4ae38662632259e1c496da1  openjpeg-2.1.1.patch
57b78ee32e4b341d93b29778c55f4ab6  CVE-2016-6265.patch
52db3b30aa98a5d15599a87038992e80  CVE-2016-6525.patch"
sha256sums="8015c55f4e6dd892d3c50db4f395c1e46660a10b460e2ecd180a497f55bbc4cc  mupdf-1.9a-source.tar.gz
3ff3c9413c4c1005db7e41a085ce8e72ee1e956e8d1538a615f51f86f8bb1d14  shared-lib.patch
46f91311ce2f2972986d6d2f4a57fec5e1a556de494e52226206781942522894  openjpeg-2.1.1.patch
287b9e4764d680a66b04040c24e3f982f5aa5fce263749794df0fa57ef4f18a8  CVE-2016-6265.patch
83ab00f0d6bd5e07c286a97a815fa38e9d98df7b5d9925e6cf6fc12e20f5c31c  CVE-2016-6525.patch"
sha512sums="9f804fd65c2dc6b7a3bd73961b1f1a8bf93d52903cccf6302acd6982dfa433125a3b8e77b808984921aee097877280fa21aafb87468cd0a8e4cfa900284a262b  mupdf-1.9a-source.tar.gz
bc38cc6935ed1c5941773e0671bea25d33897c1018c30f11ff3a1ec1e583276597f521b9e526f9bd38a6f9a1e76aa3e52782995ded72a618d07811abcd7ca734  shared-lib.patch
6eb33da5f05c5e5d8fa2af7223261153769b454d535128056015819c164ff59d068354680ebc135c2221f2ae7a3b6ec99833247bfefa83e9a4bab09f243452f1  openjpeg-2.1.1.patch
a69d1db475c25f3a298c3cf3ab4858ca9298087bc9839caacc65e3bc7695c0e3dd600e3c7f5c6cd042ceb536a2cf90404c4f13a90ad0e266791cbcf329873992  CVE-2016-6265.patch
2d8300f93bfe4cf11d817b38e3879ca7eaa704e58274930ee1368f5f1e13cc9baac786421feec0d5a720dd0cbe6cd8b0d94f4a91f2dd762e6e3923fea9deb4bf  CVE-2016-6525.patch"