recipe 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Build recipe for mtdev.
  2. #
  3. # Copyright (c) 2017 Mateus P. Rodrigues, <mprodrigues@dragora.org>.
  4. # Copyright (c) 2021 Matias A. 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=mtdev
  20. version=1.1.6
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=libs
  24. tarname=${program}-${version}.tar.bz2
  25. # Remote source(s)
  26. fetch=https://bitmath.org/code/mtdev/$tarname
  27. description="
  28. Multitouch Protocol Translation Library.
  29. The mtdev is a stand-alone library which transforms all variants of
  30. kernel MT events to the slotted type B protocol. The events put into
  31. mtdev may be from any MT device, specifically type A without contact
  32. tracking, type A with contact tracking, or type B with contact
  33. tracking. See the kernel documentation for further details.
  34. "
  35. homepage=https://bitmath.org/code/mtdev/
  36. license=MIT
  37. # Source documentation
  38. docs="COPYING ChangeLog README"
  39. docsdir="${docdir}/${pkgname}-${version}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # Update for several hosts (including Musl)
  45. cp -f "${worktree}/archive/common/config.guess" config-aux/config.guess
  46. cp -f "${worktree}/archive/common/config.sub" config-aux/config.sub
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --docdir=$docsdir \
  53. --infodir=$infodir \
  54. --mandir=$mandir \
  55. --build="$(gcc -dumpmachine)"
  56. make -j${jobs} V=1
  57. make -j${jobs} DESTDIR="$destdir" install-strip
  58. # Compress info documents deleting index file for the package
  59. if test -d "${destdir}/$infodir"
  60. then
  61. rm -f "${destdir}/${infodir}/dir"
  62. lzip -9 "${destdir}/${infodir}"/*
  63. fi
  64. # Compress and link man pages (if needed)
  65. if test -d "${destdir}/$mandir"
  66. then
  67. (
  68. cd "${destdir}/$mandir"
  69. find . -type f -exec lzip -9 {} +
  70. find . -type l | while read -r file
  71. do
  72. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  73. rm -- "$file"
  74. done
  75. )
  76. fi
  77. # Copy documentation
  78. mkdir -p "${destdir}/$docsdir"
  79. cp -p $docs "${destdir}/$docsdir"
  80. }