recipes: simplify package names for the produced GTK packages
[dragora.git] / recipes / x-libs / gtk3 / recipe
blobbbd49c69d705c40a5cbfb5e64ebb2c0cd189ebce
1 # Build recipe for GTK+3.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018-2019, 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 program=gtk+
19 version=3.24.5
20 release=1
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/x-libs"
25 # Difference package name with other series
26 pkgname=gtk3
28 tarname=${program}-${version}.tar.xz
30 # Remote source(s)
31 fetch=http://ftp.gnome.org/pub/gnome/sources/gtk+/3.24/$tarname
33 description="
34 The version 3 of the GTK+ toolkit.
36 The GTK+3 package contains libraries used for creating graphical user
37 interfaces for applications.
40 homepage=http://www.gtk.org
41 license=GPLv2+
43 # Copy documentation
44 docs="AUTHORS COPYING NEWS README* HACKING"
45 docsdir="${docdir}/${pkgname}-${version}"
47 build()
49     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
58      $configure_args \
59      --libdir=/usr/lib${libSuffix} \
60      --mandir=$mandir \
61      --enable-static=no \
62      --enable-shared=yes \
63      --enable-introspection=yes \
64      --enable-xkb=yes \
65      --enable-xinerama=yes \
66      --enable-xrandr=yes \
67      --enable-xfixes=yes \
68      --enable-xcomposite=yes \
69      --enable-xdamage=yes \
70      --enable-explicit-deps=yes \
71      --enable-broadway-backend \
72      --enable-x11-backend \
73      --disable-schemas-compile \
74      --disable-glibtest \
75      --build="$(cc -dumpmachine)"
77     make -j${jobs} V=1 \
78      RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false
80     make -j${jobs} \
81      RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false \
82      DESTDIR="$destdir" install-strip
84     # Add a basic configuration
85 cat << EOF > "${destdir}/etc/gtk-3.0/gtkrc"
86 gtk-theme-name = "Adwaita"
88 EOF
90     # Manage dot new file(s) via graft(8)
91     touch "${destdir}/etc/gtk-3.0/.graft-config"
93     # Compress and link man pages (if needed)
94     if test -d "${destdir}/$mandir"
95     then
96         (
97             cd "${destdir}/$mandir"
98             find . -type f -exec lzip -9 '{}' +
99             find . -type l | while read -r file
100             do
101                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
102                 rm -- "$file"
103             done
104         )
105     fi
107     # Copy documentation
108     mkdir -p "${destdir}${docsdir}"
109     cp -p $docs "${destdir}${docsdir}"