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.

97 lines
2.5 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. PKG_SOURCE:=lxml-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/l/lxml
  13. PKG_HASH:=c81cb40bff373ab7a7446d6bbca0190bccc5be3448b47b51d729e37799bb5692
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-lxml-$(PKG_VERSION)
  15. PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
  16. PKG_LICENSE:=BSD
  17. PKG_LICENSE_FILES:=LICENSES.txt
  18. PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  19. PKG_CPE_ID:=cpe:/a:lxml:lxml
  20. include $(INCLUDE_DIR)/package.mk
  21. include ../python-package.mk
  22. include ../python3-package.mk
  23. define Package/python-lxml/Default
  24. SECTION:=lang
  25. CATEGORY:=Languages
  26. SUBMENU:=Python
  27. URL:=https://lxml.de
  28. DEPENDS:=+libxml2 +libxslt +libexslt
  29. endef
  30. define Package/python-lxml
  31. $(call Package/python-lxml/Default)
  32. TITLE:=python-lxml
  33. DEPENDS+=+PACKAGE_python-lxml:python-light +PACKAGE_python-lxml:python-codecs
  34. VARIANT:=python
  35. endef
  36. define Package/python3-lxml
  37. $(call Package/python-lxml/Default)
  38. TITLE:=python3-lxml
  39. DEPENDS+=+PACKAGE_python3-lxml:python3-light
  40. VARIANT:=python3
  41. endef
  42. define Package/python-lxml/description
  43. The lxml XML toolkit is a Pythonic binding
  44. for the C libraries libxml2 and libxslt.
  45. endef
  46. define Package/python3-lxml/description
  47. $(call Package/python-lxml/description)
  48. .
  49. (Variant for Python3)
  50. endef
  51. TARGET_LDFLAGS += -lxml2 -lxslt -lexslt
  52. define PyBuild/Compile
  53. $(call Build/Compile/PyMod,, \
  54. install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
  55. --static \
  56. --single-version-externally-managed \
  57. , \
  58. INCLUDE="$(STAGING_DIR)/usr/include/ $(STAGING_DIR)/usr/include/libxml2" \
  59. LIBRARY="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib" \
  60. CFLAGS="$(TARGET_CFLAGS)" \
  61. LDFLAGS="$(TARGET_LDFLAGS)" \
  62. )
  63. endef
  64. define Py3Build/Compile
  65. $(call Build/Compile/Py3Mod,, \
  66. install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
  67. --static \
  68. --single-version-externally-managed \
  69. , \
  70. INCLUDE="$(STAGING_DIR)/usr/include/ $(STAGING_DIR)/usr/include/libxml2" \
  71. LIBRARY="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib" \
  72. CFLAGS="$(TARGET_CFLAGS)" \
  73. LDFLAGS="$(TARGET_LDFLAGS)" \
  74. )
  75. endef
  76. $(eval $(call PyPackage,python-lxml))
  77. $(eval $(call BuildPackage,python-lxml))
  78. $(eval $(call BuildPackage,python-lxml-src))
  79. $(eval $(call Py3Package,python3-lxml))
  80. $(eval $(call BuildPackage,python3-lxml))
  81. $(eval $(call BuildPackage,python3-lxml-src))