Makefile (2541B)
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:=pycparser 11 PKG_VERSION:=2.14 12 PKG_RELEASE:=4 13 14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 15 PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pycparser 16 PKG_HASH:=7959b4a74abdc27b312fed1c21e6caf9309ce0b29ea86b591fd2e99ecdf27f73 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:=python-ply/host 22 ifdef CONFIG_PACKAGE_python-pycparser 23 HOST_BUILD_DEPENDS+=python/host 24 endif 25 ifdef CONFIG_PACKAGE_python3-pycparser 26 HOST_BUILD_DEPENDS+=python3/host 27 endif 28 29 PKG_LICENSE:=BSD-3-Clause 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-pycparser/Default 39 SECTION:=lang 40 CATEGORY:=Languages 41 SUBMENU:=Python 42 URL:=https://github.com/eliben/pycparser 43 endef 44 45 define Package/python-pycparser 46 $(call Package/python-pycparser/Default) 47 TITLE:=python-pycparser 48 DEPENDS:=+python-light +python-ply 49 VARIANT:=python 50 endef 51 52 define Package/python3-pycparser 53 $(call Package/python-pycparser/Default) 54 TITLE:=python3-pycparser 55 DEPENDS:=+python3-light +python3-ply 56 VARIANT:=python3 57 endef 58 59 define Package/python-pycparser/description 60 pycparser is a parser for the C language, written in pure Python. It is a 61 module designed to be easily integrated into applications that need to parse 62 C source code. 63 endef 64 65 define Package/python3-pycparser/description 66 $(call Package/python-pycparser/description) 67 . 68 (Variant for Python3) 69 endef 70 71 ifdef CONFIG_PACKAGE_python-pycparser 72 define Host/Compile/python-pycparser 73 $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)") 74 endef 75 endif 76 77 ifdef CONFIG_PACKAGE_python3-pycparser 78 define Host/Compile/python3-pycparser 79 $(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)") 80 endef 81 endif 82 83 define Host/Compile 84 $(call Host/Compile/python-pycparser) 85 $(call Host/Compile/python3-pycparser) 86 endef 87 88 define Host/Install 89 endef 90 91 $(eval $(call HostBuild)) 92 93 $(eval $(call PyPackage,python-pycparser)) 94 $(eval $(call BuildPackage,python-pycparser)) 95 96 $(eval $(call Py3Package,python3-pycparser)) 97 $(eval $(call BuildPackage,python3-pycparser))