1 # Build recipe for poppler.
3 # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
4 # Copyright (c) 2021-2022 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.xz
31 fetch=https://poppler.freedesktop.org/"$tarname"
34 A PDF rendering library based on the XPDF-3.0 code base.
36 The poppler package contains a PDF rendering library and command line
37 tools used to manipulate PDF files. This is useful for providing PDF
38 rendering functionality as a shared library.
41 homepage=https://poppler.freedesktop.org/
42 license="GPLv2+, GPLv3+"
44 # Source documentation
45 docs="AUTHORS COPYING* ChangeLog NEWS README*"
46 docsdir="${docdir}/${program}-${version}"
50 unpack "${tardir}/$tarname"
54 # Set sane permissions
55 chmod -R u+w,go-w,a+rX-s .
62 -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS" \
63 -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS" \
64 -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS" \
65 -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
66 -DCMAKE_INSTALL_PREFIX=/usr \
67 -DLIB_SUFFIX=/usr/lib${libSuffix} \
68 -DCMAKE_INSTALL_MANDIR=$mandir \
69 -DCMAKE_INSTALL_DOCDIR=$docsdir \
70 -DCMAKE_BUILD_TYPE=Release \
71 -DCMAKE_VERBOSE_MAKEFILE=ON \
72 -DCMAKE_SKIP_INSTALL_RPATH=YES \
73 -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
78 DESTDIR="$destdir" ninja -j${jobs} install
80 # Compress info documents deleting index file for the package
81 if test -d "${destdir}/$infodir"
83 rm -f "${destdir}/${infodir}/dir"
84 lzip -9 "${destdir}/${infodir}"/*
87 # Compress and link man pages (if needed)
88 if test -d "${destdir}/$mandir"
91 cd "${destdir}/$mandir"
92 find . -type f -exec lzip -9 '{}' +
93 find . -type l | while read -r file
95 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
102 # Leave the temporary BUILD directory
106 mkdir -p "${destdir}/$docsdir"
107 cp -p $docs "${destdir}/$docsdir"