qi: Bump to release candidate 2.10-rc6
[dragora.git] / recipes / x-libs / gobject-introspection / recipe
blob22a7a5cc9c979d5cf5f606a634120a28ac3b8ab4
1 # Build recipe for GObject Introspection.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=gobject-introspection
22 version=1.70.0
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=x-libs
28 tarname=${program}-${version}.tar.xz
30 # Remote source(s)
31 fetch="https://download.gnome.org/sources/gobject-introspection/${version%.*}/$tarname"
33 description="
34 A layer between C libraries (using GObject) and language bindings.
36 GObject Introspection is a project for providing machine readable
37 introspection data of the API of C libraries.  This introspection data
38 can be used for automatic code generation for bindings, API
39 verification, and documentation generation.
42 homepage=https://wiki.gnome.org/Projects/GObjectIntrospection/
43 license="GPLv2+ | LGPLv2+, some MIT code in giscanner/"
45 # Copy documentation
46 docs="COPYING* NEWS TODO"
47 docsdir="${docdir}/${program}-${version}"
49 build()
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # Apply a patch that allows building with Meson version 0.61 or above
56     # Thanks to "Beyond Linux From Scratch"
57     patch -Np1 -i "${worktree}/patches/gobject-introspection/gobject-introspection-1.70.0-build_fix-1.patch"
59     # Set sane permissions
60     chmod -R u+w,go-w,a+rX-s .
62     rm -rf BUILD
63     mkdir BUILD
64     cd BUILD
66     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
67     meson setup $configure_args \
68      --libdir /usr/lib${libSuffix} \
69      --buildtype=release \
70      --strip \
71      ..
73     ninja -j${jobs}
74     DESTDIR="$destdir" ninja -j${jobs} install
76     cd ..
78     # Compress and link man pages (if needed)
79     if test -d "${destdir}/$mandir"
80     then
81         (
82             cd "${destdir}/$mandir"
83             find . -type f -exec lzip -9 {} +
84             find . -type l | while read -r file
85             do
86                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
87                 rm -- "$file"
88             done
89         )
90     fi
92     # Copy documentation
93     mkdir -p "${destdir}/$docsdir"
94     cp -p $docs "${destdir}/$docsdir"