1 # Build recipe for glib (release 2, pass 1).
3 # Copyright (c) 2020-2022 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 # Exit immediately on any error
24 # Define a category for the output of the package name
27 # Set a custom name for this package
30 tarname=${program}-${version}.tar.xz
33 fetch="https://download.gnome.org/sources/glib/${version%.*}/$tarname"
36 General purpose library of C routines.
38 GLib is the low-level core library that forms the basis for projects
39 such as GTK+ and GNOME. It provides data structure handling for C,
40 portability wrappers, and interfaces for such runtime functionality
41 as an event loop, threads, dynamic loading, and an object system.
44 homepage=https://wiki.gnome.org/Projects/GLib
47 # Source documentation
48 docs="AUTHORS COPYING HACKING NEWS README"
49 docsdir="${docdir}/${pkgname}-${version}"
53 unpack "${tardir}/$tarname"
57 # Apply patch from "Beyond Linux From Scratch" to support 'GLIB_LOG_LEVEL'
58 # which enables several warnings levels (Thank you!)
59 patch -Np1 -i "${worktree}/patches/glib2/glib-2.70.2-skip_warnings-1.patch"
61 # Set sane permissions
62 chmod -R u+w,go-w,a+rX-s .
68 CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
69 meson setup $configure_args \
70 --libdir /usr/lib${libSuffix} \
83 DESTDIR="$destdir" ninja -j${jobs} install
87 # Delete generated charset.alias
88 rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
90 # Compress and link man pages (if needed)
91 if test -d "${destdir}/$mandir"
94 cd "${destdir}/$mandir"
95 find . -type f -exec lzip -9 {} +
96 find . -type l | while read -r file
98 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
105 mkdir -p "${destdir}${docsdir}"
106 cp -p $docs "${destdir}${docsdir}"