recipe 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # Build recipe for glib (release 2).
  2. #
  3. # Copyright (c) 2017-2022 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Exit immediately on any error
  17. set -e
  18. program=glib
  19. version=2.70.2
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=libs
  23. # Set a custom name for this package
  24. pkgname=glib2
  25. # The installation of this package replaces to
  26. replace=glib2-pass1
  27. tarname=${program}-${version}.tar.xz
  28. # Remote source(s)
  29. fetch="https://download.gnome.org/sources/glib/${version%.*}/$tarname"
  30. description="
  31. General purpose library of C routines.
  32. GLib is the low-level core library that forms the basis for projects
  33. such as GTK+ and GNOME. It provides data structure handling for C,
  34. portability wrappers, and interfaces for such runtime functionality
  35. as an event loop, threads, dynamic loading, and an object system.
  36. "
  37. homepage=https://wiki.gnome.org/Projects/GLib
  38. license=LGPLv2.1
  39. # Source documentation
  40. docs="AUTHORS COPYING HACKING NEWS README"
  41. docsdir="${docdir}/${pkgname}-${version}"
  42. build()
  43. {
  44. unpack "${tardir}/$tarname"
  45. cd "$srcdir"
  46. # Apply patch from "Beyond Linux From Scratch" to support 'GLIB_LOG_LEVEL'
  47. # which enables several warnings levels (Thank you!)
  48. patch -Np1 -i "${worktree}/patches/glib2/glib-2.70.2-skip_warnings-1.patch"
  49. # Set sane permissions
  50. chmod -R u+w,go-w,a+rX-s .
  51. rm -rf BUILD
  52. mkdir BUILD
  53. cd BUILD
  54. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  55. meson setup $configure_args \
  56. --libdir /usr/lib${libSuffix} \
  57. --buildtype=release \
  58. --strip \
  59. -Diconv=auto \
  60. -Dxattr=true \
  61. -Dlibmount=enabled \
  62. -Dman=true \
  63. -Dgtk_doc=false \
  64. -Dfam=false \
  65. -Dselinux=disabled \
  66. ..
  67. ninja -j${jobs}
  68. DESTDIR="$destdir" ninja -j${jobs} install
  69. cd ..
  70. # Delete generated charset.alias
  71. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  72. # Include profile file
  73. mkdir -p "${destdir}/etc/profile.d"
  74. cp -p "${worktree}/archive/glib2/etc/profile.d/glib2.sh" \
  75. "${destdir}/etc/profile.d/"
  76. chmod 644 "${destdir}/etc/profile.d/glib2.sh"
  77. # To handle config file(s)
  78. touch "${destdir}/etc/profile.d/.graft-config"
  79. # Compress and link man pages (if needed)
  80. if test -d "${destdir}/$mandir"
  81. then
  82. (
  83. cd "${destdir}/$mandir"
  84. find . -type f -exec lzip -9 {} +
  85. find . -type l | while read -r file
  86. do
  87. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  88. rm -- "$file"
  89. done
  90. )
  91. fi
  92. # Copy documentation
  93. mkdir -p "${destdir}/$docsdir"
  94. cp -p $docs "${destdir}/$docsdir"
  95. }