recipe 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Build recipe for libxkbcommon.
  2. #
  3. # Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
  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=libxkbcommon
  20. version=1.3.1
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=xorg_extra
  24. tarname=${program}-${version}.tar.xz
  25. # Remote source(s)
  26. fetch=https://xkbcommon.org/download/$tarname
  27. description="
  28. xkbcommon is a library to handle keyboard descriptions.
  29. Including loading them from disk, parsing them and handling their
  30. state. It's mainly meant for client toolkits, window systems,
  31. and other system applications; currently that includes Wayland,
  32. kmscon, GTK+, Clutter, and others.
  33. "
  34. homepage=https://xkbcommon.org/
  35. license="Custom (derivations from MIT/X11 license)"
  36. # Source documentation
  37. docs="LICENSE NEWS README.md"
  38. docsdir="${docdir}/${program}-${version}"
  39. build()
  40. {
  41. unpack "${tardir}/$tarname"
  42. cd "$srcdir"
  43. rm -rf BUILD
  44. mkdir BUILD
  45. cd BUILD
  46. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  47. meson setup $configure_args \
  48. --libdir /usr/lib${libSuffix} \
  49. --buildtype=release \
  50. --strip \
  51. -Denable-docs=false \
  52. -Denable-wayland=false \
  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. }