recipe 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Build recipe for libxml2.
  2. #
  3. # Copyright (C) 2018, MMPG <mmpg@vp.pl>
  4. # Copyright (C) 2018-2020 Matias 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. program=libxml2
  18. version=2.9.10
  19. release=2
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/libs"
  22. tarname=${program}-${version}.tar.gz
  23. # Remote source(s)
  24. fetch=http://xmlsoft.org/sources/$tarname
  25. description="
  26. A XML C parser library and toolkit.
  27. XML itself is a meta language to design markup languages. HTML is the
  28. most well-known markup language. Though the library is written in C,
  29. a variety of language bindings make it available in other environments.
  30. "
  31. homepage=http://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. set -e
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  45. $configure_args \
  46. --libdir=/usr/lib${libSuffix} \
  47. --mandir=$mandir \
  48. --docdir=$docsdir \
  49. --enable-static=no \
  50. --enable-shared=yes \
  51. --with-python=/usr/bin/python3 \
  52. --with-history \
  53. --with-icu \
  54. --with-threads \
  55. --without-lzma \
  56. --without-iso8859x \
  57. --without-legacy \
  58. --build="$(cc -dumpmachine)" \
  59. ac_cv_path_XSLTPROC=/usr/bin/xsltproc
  60. make -j${jobs} V=1
  61. make -j${jobs} DESTDIR="$destdir" install-strip
  62. # Move python2 documentation directory to be accorded
  63. # with the "libxml2_python2" package
  64. mv "${destdir}${docdir}/libxml2-python-${version}" \
  65. "${destdir}${docdir}/libxml2_python2-${version}"
  66. # Compress and link man pages (if needed)
  67. if test -d "${destdir}/$mandir"
  68. then
  69. (
  70. cd "${destdir}/$mandir"
  71. find . -type f -exec lzip -9 '{}' +
  72. find . -type l | while read -r file
  73. do
  74. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  75. rm -- "$file"
  76. done
  77. )
  78. fi
  79. # Copy documentation
  80. mkdir -p "${destdir}${docsdir}"
  81. cp -p $docs "${destdir}${docsdir}"
  82. }