recipe 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.74.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. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. rm -rf BUILD
  46. mkdir BUILD
  47. cd BUILD
  48. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  49. meson setup $configure_args \
  50. --libdir /usr/lib${libSuffix} \
  51. --buildtype=release \
  52. --strip \
  53. ..
  54. ninja -j${jobs}
  55. DESTDIR="$destdir" ninja -j${jobs} install
  56. cd ..
  57. # Compress and link man pages (if needed)
  58. if test -d "${destdir}/$mandir"
  59. then
  60. (
  61. cd "${destdir}/$mandir"
  62. find . -type f -exec lzip -9 {} +
  63. find . -type l | while read -r file
  64. do
  65. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  66. rm -- "$file"
  67. done
  68. )
  69. fi
  70. # Copy documentation
  71. mkdir -p "${destdir}/$docsdir"
  72. cp -p $docs "${destdir}/$docsdir"
  73. }