summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b5fca1bb2e13dfcebd12b3270ae2cc920b4606dc (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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# 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' 'poppler-qt6')
pkgname=("${pkgname[@]/%/-git}")
pkgver=22.04.0.r43.g368465a8
_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' 'qt6-base' 'git' 'nss' 'gtk-doc' 'curl' 'poppler-data'
             'cmake' 'python' 'boost')
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 -p 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: highly recommended encoding data to display PDF documents with certain encodings and 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,qt6}
  rm -vf "${pkgdir}"//usr/lib/libpoppler-{glib,qt5,qt6}.*
  rm -vf "${pkgdir}"/usr/lib/pkgconfig/poppler-{glib,qt5,qt6}.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
}

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

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