# Contributor: Sören Tempel # Contributor: Michael Zhou # Contributor: Jakub Jirutka # Maintainer: Daniel Sabogal pkgname=mupdf # XXX: even non-breaking changes require rebuilds against revdeps pkgver=1.22.2 pkgrel=1 pkgdesc="Lightweight PDF and XPS viewer" url="https://mupdf.com" arch="all" license="AGPL-3.0-or-later" makedepends=" curl-dev desktop-file-utils freetype-dev glu-dev gumbo-parser-dev harfbuzz-dev jbig2dec-dev jpeg-dev libx11-dev libxext-dev libxi-dev libxrandr-dev mesa-dev mujs-dev openjpeg-dev readline-dev zlib-dev " subpackages=" $pkgname-doc $pkgname-dev $pkgname-libs $pkgname-x11:_x11 $pkgname-gl:_gl $pkgname-tools:_tools " source="$pkgname-$pkgver.tar.gz::https://mupdf.com/downloads/archive/mupdf-$pkgver-source.tar.gz shared-lib.patch mupdf.pc.in mupdf.desktop mupdf " builddir="$srcdir/$pkgname-$pkgver-source" options="!check" # secfixes: # 1.18.0-r1: # - CVE-2021-3407 # 1.17.0-r3: # - CVE-2020-26519 # 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 # Needs freeglut2-art fork. _make_flags=" build=release shared=yes USE_SYSTEM_LIBS=yes USE_SYSTEM_MUJS=yes USE_SYSTEM_GLUT=no " prepare() { default_prepare local dir; for dir in $(ls thirdparty | grep -v -e extract -e freeglut -e lcms2); do rm -rf thirdparty/$dir done sed "s/@@VERSION@@/$pkgver/" "$srcdir"/$pkgname.pc.in > $pkgname.pc } build() { make $_make_flags verbose=yes libs apps } package() { depends="mupdf-viewer" make $_make_flags prefix=/usr DESTDIR="$pkgdir" install install -D -m644 $pkgname.pc -t "$pkgdir"/usr/lib/pkgconfig/ install -D -m755 "$srcdir"/mupdf -t "$pkgdir"/usr/bin/ install -D -m644 docs/logo/mupdf-logo.svg \ "$pkgdir"/usr/share/icons/hicolor/scalable/apps/$pkgname.svg desktop-file-install --dir="$pkgdir/usr/share/applications" "$srcdir"/$pkgname.desktop cd "$pkgdir" mv usr/lib/libmupdf.so usr/lib/libmupdf.so.$pkgver ln -s libmupdf.so.$pkgver usr/lib/libmupdf.so ldconfig -n usr/lib } libs() { replaces="$pkgname<1.20.0-r3" # backward compatibility (Alpine <3.17) default_libs } _x11() { pkgdesc="$pkgdesc with X11 backend" depends="" # NOTE: Not specifying version to allow installing -x11 and -gl in parallel. provides="$pkgname-viewer" provider_priority=10 # lowest amove usr/bin/mupdf-x11 amove usr/bin/mupdf-x11-curl } _gl() { pkgdesc="$pkgdesc with OpenGL backend" depends="" provides="$pkgname-viewer" provider_priority=100 # highest amove usr/bin/mupdf-gl } _tools() { pkgdesc="Tools for a lightweight PDF and XPS viewer" depends="" amove usr/bin/mutool amove usr/bin/muraster } sha512sums=" 1f2e1c8caab49fcc1fe9d3f2bc994d36c77166a8f424311fb8dd8cfdc18b279d85f2cec52966cdce84a0488465b50eadf9f26f22dda06cb9de6127096458b3b9 mupdf-1.22.2.tar.gz dbfed45c3dbee21e6ac75896f475dd1df51f452997087ac41c29db2990830ce814784195d94dcc3e695255c2f52476200aea5fc78a32b7057547c7c855b494a7 shared-lib.patch 3135f8736fd9e7127a860967c83731af417f96133f8d0fd8ba7ae65985445dc095b84dc91d4a612eae017aefdc60608ca9e1f69867249f9ffa6896e996749d63 mupdf.pc.in 13eb39b20bf1c2bba4af010336aaa168ac9a643e7c78dda5de0d908174f930706ba22fee1c2a2a2d245487027b125abe268ae74810a82a3c8aa182d3f1485f9c mupdf.desktop affbb393536b5887ad53f027087551b0047b2e4e6f3fc1397a362ca7425a230e40492f76c929980c2e27e46317fa76575c3dc6f9672f7061fb15140d8965b128 mupdf "