libxml2_2.14.6.bb 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. SUMMARY = "XML C Parser Library and Toolkit"
  2. DESCRIPTION = "The XML Parser Library allows for manipulation of XML files. Libxml2 exports Push and Pull type parser interfaces for both XML and HTML. It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD. Libxml2 includes complete XPath, XPointer and Xinclude implementations. It also has a SAX like interface, which is designed to be compatible with Expat."
  3. HOMEPAGE = "https://gitlab.gnome.org/GNOME/libxml2"
  4. BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2"
  5. SECTION = "libs"
  6. LICENSE = "MIT"
  7. LIC_FILES_CHKSUM = "file://Copyright;md5=5873615e8a9ecbf5c8857c4312ee05d6 \
  8. file://dict.c;beginline=6;endline=15;md5=2b4b7b827d2d8b080372433c4c9c85b6 \
  9. file://list.c;beginline=4;endline=13;md5=b9c25b021ccaf287e50060602d20f3a7 \
  10. "
  11. DEPENDS = "zlib virtual/libiconv"
  12. GNOMEBASEBUILDCLASS = "autotools"
  13. inherit gnomebase
  14. SRC_URI += "http://www.w3.org/XML/Test/xmlts20130923.tar;subdir=${BP};name=testtar \
  15. file://run-ptest \
  16. file://install-tests.patch \
  17. file://0001-Revert-cmake-Fix-installation-directories-in-libxml2.patch \
  18. file://CVE-2025-6021.patch \
  19. "
  20. SRC_URI[archive.sha256sum] = "7ce458a0affeb83f0b55f1f4f9e0e55735dbfc1a9de124ee86fb4a66b597203a"
  21. SRC_URI[testtar.sha256sum] = "c6b2d42ee50b8b236e711a97d68e6c4b5c8d83e69a2be4722379f08702ea7273"
  22. CVE_STATUS[CVE-2025-6170] = "fixed-version: fixed in version 2.14.5"
  23. BINCONFIG = "${bindir}/xml2-config"
  24. PACKAGECONFIG ??= "python"
  25. PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3"
  26. inherit autotools pkgconfig binconfig-disabled ptest
  27. inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
  28. LDFLAGS:append:riscv64 = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld ptest', ' -fuse-ld=bfd', '', d)}"
  29. RDEPENDS:${PN}-ptest += "bash make locale-base-en-us ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-logging python3-shell python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
  30. RDEPENDS:${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
  31. RDEPENDS:${PN}-ptest:append:libc-musl = " musl-locales"
  32. RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-gconv-ebcdic-us \
  33. glibc-gconv-ibm1141 \
  34. glibc-gconv-iso8859-5 \
  35. glibc-gconv-euc-jp \
  36. "
  37. # WARNING: zlib is required for RPM use
  38. EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --with-c14n --without-lzma"
  39. EXTRA_OECONF:class-native = "--without-legacy --with-c14n --without-lzma --with-zlib"
  40. EXTRA_OECONF:class-nativesdk = "--without-legacy --with-c14n --without-lzma --with-zlib"
  41. EXTRA_OECONF:linuxstdbase = "--with-debug --with-legacy --with-c14n --without-lzma --with-zlib"
  42. python populate_packages:prepend () {
  43. # autonamer would call this libxml2-2, but we don't want that
  44. if d.getVar('DEBIAN_NAMES'):
  45. d.setVar('PKG:libxml2', '${MLPREFIX}libxml2')
  46. }
  47. PACKAGE_BEFORE_PN += "${PN}-utils"
  48. PACKAGES += "${PN}-python"
  49. FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
  50. FILES:${PN}-utils = "${bindir}/*"
  51. FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
  52. do_configure:prepend () {
  53. # executables take longer to package: these should not be executable
  54. find ${S}/xmlconf/ -type f -exec chmod -x {} \+
  55. }
  56. do_install_ptest () {
  57. oe_runmake DESTDIR=${D} ptestdir=${PTEST_PATH} install-test-data
  58. cp -r ${S}/xmlconf ${D}${PTEST_PATH}
  59. if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
  60. rm -rf ${D}${PTEST_DIR}/python
  61. fi
  62. }
  63. # with musl we need to enable icu support explicitly for these tests
  64. do_install_ptest:append:libc-musl () {
  65. rm -rf ${D}/${PTEST_PATH}/test/icu_parse_test.xml
  66. }
  67. do_install:append:class-native () {
  68. # Docs are not needed in the native case
  69. rm ${D}${datadir}/gtk-doc -rf
  70. create_wrapper ${D}${bindir}/xmllint 'XML_CATALOG_FILES=${XML_CATALOG_FILES:-${sysconfdir}/xml/catalog}'
  71. }
  72. do_install[vardepsexclude] += "XML_CATALOG_FILES:-${sysconfdir}/xml/catalog"
  73. BBCLASSEXTEND = "native nativesdk"