recipe 3.1 KB

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