qi: Bump to release 2.12
[dragora.git] / recipes / x-libs / gtk3 / recipe
blob5c74e77ac5ec7fc7e1b8ce28a10d82faea870e4e
1 # Build recipe for GTK+3.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018-2019, 2021-2023 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=gtk+
22 version=3.24.36
23 release=2
25 # Define a category for the output of the package name
26 pkgcategory=x-libs
28 # Difference package name with other series
29 pkgname=gtk3
31 tarname=${program}-${version}.tar.xz
33 # Remote source(s)
34 fetch="
35   https://ftp.gnome.org/pub/gnome/sources/gtk+/${version%.*}/$tarname
36   ftp://ftp.acc.umu.se/pub/gnome/sources/gtk+/${version%.*}/$tarname
39 description="
40 The version 3 of the GTK+ toolkit.
42 The GTK+3 package contains libraries used for creating graphical
43 user interfaces for applications.
46 homepage=https://www.gtk.org
47 license=GPLv2+
49 # Copy documentation
50 docs="CONTRIBUTING.md COPYING NEWS README.md"
51 docsdir="${docdir}/${pkgname}-${version}"
53 build()
55     unpack "${tardir}/$tarname"
57     cd "$srcdir"
59     # Set sane permissions
60     chmod -R u+w,go-w,a+rX-s .
62     # Set default backends, detect CUPS
63     print_backends=file,lpr
65     if type cupsd
66     then
67         print_backends=file,lpr,cups
68     fi
70     rm -rf BUILD
71     mkdir BUILD
72     cd BUILD
74     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
75     meson setup $configure_args \
76      --libdir=lib${libSuffix} \
77      --mandir=$mandir \
78      --buildtype=release \
79      --strip \
80      -Dcolord=no \
81      -Dgtk_doc=false \
82      -Dman=true \
83      -Dx11_backend=true \
84      -Dbroadway_backend=true \
85      -Dwayland_backend=false \
86      -Dxinerama=yes \
87      -Dprint_backends="$print_backends" \
88      ..
90     unset -v print_backends
91     ninja -j${jobs}
92     DESTDIR="$destdir" ninja -j${jobs} install
94     cd ..
96     # Add a basic configuration
97 cat << EOF > "${destdir}/etc/gtk-3.0/gtkrc"
98 gtk-theme-name = "gnome"
102     # Manage dot new file(s) via graft(8)
103     touch "${destdir}/etc/gtk-3.0/.graft-config"
105     # Compress and link man pages (if needed)
106     if test -d "${destdir}/$mandir"
107     then
108         (
109             cd "${destdir}/$mandir"
110             find . -type f -exec lzip -9 {} +
111             find . -type l | while read -r file
112             do
113                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
114                 rm -- "$file"
115             done
116         )
117     fi
119     # Copy documentation
120     mkdir -p "${destdir}/$docsdir"
121     cp -p $docs "${destdir}/$docsdir"