recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / x-libs / gtk2 / recipe
bloba10132b2f86a433ac21485f16c297968a446e884
1 # Build recipe for GTK+2.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (C) 2018-2019, 2021 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=2.24.33
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=x-libs
28 # Difference package name with other series
29 pkgname=gtk2
31 tarname=${program}-${version}.tar.xz
33 # Remote source(s)
34 fetch="https://download.gnome.org/sources/gtk+/${version%.*}/$tarname"
36 description="
37 A multi-platform toolkit for creating graphical user interfaces.
39 Offering a complete set of widgets, GTK+ is suitable for projects
40 ranging from small one-off projects to complete application suites.
43 homepage=https://www.gtk.org
44 license=GPLv2+
46 # Copy documentation
47 docs="AUTHORS COPYING NEWS README* HACKING"
48 docsdir="${docdir}/${pkgname}-${version}"
50 build()
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
60      $configure_args \
61      --libdir=/usr/lib${libSuffix} \
62      --mandir=$mandir \
63      --enable-static=no \
64      --enable-shared=yes \
65      --enable-debug=no \
66      --enable-introspection=yes \
67      --enable-xkb=yes \
68      --with-xinput=yes \
69      --disable-glibtest \
70      --build="$(gcc -dumpmachine)"
72     make -j${jobs} V=1 \
73      RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false
75     make -j${jobs} \
76      RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false \
77      DESTDIR="$destdir" install-strip
79     # Add a basic configuration
80 cat << EOF > "${destdir}/etc/gtk-2.0/gtkrc"
81 gtk-icon-theme-name = "hicolor"
83 EOF
85     # Manage dot new file(s) via graft(8)
86     touch "${destdir}/etc/gtk-2.0/.graft-config"
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"