recipe 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Build recipe for GTK+2.
  2. #
  3. # Copyright (C) 2018, MMPG <mmpg@vp.pl>
  4. # Copyright (C) 2018-2019, 2021 Matias Fonzo, <selk@dragora.org>.
  5. #
  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
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  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.
  17. # Exit immediately on any error
  18. set -e
  19. program=gtk+
  20. version=2.24.33
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=x-libs
  24. # Difference package name with other series
  25. pkgname=gtk2
  26. tarname=${program}-${version}.tar.xz
  27. # Remote source(s)
  28. fetch="https://download.gnome.org/sources/gtk+/${version%.*}/$tarname"
  29. description="
  30. A multi-platform toolkit for creating graphical user interfaces.
  31. Offering a complete set of widgets, GTK+ is suitable for projects
  32. ranging from small one-off projects to complete application suites.
  33. "
  34. homepage=https://www.gtk.org
  35. license=GPLv2+
  36. # Copy documentation
  37. docs="AUTHORS COPYING NEWS README* HACKING"
  38. docsdir="${docdir}/${pkgname}-${version}"
  39. build()
  40. {
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  46. $configure_args \
  47. --libdir=/usr/lib${libSuffix} \
  48. --mandir=$mandir \
  49. --enable-static=no \
  50. --enable-shared=yes \
  51. --enable-debug=no \
  52. --enable-introspection=yes \
  53. --enable-xkb=yes \
  54. --with-xinput=yes \
  55. --disable-glibtest \
  56. --build="$(gcc -dumpmachine)"
  57. make -j${jobs} V=1 \
  58. RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false
  59. make -j${jobs} \
  60. RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false \
  61. DESTDIR="$destdir" install-strip
  62. # Add a basic configuration
  63. cat << EOF > "${destdir}/etc/gtk-2.0/gtkrc"
  64. gtk-icon-theme-name = "hicolor"
  65. EOF
  66. # Manage dot new file(s) via graft(8)
  67. touch "${destdir}/etc/gtk-2.0/.graft-config"
  68. # Compress and link man pages (if needed)
  69. if test -d "${destdir}/$mandir"
  70. then
  71. (
  72. cd "${destdir}/$mandir"
  73. find . -type f -exec lzip -9 {} +
  74. find . -type l | while read -r file
  75. do
  76. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  77. rm -- "$file"
  78. done
  79. )
  80. fi
  81. # Copy documentation
  82. mkdir -p "${destdir}/$docsdir"
  83. cp -p $docs "${destdir}/$docsdir"
  84. }