recipe 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Build recipe for glib (release 2, pass 1).
  2. #
  3. # Copyright (c) 2020-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-pass1
  25. tarname=${program}-${version}.tar.xz
  26. # Remote source(s)
  27. fetch="https://download.gnome.org/sources/glib/${version%.*}/$tarname"
  28. description="
  29. General purpose library of C routines.
  30. GLib is the low-level core library that forms the basis for projects
  31. such as GTK+ and GNOME. It provides data structure handling for C,
  32. portability wrappers, and interfaces for such runtime functionality
  33. as an event loop, threads, dynamic loading, and an object system.
  34. "
  35. homepage=https://wiki.gnome.org/Projects/GLib
  36. license=LGPLv2.1
  37. # Source documentation
  38. docs="AUTHORS COPYING HACKING NEWS README"
  39. docsdir="${docdir}/${pkgname}-${version}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Apply patch from "Beyond Linux From Scratch" to support 'GLIB_LOG_LEVEL'
  45. # which enables several warnings levels (Thank you!)
  46. patch -Np1 -i "${worktree}/patches/glib2/glib-2.70.2-skip_warnings-1.patch"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. rm -rf BUILD
  50. mkdir BUILD
  51. cd BUILD
  52. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  53. meson setup $configure_args \
  54. --libdir /usr/lib${libSuffix} \
  55. --buildtype=release \
  56. --strip \
  57. -Diconv=auto \
  58. -Dxattr=true \
  59. -Dlibmount=enabled \
  60. -Dman=false \
  61. -Dgtk_doc=false \
  62. -Dfam=false \
  63. -Dselinux=disabled \
  64. ..
  65. ninja -j${jobs}
  66. DESTDIR="$destdir" ninja -j${jobs} install
  67. cd ..
  68. # Delete generated charset.alias
  69. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  70. # Compress and link man pages (if needed)
  71. if test -d "${destdir}/$mandir"
  72. then
  73. (
  74. cd "${destdir}/$mandir"
  75. find . -type f -exec lzip -9 {} +
  76. find . -type l | while read -r file
  77. do
  78. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  79. rm -- "$file"
  80. done
  81. )
  82. fi
  83. # Copy documentation
  84. mkdir -p "${destdir}/$docsdir"
  85. cp -p $docs "${destdir}/$docsdir"
  86. }