recipe 3.0 KB

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