recipe 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Build recipe for libxslt.
  2. #
  3. # Copyright (C) 2018-2021 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=libxslt
  19. version=1.1.34
  20. release=4
  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=http://xmlsoft.org/sources/$tarname
  26. description="
  27. XSLT support for libxml2.
  28. The libxslt package contains XSLT libraries. These are useful for
  29. extending libxml2 libraries in order to support XSLT files.
  30. "
  31. homepage=https://xmlsoft.org
  32. license=MIT
  33. docs="AUTHORS ChangeLog Copyright NEWS README TODO"
  34. docsdir="${docdir}/${program}-${version}"
  35. # The source has a custom directory
  36. srcdir="${program}-${version%-*}"
  37. build()
  38. {
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Set sane permissions
  42. chmod -R u+w,go-w,a+rX-s .
  43. # This increases the recursion limit. This is
  44. # needed by some packages for their documentation
  45. sed -e 's/3000/5000/' \
  46. -i libxslt/transform.c doc/xsltproc.1 doc/xsltproc.xml
  47. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  48. $configure_args \
  49. --libdir=/usr/lib${libSuffix} \
  50. --mandir=$mandir \
  51. --docdir=$docsdir \
  52. --enable-static=no \
  53. --enable-shared=yes \
  54. --with-python=/usr/bin/python3 \
  55. --build="$(gcc -dumpmachine)"
  56. make -j${jobs} V=1
  57. make -j${jobs} DESTDIR="$destdir" install-strip
  58. # Compress and link man pages (if needed)
  59. if test -d "${destdir}/$mandir"
  60. then
  61. (
  62. cd "${destdir}/$mandir"
  63. find . -type f -exec lzip -9 {} +
  64. find . -type l | while read -r file
  65. do
  66. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  67. rm -- "$file"
  68. done
  69. )
  70. fi
  71. # Copy documentation
  72. mkdir -p "${destdir}/$docsdir"
  73. cp -p $docs "${destdir}/$docsdir"
  74. }