summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d9b6b6176ea31a71a5720a9b9a53b734a22c0f77 (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Maintainer:  Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: jyantis <yantis@yantis.net>
# Contributor: AndyRTR <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

set -u
pkgbase=poppler
pkgbase+='-git'
pkgname=('poppler' 'poppler-glib' 'poppler-qt5')
pkgname=("${pkgname[@]/%/-git}")
pkgver=0.88.0.r34.g9429aac4
_pkgver="${pkgver%%.r*}"
pkgrel=1
arch=(x86_64)
arch+=('i686' 'aarch64')
license=('GPL')
makedepends=('libjpeg' 'gcc-libs' 'cairo' 'fontconfig' 'openjpeg2' 'gtk3' 'pkgconfig' 'lcms2' 
             'gobject-introspection' 'icu' 'qt5-base' 'git' 'nss' 'gtk-doc' 'curl' 'poppler-data'
             'cmake' 'python' 'boost')
#makedepends+=('openjpeg2')
options=('!emptydirs')
url="https://poppler.freedesktop.org/"
source=('git://git.freedesktop.org/git/poppler/poppler'
        'git://git.freedesktop.org/git/poppler/test')
md5sums=('SKIP'
         'SKIP')
sha256sums=('SKIP'
            'SKIP')
validpgpkeys=('CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7') # "Albert Astals Cid <aacid@kde.org>"

pkgver() {
  set -u
  cd 'poppler'
  git describe --long | sed -e 's/\([^-]*-g\)/r\1/;s/-/./g' -e 's:^poppler\.::g'
  set +u
}

prepare() {
  set -u
  cd 'poppler'
  mkdir build
  set +u
}

build() {
  set -u
  cd poppler
  cd build
  cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
    -DENABLE_GTK_DOC=ON
  make
  set +u
}

check() {
  set -u
  cd poppler
  cd build
  LANG=en_US.UTF8 make test
  set +u
}

package_poppler-git() {
  set -u
  pkgdesc="PDF rendering library based on xpdf 3.0"
  depends=('libjpeg' 'gcc-libs' 'cairo' 'fontconfig' 'openjpeg2' 'lcms2' 'nss' 'curl')
  optdepends=('poppler-data: encoding data to display PDF documents containing CJK characters')
  provides=('libpoppler.so' 'libpoppler-cpp.so')
  provides+=("poppler=${_pkgver}")
  conflicts=("poppler-qt3<${_pkgver}" "poppler-qt4<${_pkgver}")
  conflicts+=('poppler')

  cd poppler
  cd build
  make DESTDIR="${pkgdir}" install

  # cleanup for splitted build
  rm -vrf "${pkgdir}"/usr/include/poppler/{glib,qt5}
  rm -vf "${pkgdir}"//usr/lib/libpoppler-{glib,qt5}.*
  rm -vf "${pkgdir}"/usr/lib/pkgconfig/poppler-{glib,qt5}.pc
  rm -vrf "${pkgdir}"/usr/{lib,share}/gir*
  rm -vrf "${pkgdir}"/usr/share/gtk-doc
}

package_poppler-glib-git() {
  set -u
  pkgdesc="Poppler glib bindings"
  depends=("poppler=${_pkgver}" 'glib2')
  conflicts=('poppler-glib')
  provides=('libpoppler-glib.so')
  provides+=("poppler-glib=${_pkgver}")

  cd poppler
  cd build

  make -C glib DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}/usr/lib/pkgconfig"
  install -m644 poppler-glib.pc "${pkgdir}/usr/lib/pkgconfig/"
  rm -vf "${pkgdir}"/usr/lib/libpoppler.*
  rm -vf "${pkgdir}/usr/bin/poppler-glib-demo"
  set +u
}

package_poppler-qt5-git() {
  set -u
  pkgdesc="Poppler Qt5 bindings"
  depends=("poppler=${_pkgver}" 'qt5-base')
  conflicts=('poppler-qt5')
  provides=('libpoppler-qt5.so')
  provides+=("poppler-qt5=${_pkgver}")

  cd poppler
  cd build
  make -C qt5 DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}/usr/lib/pkgconfig"
  install -m644 poppler-qt5.pc "${pkgdir}/usr/lib/pkgconfig/"
  set +u
}
set +u