1 # Maintainer: Christian Hesse <mail@eworm.de>
2 # Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
3 # Contributor: Brad Fanella <bradfanella@archlinux.us>
4 # Contributor: Stefan Husmann <stefan-husmann@t-online.de>
5 # Contributor: Pierre-Paul Paquin <pierrepaulpaquin@gmail.com>
9 pkgname=(libmupdf mupdf mupdf-gl mupdf-tools)
12 pkgdesc='Lightweight PDF and XPS viewer'
14 url='https://mupdf.com/'
16 makedepends=('desktop-file-utils' 'freetype2' 'freeglut' 'glu' 'harfbuzz'
17 'jbig2dec' 'libjpeg' 'mesa-libgl' 'openjpeg2' 'libxext'
19 # we need static libs for zathura-pdf-mupdf
20 options=('staticlibs')
21 source=("https://mupdf.com/downloads/archive/mupdf-${pkgver/_/}-source.tar.gz"
24 sha256sums=('d62f3c0e456ebbc42e71f5a47f0f8cd12cec2bf0a8d72b79e35fa35a6538b25a'
25 'ccff66979249bd4ab4ba8918660f194eb90eb0ae231b16e36a6cecdcf471883f'
26 'a435f44425f5432c074dee745d8fbaeb879038ec1f1ec64f037c74662f09aca8')
29 cd $pkgbase-${pkgver/_/}-source
31 # remove bundled packages, we want our system libraries
32 rm -rf thirdparty/{freeglut,freetype,harfbuzz,jbig2dec,libjpeg,openjpeg,zlib}
38 export CFLAGS CXXFLAGS
41 export USE_SYSTEM_LIBS
43 export CFLAGS+=' -ffat-lto-objects'
45 cd $pkgbase-${pkgver/_/}-source
46 make build=release libs apps
50 pkgdesc='Library for Lightweight PDF and XPS viewer'
52 cd $pkgbase-${pkgver/_/}-source
54 make build=release prefix="$pkgdir"/usr install
56 rm -rf "$pkgdir"/usr/{bin,share/man}
57 mv "$pkgdir"/usr/share/doc/mupdf "$pkgdir"/usr/share/doc/libmupdf
59 find "$pkgdir"/usr/include "$pkgdir"/usr/share "$pkgdir"/usr/lib \
60 -type f -exec chmod 0644 {} +
64 pkgdesc='Lightweight PDF and XPS viewer'
65 depends=('desktop-file-utils' 'freetype2' 'harfbuzz' 'jbig2dec'
66 'libjpeg' 'openjpeg2' 'openssl' 'libxext' 'gumbo-parser')
68 cd $pkgbase-${pkgver/_/}-source
70 install -D -m0755 build/release/mupdf-x11 "$pkgdir"/usr/bin/mupdf
72 install -D -m0644 docs/man/mupdf.1 "$pkgdir"/usr/share/man/man1/mupdf.1
74 install -d "$pkgdir"/usr/share/doc/mupdf
75 install -m0644 README COPYING CHANGES "$pkgdir"/usr/share/doc/mupdf
77 install -D -m0644 ../mupdf.desktop "$pkgdir"/usr/share/applications/mupdf.desktop
78 install -D -m0644 ../mupdf.xpm "$pkgdir"/usr/share/pixmaps/mupdf.xpm
82 pkgdesc='Lightweight PDF and XPS viewer with OpenGL backend'
84 provides=("mupdf=${pkgver}")
85 depends=('desktop-file-utils' 'freetype2' 'freeglut' 'glu' 'harfbuzz' 'jbig2dec'
86 'libjpeg' 'openjpeg2' 'openssl' 'gumbo-parser')
88 cd $pkgbase-${pkgver/_/}-source
90 install -D -m0755 build/release/mupdf-gl "$pkgdir"/usr/bin/mupdf
92 install -D -m0644 docs/man/mupdf.1 "$pkgdir"/usr/share/man/man1/mupdf.1
94 install -d "$pkgdir"/usr/share/doc/mupdf
95 install -m0644 README COPYING CHANGES "$pkgdir"/usr/share/doc/mupdf
97 install -D -m0644 ../mupdf.desktop "$pkgdir"/usr/share/applications/mupdf.desktop
98 install -D -m0644 ../mupdf.xpm "$pkgdir"/usr/share/pixmaps/mupdf.xpm
101 package_mupdf-tools() {
102 pkgdesc='Tools for Lightweight PDF and XPS viewer'
104 depends=('freetype2' 'jbig2dec' 'libjpeg' 'openjpeg2' 'harfbuzz' 'openssl'
107 cd $pkgbase-${pkgver/_/}-source
109 install -D -m0755 build/release/mutool "$pkgdir"/usr/bin/mutool
110 install -D -m0755 build/release/muraster "$pkgdir"/usr/bin/muraster
112 install -D -m0644 docs/man/mutool.1 "$pkgdir"/usr/share/man/man1/mutool.1
114 install -d "$pkgdir"/usr/share/doc/mupdf-tools
115 install -m0644 README COPYING CHANGES "$pkgdir"/usr/share/doc/mupdf-tools