Makefile (2396B)
1 # 2 # Copyright (C) 2015-2016 OpenWrt.org 3 # 4 # This is free software, licensed under the GNU General Public License v2. 5 # See /LICENSE for more information. 6 # 7 8 include $(TOPDIR)/rules.mk 9 10 PKG_NAME:=cffi 11 PKG_VERSION:=1.8.3 12 PKG_RELEASE:=2 13 14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 15 PKG_SOURCE_URL:=https://pypi.python.org/packages/0a/f3/686af8873b70028fccf67b15c78fd4e4667a3da995007afc71e786d61b0a 16 PKG_HASH:=c321bd46faa7847261b89c0469569530cad5a41976bb6dba8202c0159f476568 17 18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION) 19 PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE) 20 21 HOST_BUILD_DEPENDS:=libffi/host python-pycparser/host 22 ifdef CONFIG_PACKAGE_python-cffi 23 HOST_BUILD_DEPENDS+=python/host 24 endif 25 ifdef CONFIG_PACKAGE_python3-cffi 26 HOST_BUILD_DEPENDS+=python3/host 27 endif 28 29 PKG_LICENSE:=MIT 30 PKG_LICENSE_FILES:=LICENSE 31 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com> 32 33 include $(INCLUDE_DIR)/host-build.mk 34 include $(INCLUDE_DIR)/package.mk 35 $(call include_mk, python-package.mk) 36 $(call include_mk, python3-package.mk) 37 38 define Package/python-cffi/Default 39 SECTION:=lang 40 CATEGORY:=Languages 41 SUBMENU:=Python 42 URL:=http://cffi.readthedocs.org/ 43 DEPENDS:=+libffi 44 endef 45 46 define Package/python-cffi 47 $(call Package/python-cffi/Default) 48 TITLE:=python-cffi 49 DEPENDS+=+python-light +python-pycparser 50 VARIANT:=python 51 endef 52 53 define Package/python3-cffi 54 $(call Package/python-cffi/Default) 55 TITLE:=python3-cffi 56 DEPENDS+=+python3-light +python3-pycparser 57 VARIANT:=python3 58 endef 59 60 define Package/python-cffi/description 61 Foreign Function Interface for Python calling C code. 62 endef 63 64 define Package/python3-cffi/description 65 $(call Package/python-cffi/description) 66 . 67 (Variant for Python3) 68 endef 69 70 ifdef CONFIG_PACKAGE_python-cffi 71 define Host/Compile/python-cffi 72 $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)") 73 endef 74 endif 75 76 ifdef CONFIG_PACKAGE_python3-cffi 77 define Host/Compile/python3-cffi 78 $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)") 79 endef 80 endif 81 82 define Host/Compile 83 $(call Host/Compile/python-cffi) 84 $(call Host/Compile/python3-cffi) 85 endef 86 87 define Host/Install 88 endef 89 90 $(eval $(call HostBuild)) 91 92 $(eval $(call PyPackage,python-cffi)) 93 $(eval $(call BuildPackage,python-cffi)) 94 95 $(eval $(call Py3Package,python3-cffi)) 96 $(eval $(call BuildPackage,python3-cffi))