recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / x-libs / freetype / recipe
blob42565ecffec6f00565a8481bba0ad05a121a27db
1 # Recipe file for freetype.
3 # Copyright (c) 2017 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
4 # Copyright (c) 2017-2018, 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=freetype
22 version=2.11.1
23 release=1
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=freetype-pass1
31 tarname=${program}-${version}.tar.gz
33 # Remote source(s)
34 fetch=https://download.savannah.gnu.org/releases/freetype/$tarname
36 description="
37 A font engine.
39 FreeType is a software font engine that is designed to be small,
40 efficient, highly customizable, and portable while capable of
41 producing high-quality output (glyph images).  It can be used in
42 graphics libraries, display servers, font conversion tools,
43 text image generation tools, and many other products as well.
46 homepage=https://www.freetype.org/
47 license="GPLv2 | FreeType License (FTL)"
49 # Source documentation
50 docs="ChangeLog* README*"
51 docsdir="${docdir}/${program}-${version}"
53 build() {
54     unpack "${tardir}/$tarname"
56     cd "$srcdir"
58     # Set sane permissions
59     chmod -R u+w,go-w,a+rX-s .
61     ./configure CPPFLAGS="$QICPPFLAGS" \
62     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
63      $configure_args \
64      --libdir=/usr/lib${libSuffix} \
65      --mandir=$mandir \
66      --docdir=$docsdir \
67      --disable-static \
68      --enable-shared \
69      --with-bzip2=yes \
70      --with-zlib=yes \
71      --with-png=yes \
72      --with-harfbuzz=yes \
73      --build="$(gcc -dumpmachine)" \
74      ac_cv_prog_RC= ac_cv_prog_ac_ct_RC=
76     make -j${jobs} V=1
77     make -j${jobs} DESTDIR="$destdir" install
79     # Strip remaining binaries and libraries
80     find "$destdir" -type f | xargs file | \
81      awk '/ELF/ && /executable/ || /shared object/' | \
82       cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
84     # Compress manual pages
85     if [ -d "${destdir}/$mandir" ] ; then
86         (
87             cd "${destdir}/$mandir"
88             find . -type f -exec lzip -9 {} +
89             find . -type l | while read -r file
90             do
91                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
92                 rm -- "$file"
93             done
94         )
95     fi
97     # Copy documentation
98     mkdir -p "${destdir}/$docsdir"
99     cp -p $docs "${destdir}/$docsdir"