mirror of
https://github.com/openwrt/packages.git
synced 2025-12-19 09:01:22 +00:00
python packages: move all things python under lang/python
I admit this may be be a bit aggressive, but the lang folder is getting cluttered/filled up with Python, PHP, Perl, Ruby, etc. packages. Makes sense to try to group them into per-lang folders. I took the Pythons. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
97
lang/python/python-pycparser/Makefile
Normal file
97
lang/python/python-pycparser/Makefile
Normal file
@@ -0,0 +1,97 @@
|
||||
#
|
||||
# Copyright (C) 2015-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=pycparser
|
||||
PKG_VERSION:=2.14
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pycparser
|
||||
PKG_HASH:=7959b4a74abdc27b312fed1c21e6caf9309ce0b29ea86b591fd2e99ecdf27f73
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
|
||||
|
||||
HOST_BUILD_DEPENDS:=python-ply/host
|
||||
ifdef CONFIG_PACKAGE_python-pycparser
|
||||
HOST_BUILD_DEPENDS+=python/host
|
||||
endif
|
||||
ifdef CONFIG_PACKAGE_python3-pycparser
|
||||
HOST_BUILD_DEPENDS+=python3/host
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
$(call include_mk, python-package.mk)
|
||||
$(call include_mk, python3-package.mk)
|
||||
|
||||
define Package/python-pycparser/Default
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
SUBMENU:=Python
|
||||
URL:=https://github.com/eliben/pycparser
|
||||
endef
|
||||
|
||||
define Package/python-pycparser
|
||||
$(call Package/python-pycparser/Default)
|
||||
TITLE:=python-pycparser
|
||||
DEPENDS:=+python-light +python-ply
|
||||
VARIANT:=python
|
||||
endef
|
||||
|
||||
define Package/python3-pycparser
|
||||
$(call Package/python-pycparser/Default)
|
||||
TITLE:=python3-pycparser
|
||||
DEPENDS:=+python3-light +python3-ply
|
||||
VARIANT:=python3
|
||||
endef
|
||||
|
||||
define Package/python-pycparser/description
|
||||
pycparser is a parser for the C language, written in pure Python. It is a
|
||||
module designed to be easily integrated into applications that need to parse
|
||||
C source code.
|
||||
endef
|
||||
|
||||
define Package/python3-pycparser/description
|
||||
$(call Package/python-pycparser/description)
|
||||
.
|
||||
(Variant for Python3)
|
||||
endef
|
||||
|
||||
ifdef CONFIG_PACKAGE_python-pycparser
|
||||
define Host/Compile/python-pycparser
|
||||
$(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
|
||||
endef
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PACKAGE_python3-pycparser
|
||||
define Host/Compile/python3-pycparser
|
||||
$(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
|
||||
endef
|
||||
endif
|
||||
|
||||
define Host/Compile
|
||||
$(call Host/Compile/python-pycparser)
|
||||
$(call Host/Compile/python3-pycparser)
|
||||
endef
|
||||
|
||||
define Host/Install
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
|
||||
$(eval $(call PyPackage,python-pycparser))
|
||||
$(eval $(call BuildPackage,python-pycparser))
|
||||
|
||||
$(eval $(call Py3Package,python3-pycparser))
|
||||
$(eval $(call BuildPackage,python3-pycparser))
|
||||
@@ -0,0 +1,41 @@
|
||||
diff --git a/pycparser/c_lexer.py b/pycparser/c_lexer.py
|
||||
index cbb9d26..cbd7742 100644
|
||||
--- a/pycparser/c_lexer.py
|
||||
+++ b/pycparser/c_lexer.py
|
||||
@@ -9,8 +9,8 @@
|
||||
import re
|
||||
import sys
|
||||
|
||||
-from .ply import lex
|
||||
-from .ply.lex import TOKEN
|
||||
+from ply import lex
|
||||
+from ply.lex import TOKEN
|
||||
|
||||
|
||||
class CLexer(object):
|
||||
diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py
|
||||
index f4f7453..5c0ca88 100644
|
||||
--- a/pycparser/c_parser.py
|
||||
+++ b/pycparser/c_parser.py
|
||||
@@ -8,7 +8,7 @@
|
||||
#------------------------------------------------------------------------------
|
||||
import re
|
||||
|
||||
-from .ply import yacc
|
||||
+from ply import yacc
|
||||
|
||||
from . import c_ast
|
||||
from .c_lexer import CLexer
|
||||
diff --git a/setup.py b/setup.py
|
||||
index fdccbb3..036a10b 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -49,7 +49,7 @@ setup(
|
||||
classifiers = [
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 3',],
|
||||
- packages=['pycparser', 'pycparser.ply'],
|
||||
+ packages=['pycparser'],
|
||||
package_data={'pycparser': ['*.cfg']},
|
||||
cmdclass={'install': install, 'sdist': sdist},
|
||||
)
|
||||
Reference in New Issue
Block a user