recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / x-libs / fontconfig / recipe
blob6bc8dd27db7f8218485240ee68f76ffcf7392273
1 # Build recipe for fontconfig.
3 # Copyright (c) 2017 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
4 # Copyright (c) 2017-2018 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=fontconfig
22 version=2.13.1
23 release=2
25 # Define a category for the output of the package name
26 pkgcategory=x-libs
28 # The installation of this package replaces to
29 replace=fontconfig-pass1
31 description="
32 Library for font configuration.
34 The fontconfig package is a library for configuring and customizing
35 font access.
38 homepage=https://www.freedesktop.org/wiki/Software/fontconfig/
39 license=Custom
41 tarname=${program}-${version}.tar.bz2
43 # Remote source(s)
44 fetch=https://www.freedesktop.org/software/fontconfig/release/$tarname
46 # Source documentation
47 docs="AUTHORS COPYING ChangeLog NEWS README"
48 docsdir="${docdir}/${program}-${version}"
50 build() {
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # Set sane permissions
56     chmod -R u+w,go-w,a+rX-s .
58     # Make sure the system regenerates src/fcobjshash.h (Thanks to BLFS!)
59     rm -f src/fcobjshash.h
61     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
62     $configure_args \
63     --libdir=/usr/lib${libSuffix} \
64     --mandir=$mandir \
65     --with-docdir=$docsdir \
66     --disable-static \
67     --enable-shared \
68     --disable-gtk-doc \
69     --build="$(gcc -dumpmachine)"
71     make -j${jobs} V=1
72     make -j${jobs} DESTDIR="$destdir" install-strip
74     # Compress manual pages
75     if [ -d "${destdir}/$mandir" ] ; then
76         (
77             cd "${destdir}/$mandir"
78             find . -type f -exec lzip -9 {} +
79             find . -type l | while read -r file
80             do
81                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
82                 rm -- "$file"
83             done
84         )
85     fi
87     # Copy documentation
88     mkdir -p "${destdir}/$docsdir"
89     cp -p $docs "${destdir}/$docsdir"