recipe 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Build recipe for libdatrie.
  2. #
  3. # Copyright (C) 2019 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. program=libdatrie
  17. version=0.2.12
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/libs"
  21. tarname=${program}-${version}.tar.xz
  22. # Remote source(s)
  23. fetch=http://github.com/tlwg/libdatrie/releases/download/v${version}/$tarname
  24. description="
  25. A double-Array Trie library.
  26. libdatrie is an implementation of double-array structure for
  27. representing trie, as proposed by Junichi Aoe. Trie is a
  28. kind of digital search tree, an efficient indexing method with
  29. O(1) time complexity for searching. Comparably as efficient as
  30. hashing, trie also provides flexibility on incremental matching
  31. and key spelling manipulation. This makes it ideal for
  32. lexical analyzers, as well as spelling dictionaries.
  33. See the details of the implementation at:
  34. http://linux.thai.net/~thep/datrie/datrie.html
  35. Historically, this was first implemented as C++ classes in a
  36. library called midatrie, but later simplified and rewritten
  37. from scratch in C.
  38. "
  39. homepage=http://linux.thai.net/projects/datrie
  40. license=LGPLv2.1
  41. # Copy documentation
  42. docs="AUTHORS COPYING ChangeLog NEWS README*"
  43. docsdir="${docdir}/${program}-${version}"
  44. build()
  45. {
  46. set -e
  47. unpack "${tardir}/$tarname"
  48. cd "$srcdir"
  49. # Set sane permissions
  50. chmod -R u+w,go-w,a+rX-s .
  51. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  52. $configure_args \
  53. --libdir=/usr/lib${libSuffix} \
  54. --mandir=$mandir \
  55. --docdir=$docsdir \
  56. --enable-static=yes \
  57. --enable-shared=yes \
  58. --build="$(cc -dumpmachine)"
  59. make -j${jobs} V=1
  60. make -j${jobs} DESTDIR="$destdir" install-strip
  61. # Copy the rest of the documentation
  62. mkdir -p "${destdir}${docsdir}"
  63. cp -p -f $docs "${destdir}${docsdir}"
  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. }