recipes: Upgrade of dbus, rust, glib2, connman
[dragora.git] / recipes / libs / glib2-pass1 / recipe
blob0f366d8cd3849429c869202e657aece7068133b6
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
18 set -e
20 program=glib
21 version=2.74.1
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=libs
27 # Set a custom name for this package
28 pkgname=glib2-pass1
30 tarname=${program}-${version}.tar.xz
32 # Remote source(s)
33 fetch="https://download.gnome.org/sources/glib/${version%.*}/$tarname"
35 description="
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
45 license=LGPLv2+
47 # Source documentation
48 docs="CODE_OF_CONDUCT.md CONTRIBUTING.md HACKING NEWS README.md SECURITY.md"
49 docsdir="${docdir}/${pkgname}-${version}"
51 build()
53     unpack "${tardir}/$tarname"
55     cd "$srcdir"
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.74.0-skip_warnings-1.patch"
61     # Set sane permissions
62     chmod -R u+w,go-w,a+rX-s .
64     rm -rf BUILD
65     mkdir BUILD
66     cd BUILD
68     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
69     meson setup $configure_args \
70      --libdir /usr/lib${libSuffix} \
71      --buildtype=release \
72      --strip \
73      -Dxattr=true \
74      -Dlibmount=enabled \
75      -Dman=false \
76      -Dgtk_doc=false \
77      -Dselinux=disabled \
78      ..
80     ninja -j${jobs}
81     DESTDIR="$destdir" ninja -j${jobs} install
83     cd ..
85     # Delete generated charset.alias
86     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
88     # Compress and link man pages (if needed)
89     if test -d "${destdir}/$mandir"
90     then
91         (
92             cd "${destdir}/$mandir"
93             find . -type f -exec lzip -9 {} +
94             find . -type l | while read -r file
95             do
96                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
97                 rm -- "$file"
98             done
99         )
100     fi
102     # Copy documentation
103     mkdir -p "${destdir}/$docsdir"
104     cp -p $docs "${destdir}/$docsdir"