recipe 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Build recipe for libunistring.
  2. #
  3. # Copyright (c) 2018 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=libunistring
  17. version=0.9.10
  18. release=1
  19. # Set 'outdir' for a nice and well-organized output directory
  20. outdir="${outdir}/${arch}/libs"
  21. tarname=${program}-${version}.tar.gz
  22. # Remote source(s)
  23. fetch=http://ftp.gnu.org/gnu/libunistring/$tarname
  24. description="
  25. A library that provides functions for manipulating Unicode strings.
  26. Text files are nowadays usually encoded in Unicode, and may consist of
  27. very different scripts from Latin letters to Chinese Hanzi, with many
  28. kinds of special characters accents, right-to-left writing marks,
  29. hyphens, Roman numbers, and much more. But the POSIX platform APIs for
  30. text do not contain adequate functions for dealing with particular
  31. properties of many Unicode characters. In fact, the POSIX APIs for
  32. text have several assumptions at their base which don't hold for
  33. Unicode text.
  34. This library provides functions for manipulating Unicode strings and
  35. for manipulating C strings according to the Unicode standard.
  36. "
  37. homepage=http://www.gnu.org/software/libunistring/
  38. license="GPLv3+, LGPLv3+"
  39. # Source documentation
  40. docs="AUTHORS BUGS COPYING* HACKING NEWS README THANKS"
  41. docsdir="${docdir}/${program}-${version}"
  42. build()
  43. {
  44. set -e
  45. unpack "${tardir}/$tarname"
  46. cd "$srcdir"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  50. $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --infodir=$infodir \
  53. --mandir=$mandir \
  54. --docdir=$docsdir \
  55. --enable-static=no \
  56. --enable-shared=yes \
  57. --enable-threads=posix \
  58. --build="$(cc -dumpmachine)"
  59. make -j${jobs} V=1
  60. make -j${jobs} DESTDIR="$destdir" install-strip
  61. # Delete generated charset.alias
  62. rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
  63. rmdir "${destdir}/usr/lib${libSuffix}/" 2> /dev/null || true
  64. # Compress info documents deleting index file for the package
  65. if test -d "${destdir}/$infodir"
  66. then
  67. rm -f "${destdir}/${infodir}/dir"
  68. lzip -9 "${destdir}/${infodir}"/*
  69. fi
  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. }