summaryrefslogtreecommitdiff
path: root/community/mupdf/PKGBUILD
blob: 709e2c14bc446e5c21a239a314dfdd22dc8f3098 (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
# $Id: PKGBUILD 99335 2013-10-27 10:47:47Z bpiotrowski $
# Maintainer:  Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Brad Fanella <bradfanella@archlinux.us>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Pierre-Paul Paquin <pierrepaulpaquin@gmail.com>
# Contributor: xduugu

pkgname=mupdf
pkgver=1.3
pkgrel=7
pkgdesc='Lightweight PDF and XPS viewer'
arch=('i686' 'x86_64' 'mips64el')
url='http://mupdf.com'
license=('GPL3')
depends=('curl' 'desktop-file-utils' 'freetype2' 'jbig2dec' 'libjpeg' 'libxext' 'openssl')
install=mupdf.install
options=('staticlibs')
source=(https://mupdf.googlecode.com/files/$pkgname-$pkgver-source.tar.gz
        mupdf-1.3-system-libcurl.patch)
sha256sums=('aba8b31bee9cc0a16abedab5e31c81c65996cba5591e62a50a79bea2a63d4478'
            '41a3b6df736f971e91c066e73afac286eec8fa37af244a55df52e8b173646f42')

prepare() {
  cd $pkgname-$pkgver-source
  rm -rf thirdparty/{curl,freetype,jpeg,zlib,jbig2dec}
  patch -Np1 -i ../mupdf-1.3-system-libcurl.patch
}

build() {
  CFLAGS+=' -fPIC'
  CXXFLAGS+=' -fPIC'

  cd $pkgname-$pkgver-source
  make build=release CURL_LIBS='-lcurl -lpthread'
}

package() {
  cd $pkgname-$pkgver-source
  make build=release prefix="$pkgdir"/usr install

  mv "$pkgdir"/usr/bin/mupdf-x11-curl "$pkgdir"/usr/bin/mupdf
  rm "$pkgdir"/usr/bin/mupdf-x11

  cd platform/debian
  sed -i -e 's/mupdf.xpm/mupdf/' \
         -e 's/application\/x-pdf/application\/x-pdf/' \
         -e 's/mupdf-select-file/mupdf/' \
         -e 's/^$/NoDisplay=true/' \
            mupdf.desktop
  install -Dm644 mupdf.desktop "$pkgdir"/usr/share/applications/mupdf.desktop
  install -Dm644 mupdf.xpm "$pkgdir"/usr/share/pixmaps/mupdf.xpm

  find "$pkgdir"/usr/include \
    "$pkgdir"/usr/share \
    "$pkgdir"/usr/lib -type f | xargs chmod -v 0644
}