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.4 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.1.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=lxml-$(PKG_VERSION).tgz
  12. PKG_SOURCE_URL:=http://lxml.de/files/
  13. PKG_HASH:=be3aaeb5f468a49f523f16736ccff7d82af2b4b303292ba3d052b5b28f3fbe47
  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. include $(INCLUDE_DIR)/package.mk
  20. $(call include_mk, python-package.mk)
  21. $(call include_mk, python3-package.mk)
  22. define Package/python-lxml/Default
  23. SECTION:=lang
  24. CATEGORY:=Languages
  25. SUBMENU:=Python
  26. URL:=http://lxml.de
  27. DEPENDS:=+libxml2 +libxslt +libexslt
  28. endef
  29. define Package/python-lxml
  30. $(call Package/python-lxml/Default)
  31. TITLE:=python-lxml
  32. DEPENDS+=+PACKAGE_python-lxml:python-light +PACKAGE_python-lxml:python-codecs
  33. VARIANT:=python
  34. endef
  35. define Package/python3-lxml
  36. $(call Package/python-lxml/Default)
  37. TITLE:=python3-lxml
  38. DEPENDS+=+PACKAGE_python3-lxml:python3-light
  39. VARIANT:=python3
  40. endef
  41. define Package/python-lxml/description
  42. The lxml XML toolkit is a Pythonic binding
  43. for the C libraries libxml2 and libxslt.
  44. endef
  45. define Package/python3-lxml/description
  46. $(call Package/python-lxml/description)
  47. .
  48. (Variant for Python3)
  49. endef
  50. TARGET_LDFLAGS += -lxml2 -lxslt -lexslt
  51. define PyBuild/Compile
  52. $(call Build/Compile/PyMod,, \
  53. install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
  54. --static \
  55. --single-version-externally-managed \
  56. , \
  57. INCLUDE="$(STAGING_DIR)/usr/include/ $(STAGING_DIR)/usr/include/libxml2" \
  58. LIBRARY="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib" \
  59. CFLAGS="$(TARGET_CFLAGS)" \
  60. LDFLAGS="$(TARGET_LDFLAGS)" \
  61. )
  62. endef
  63. define Py3Build/Compile
  64. $(call Build/Compile/Py3Mod,, \
  65. install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
  66. --static \
  67. --single-version-externally-managed \
  68. , \
  69. INCLUDE="$(STAGING_DIR)/usr/include/ $(STAGING_DIR)/usr/include/libxml2" \
  70. LIBRARY="$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib" \
  71. CFLAGS="$(TARGET_CFLAGS)" \
  72. LDFLAGS="$(TARGET_LDFLAGS)" \
  73. )
  74. endef
  75. $(eval $(call PyPackage,python-lxml))
  76. $(eval $(call BuildPackage,python-lxml))
  77. $(eval $(call Py3Package,python3-lxml))
  78. $(eval $(call BuildPackage,python3-lxml))