You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=python-lxml
  9. PKG_VERSION:=4.4.1
  10. PKG_RELEASE:=1
  11. PYPI_NAME:=lxml
  12. PKG_HASH:=c81cb40bff373ab7a7446d6bbca0190bccc5be3448b47b51d729e37799bb5692
  13. PKG_LICENSE:=BSD
  14. PKG_LICENSE_FILES:=LICENSES.txt
  15. PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  16. PKG_CPE_ID:=cpe:/a:lxml:lxml
  17. include ../pypi.mk
  18. include $(INCLUDE_DIR)/package.mk
  19. include ../python-package.mk
  20. include ../python3-package.mk
  21. define Package/python-lxml/Default
  22. SECTION:=lang
  23. CATEGORY:=Languages
  24. SUBMENU:=Python
  25. URL:=https://lxml.de
  26. DEPENDS:=+libxml2 +libxslt +libexslt
  27. endef
  28. define Package/python-lxml
  29. $(call Package/python-lxml/Default)
  30. TITLE:=python-lxml
  31. DEPENDS+=+PACKAGE_python-lxml:python-light +PACKAGE_python-lxml:python-codecs
  32. VARIANT:=python
  33. endef
  34. define Package/python3-lxml
  35. $(call Package/python-lxml/Default)
  36. TITLE:=python3-lxml
  37. DEPENDS+=+PACKAGE_python3-lxml:python3-light
  38. VARIANT:=python3
  39. endef
  40. define Package/python-lxml/description
  41. The lxml XML toolkit is a Pythonic binding
  42. for the C libraries libxml2 and libxslt.
  43. endef
  44. define Package/python3-lxml/description
  45. $(call Package/python-lxml/description)
  46. .
  47. (Variant for Python3)
  48. endef
  49. TARGET_LDFLAGS += -lxml2 -lxslt -lexslt
  50. define PyBuild/Compile
  51. $(call Build/Compile/PyMod,, \
  52. install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
  53. --static \
  54. --single-version-externally-managed \
  55. , \
  56. INCLUDE="$(STAGING_DIR)/usr/include/ $(STAGING_DIR)/usr/include/libxml2" \
  57. LIBRARY="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib" \
  58. CFLAGS="$(TARGET_CFLAGS)" \
  59. LDFLAGS="$(TARGET_LDFLAGS)" \
  60. )
  61. endef
  62. define Py3Build/Compile
  63. $(call Build/Compile/Py3Mod,, \
  64. install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
  65. --static \
  66. --single-version-externally-managed \
  67. , \
  68. INCLUDE="$(STAGING_DIR)/usr/include/ $(STAGING_DIR)/usr/include/libxml2" \
  69. LIBRARY="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib" \
  70. CFLAGS="$(TARGET_CFLAGS)" \
  71. LDFLAGS="$(TARGET_LDFLAGS)" \
  72. )
  73. endef
  74. $(eval $(call PyPackage,python-lxml))
  75. $(eval $(call BuildPackage,python-lxml))
  76. $(eval $(call BuildPackage,python-lxml-src))
  77. $(eval $(call Py3Package,python3-lxml))
  78. $(eval $(call BuildPackage,python3-lxml))
  79. $(eval $(call BuildPackage,python3-lxml-src))