Start mass upgrade
[dragora.git] / recipes / libs / glib2-pass1 / recipe
blobed94e9be47401b95390cc0f4507e12ab26283d7b
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.70.2
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.1
47 # Source documentation
48 docs="AUTHORS COPYING HACKING NEWS README"
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.70.2-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      -Diconv=auto \
74      -Dxattr=true \
75      -Dlibmount=enabled \
76      -Dman=false \
77      -Dgtk_doc=false \
78      -Dfam=false \
79      -Dselinux=disabled \
80      ..
82     ninja -j${jobs}
83     DESTDIR="$destdir" ninja -j${jobs} install
85     cd ..
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"
92     then
93         (
94             cd "${destdir}/$mandir"
95             find . -type f -exec lzip -9 {} +
96             find . -type l | while read -r file
97             do
98                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99                 rm -- "$file"
100             done
101         )
102     fi
104     # Copy documentation
105     mkdir -p "${destdir}${docsdir}"
106     cp -p $docs "${destdir}${docsdir}"