1 # Build recipe for glib (release 2).
3 # Copyright (c) 2017-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 # The installation of this package replaces to
33 tarname=${program}-${version}.tar.xz
36 fetch="https://download.gnome.org/sources/glib/${version%.*}/$tarname"
39 General purpose library of C routines.
41 GLib is the low-level core library that forms the basis for projects
42 such as GTK+ and GNOME. It provides data structure handling for C,
43 portability wrappers, and interfaces for such runtime functionality
44 as an event loop, threads, dynamic loading, and an object system.
47 homepage=https://wiki.gnome.org/Projects/GLib
50 # Source documentation
51 docs="AUTHORS COPYING HACKING NEWS README"
52 docsdir="${docdir}/${pkgname}-${version}"
56 unpack "${tardir}/$tarname"
60 # Apply patch from "Beyond Linux From Scratch" to support 'GLIB_LOG_LEVEL'
61 # which enables several warnings levels (Thank you!)
62 patch -Np1 -i "${worktree}/patches/glib2/glib-2.70.2-skip_warnings-1.patch"
64 # Set sane permissions
65 chmod -R u+w,go-w,a+rX-s .
71 CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
72 meson setup $configure_args \
73 --libdir /usr/lib${libSuffix} \
86 DESTDIR="$destdir" ninja -j${jobs} install
90 # Delete generated charset.alias
91 rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
93 # Include profile file
94 mkdir -p "${destdir}/etc/profile.d"
95 cp -p "${worktree}/archive/glib2/etc/profile.d/glib2.sh" \
96 "${destdir}/etc/profile.d/"
97 chmod 644 "${destdir}/etc/profile.d/glib2.sh"
99 # To handle config file(s)
100 touch "${destdir}/etc/profile.d/.graft-config"
102 # Compress and link man pages (if needed)
103 if test -d "${destdir}/$mandir"
106 cd "${destdir}/$mandir"
107 find . -type f -exec lzip -9 {} +
108 find . -type l | while read -r file
110 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
117 mkdir -p "${destdir}/$docsdir"
118 cp -p $docs "${destdir}/$docsdir"