# Contributor: Sören Tempel # Contributor: Michael Zhou # Maintainer: Daniel Sabogal pkgname=mupdf pkgver=1.16.1 pkgrel=0 pkgdesc="Lightweight PDF and XPS viewer" url="https://mupdf.com" arch="all" license="AGPL-3.0-or-later" makedepends="freetype-dev harfbuzz-dev jbig2dec-dev jpeg-dev openjpeg-dev readline-dev freeglut-dev zlib-dev libx11-dev libxext-dev libxrandr-dev libxi-dev mesa-dev glu-dev" subpackages="$pkgname-doc $pkgname-dev $pkgname-x11:_x11 $pkgname-gl:_gl $pkgname-tools:_tools" options="!check" source="https://mupdf.com/downloads/archive/mupdf-$pkgver-source.tar.xz shared-lib.patch fix-big-endian.patch " # FIXME: shared linking of /usr/lib/libmupdf.so.0 # secfixes: # 1.13-r0: # - CVE-2018-1000051 # - CVE-2018-6544 # - CVE-2018-6192 # - CVE-2018-6187 # - CVE-2018-5686 # - CVE-2017-17858 # 1.11-r1: # - CVE-2017-6060 # 1.10a-r2: # - CVE-2017-5991 # 1.10a-r1: # - CVE-2017-5896 builddir="$srcdir/$pkgname-$pkgver-source" prepare() { default_prepare rm -rf thirdparty/{curl,freeglut,freetype,harfbuzz,jbig2dec,libjpeg,openjpeg,zlib} } build() { cd "$builddir" make USE_SYSTEM_LIBS=yes prefix=/usr CURL_LIBS='-lcurl -lpthread' build=release libs apps } package() { cd "$builddir" make USE_SYSTEM_LIBS=yes prefix=/usr DESTDIR="$pkgdir" install cd build/release local app; for app in muraster; do install -Dm755 $app "$pkgdir"/usr/bin/$app done ln -s libmupdf.so.0 "$pkgdir"/usr/lib/libmupdf.so ln -s libmupdfthird.so.0 "$pkgdir"/usr/lib/libmupdfthird.so } _x11() { pkgdesc="$pkgdesc with X11 backend" depends="" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/mupdf-x11 \ "$subpkgdir"/usr/bin/ ln -s /usr/bin/mupdf-x11 "$subpkgdir"/usr/bin/mupdf } _gl() { pkgdesc="$pkgdesc with OpenGL backend" depends="" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/mupdf-gl \ "$subpkgdir"/usr/bin/ } _tools() { pkgdesc="Tools for a lightweight PDF and XPS viewer" depends="" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/mutool \ "$pkgdir"/usr/bin/muraster \ "$subpkgdir"/usr/bin/ } sha512sums="fa657e6b9251aff91c25e91b335ea829b797dd91a759505bfd7259f8236613f590a044bc741e9b0587da55817a1ab8c1499c067d65d683d099259d06d91a8f50 mupdf-1.16.1-source.tar.xz 5f1448005c2126c16f9e05a77486d63991110d343a4094e92d6877b11babb30b2a4c3a07580658e1e6caa805a53caf31595309c9f5203ed0a269e4d9e38af3d1 shared-lib.patch 486d09df319050ddb33dbd1e2e0638a7bc6a3e188032a35b81119c45b0de911629b827b21aa47cde6669b66d73fb22cff54d190a8449151fdc27eace71beefbd fix-big-endian.patch"