strip remaining libraries for the distribution size
[dragora.git] / recipes / libs / glib2 / recipe
blobc846685e4c6bbf546f2159dd00b03943acc04acb
1 # Build recipe for glib (release 2).
3 # Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=glib
18 version=2.54.2
19 short_version=2.54
20 release=1
22 pkgname=glib2
24 tarname=${program}-${version}.tar.xz
26 # Remote source(s)
27 fetch=http://download.gnome.org/sources/glib/${short_version}/$tarname
29 description="
30 General purpose library of C routines.
32 GLib is the low-level core library that forms the basis for projects
33 such as GTK+ and GNOME. It provides data structure handling for C,
34 portability wrappers, and interfaces for such runtime functionality
35 as an event loop, threads, dynamic loading, and an object system.
38 homepage=http://wiki.gnome.org/Projects/GLib
39 license=LGPLv2.1
41 # Source documentation
42 docs="AUTHORS COPYING ChangeLog HACKING NEWS README README.commits"
43 docsdir="${docdir}/${program}-${version}"
45 build()
47     set -e
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
54      $configure_args \
55      --libdir=/usr/lib${libSuffix} \
56      --infodir=$infodir \
57      --mandir=$mandir \
58      --docdir=$docsdir \
59      --enable-static \
60      --enable-shared \
61      --enable-debug=no \
62      --with-threads=posix \
63      --with-pcre=system \
64      --with-python=/usr/bin/python3 \
65      --build="$(cc -dumpmachine)"
67     make -j${jobs} V=1
68     make -j${jobs} DESTDIR="$destdir" install-strip
70     # Compress info documents deleting index file for the package
71     if test -d "${destdir}/$infodir"
72     then
73         rm -f "${destdir}/${infodir}/dir"
74         lzip -9 "${destdir}/${infodir}"/*
75     fi
77     # Compress and link man pages (if needed)
78     if test -d "${destdir}/$mandir"
79     then
80         (
81             cd "${destdir}/$mandir"
82             find . -type f -exec lzip -9 '{}' +
83             find . -type l | while read -r file
84             do
85                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
86                 rm -- "$file"
87             done
88         )
89     fi
91     # Copy documentation
92     mkdir -p "${destdir}${docsdir}"
93     cp -p $docs "${destdir}${docsdir}"