recipe 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Build recipe for GObject Introspection.
  2. #
  3. # Copyright (C) 2018, MMPG <mmpg@vp.pl>
  4. # Copyright (C) 2018-2019, 2021-2022 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=gobject-introspection
  20. version=1.70.0
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=x-libs
  24. tarname=${program}-${version}.tar.xz
  25. # Remote source(s)
  26. fetch="https://download.gnome.org/sources/gobject-introspection/${version%.*}/$tarname"
  27. description="
  28. A layer between C libraries (using GObject) and language bindings.
  29. GObject Introspection is a project for providing machine readable
  30. introspection data of the API of C libraries. This introspection data
  31. can be used for automatic code generation for bindings, API
  32. verification, and documentation generation.
  33. "
  34. homepage=https://wiki.gnome.org/Projects/GObjectIntrospection/
  35. license="GPLv2+ | LGPLv2+, some MIT code in giscanner/"
  36. # Copy documentation
  37. docs="COPYING* NEWS TODO"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. # Apply a patch that allows building with Meson version 0.61 or above
  44. # Thanks to "Beyond Linux From Scratch"
  45. patch -Np1 -i "${worktree}/patches/gobject-introspection/gobject-introspection-1.70.0-build_fix-1.patch"
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. rm -rf BUILD
  49. mkdir BUILD
  50. cd BUILD
  51. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  52. meson setup $configure_args \
  53. --libdir /usr/lib${libSuffix} \
  54. --buildtype=release \
  55. --strip \
  56. ..
  57. ninja -j${jobs}
  58. DESTDIR="$destdir" ninja -j${jobs} install
  59. cd ..
  60. # Compress and link man pages (if needed)
  61. if test -d "${destdir}/$mandir"
  62. then
  63. (
  64. cd "${destdir}/$mandir"
  65. find . -type f -exec lzip -9 {} +
  66. find . -type l | while read -r file
  67. do
  68. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  69. rm -- "$file"
  70. done
  71. )
  72. fi
  73. # Copy documentation
  74. mkdir -p "${destdir}/$docsdir"
  75. cp -p $docs "${destdir}/$docsdir"
  76. }