recipes: Upgrade of x-libs series
[dragora.git] / recipes / x-libs / poppler / recipe
blob9fe61999add2a1fd27339f81cba392cac56a3f98
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
19 set -e
21 program=poppler
22 version=22.12.0
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=x-libs
28 tarname=${program}-${version}.tar.xz
30 # Remote source(s)
31 fetch=https://poppler.freedesktop.org/"$tarname"
33 description="
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}"
48 build()
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     rm -rf BUILD
58     mkdir BUILD
59     cd BUILD
61     cmake \
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             \
74      -DENABLE_BOOST=OFF                               \
75      -G Ninja ..
77     ninja -j${jobs}
78     DESTDIR="$destdir" ninja -j${jobs} install
80     # Compress info documents deleting index file for the package
81     if test -d "${destdir}/$infodir"
82     then
83         rm -f "${destdir}/${infodir}/dir"
84         lzip -9 "${destdir}/${infodir}"/*
85     fi
87     # Compress and link man pages (if needed)
88     if test -d "${destdir}/$mandir"
89     then
90         (
91             cd "${destdir}/$mandir"
92             find . -type f -exec lzip -9 '{}' +
93             find . -type l | while read -r file
94             do
95                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
96                 rm -- "$file"
97             done
98         )
99     fi
101     
102     # Leave the temporary BUILD directory
103     cd .. 
105     # Copy documentation
106     mkdir -p "${destdir}/$docsdir"
107     cp -p $docs "${destdir}/$docsdir"