recipe 2.5 KB

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