From 0d072f2b42bf1191c42f3e44a4ae77883728ae66 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 2 Mar 2015 19:53:19 +0200 Subject: python: packetize some python modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Packetize some Python modules to reduce size of the overall Python package. Basically, a new package is introduced, call `python-light`, and everything that's extra (or big) is put in other packages. The `python` package becomes a metapackage that installs `python-light` along with the rest of the packages. Base work started by Jan Čermák. Signed-off-by: Jan Čermák Signed-off-by: Alexandru Ardelean --- lang/python/files/python-package-codecs.mk | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lang/python/files/python-package-codecs.mk (limited to 'lang/python/files/python-package-codecs.mk') diff --git a/lang/python/files/python-package-codecs.mk b/lang/python/files/python-package-codecs.mk new file mode 100644 index 000000000..c84c5fc39 --- /dev/null +++ b/lang/python/files/python-package-codecs.mk @@ -0,0 +1,22 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-codecs +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) codecs + unicode support + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-codecs, \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_cn.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_hk.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_iso2022.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_jp.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_kr.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_tw.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so \ +)) -- cgit From d69d8ec0b913f764204ea2a7cf63044db7c6f853 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Fri, 13 Mar 2015 18:12:46 +0200 Subject: python: refine packaging and split more modules into packages Rule of thumb is: any Python file that is greater than 100kb (or adds a dependency with which it adds more than 100 kb) should be a pretty useful/commonly used lib to stay in `python-light`. An example, is the Python IO lib, which summarized (Python source + binary module) is over 200kb. Also moved some files that should have been put into previously existing packages before, and re-organized the packages a bit. Signed-off-by: Alexandru Ardelean --- lang/python/files/python-package-bsddb.mk | 17 ----------------- lang/python/files/python-package-codecs.mk | 1 + lang/python/files/python-package-compiler.mk | 16 ++++++++++++++++ lang/python/files/python-package-ctypes.mk | 18 ++++++++++++++++++ lang/python/files/python-package-db.mk | 18 ++++++++++++++++++ lang/python/files/python-package-dbm.mk | 16 ---------------- lang/python/files/python-package-decimal.mk | 16 ++++++++++++++++ lang/python/files/python-package-distutils.mk | 16 ++++++++++++++++ lang/python/files/python-package-email.mk | 16 ++++++++++++++++ lang/python/files/python-package-logging.mk | 16 ++++++++++++++++ lang/python/files/python-package-multiprocessing.mk | 17 +++++++++++++++++ lang/python/files/python-package-ncurses.mk | 1 + lang/python/files/python-package-pydoc.mk | 1 + lang/python/files/python-package-unittest.mk | 16 ++++++++++++++++ lang/python/files/python-package-xml.mk | 20 ++++++++++++++++++++ 15 files changed, 172 insertions(+), 33 deletions(-) delete mode 100644 lang/python/files/python-package-bsddb.mk create mode 100644 lang/python/files/python-package-compiler.mk create mode 100644 lang/python/files/python-package-ctypes.mk create mode 100644 lang/python/files/python-package-db.mk delete mode 100644 lang/python/files/python-package-dbm.mk create mode 100644 lang/python/files/python-package-decimal.mk create mode 100644 lang/python/files/python-package-distutils.mk create mode 100644 lang/python/files/python-package-email.mk create mode 100644 lang/python/files/python-package-logging.mk create mode 100644 lang/python/files/python-package-multiprocessing.mk create mode 100644 lang/python/files/python-package-unittest.mk create mode 100644 lang/python/files/python-package-xml.mk (limited to 'lang/python/files/python-package-codecs.mk') diff --git a/lang/python/files/python-package-bsddb.mk b/lang/python/files/python-package-bsddb.mk deleted file mode 100644 index 601ac5436..000000000 --- a/lang/python/files/python-package-bsddb.mk +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (C) 2006-2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Package/python-bsddb -$(call Package/python/Default) - TITLE:=Python $(PYTHON_VERSION) bsddb module - DEPENDS:=+python-light +libdb47 -endef - -$(eval $(call PyBasePackage,python-bsddb, \ - /usr/lib/python$(PYTHON_VERSION)/bsddb \ - /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so \ -)) diff --git a/lang/python/files/python-package-codecs.mk b/lang/python/files/python-package-codecs.mk index c84c5fc39..d6e183500 100644 --- a/lang/python/files/python-package-codecs.mk +++ b/lang/python/files/python-package-codecs.mk @@ -12,6 +12,7 @@ $(call Package/python/Default) endef $(eval $(call PyBasePackage,python-codecs, \ + /usr/lib/python$(PYTHON_VERSION)/encodings \ /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_cn.so \ /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_hk.so \ /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_codecs_iso2022.so \ diff --git a/lang/python/files/python-package-compiler.mk b/lang/python/files/python-package-compiler.mk new file mode 100644 index 000000000..fbe8bf2e6 --- /dev/null +++ b/lang/python/files/python-package-compiler.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-compiler +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) compiler module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-compiler, \ + /usr/lib/python$(PYTHON_VERSION)/compiler \ +)) diff --git a/lang/python/files/python-package-ctypes.mk b/lang/python/files/python-package-ctypes.mk new file mode 100644 index 000000000..66b303310 --- /dev/null +++ b/lang/python/files/python-package-ctypes.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-ctypes +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) ctypes module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-ctypes, \ + /usr/lib/python$(PYTHON_VERSION)/ctypes \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so \ +)) diff --git a/lang/python/files/python-package-db.mk b/lang/python/files/python-package-db.mk new file mode 100644 index 000000000..26f35d882 --- /dev/null +++ b/lang/python/files/python-package-db.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-db +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) db module + DEPENDS:=+python-light +libdb47 +endef + +$(eval $(call PyBasePackage,python-db, \ + /usr/lib/python$(PYTHON_VERSION)/bsddb \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so \ +)) diff --git a/lang/python/files/python-package-dbm.mk b/lang/python/files/python-package-dbm.mk deleted file mode 100644 index f72c54818..000000000 --- a/lang/python/files/python-package-dbm.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2006-2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Package/python-dbm -$(call Package/python/Default) - TITLE:=Python $(PYTHON_VERSION) dbm module - DEPENDS:=+python-light +libdb47 -endef - -$(eval $(call PyBasePackage,python-dbm, \ - /usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so \ -)) diff --git a/lang/python/files/python-package-decimal.mk b/lang/python/files/python-package-decimal.mk new file mode 100644 index 000000000..33e3a21d2 --- /dev/null +++ b/lang/python/files/python-package-decimal.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-decimal +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) decimal module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-decimal, \ + /usr/lib/python$(PYTHON_VERSION)/decimal.py \ +)) diff --git a/lang/python/files/python-package-distutils.mk b/lang/python/files/python-package-distutils.mk new file mode 100644 index 000000000..f5119fac3 --- /dev/null +++ b/lang/python/files/python-package-distutils.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-distutils +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) distutils + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-distutils, \ + /usr/lib/python$(PYTHON_VERSION)/distutils \ +)) diff --git a/lang/python/files/python-package-email.mk b/lang/python/files/python-package-email.mk new file mode 100644 index 000000000..51fa8d12a --- /dev/null +++ b/lang/python/files/python-package-email.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-email +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) email module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-email, \ + /usr/lib/python$(PYTHON_VERSION)/email \ +)) diff --git a/lang/python/files/python-package-logging.mk b/lang/python/files/python-package-logging.mk new file mode 100644 index 000000000..f45de35dc --- /dev/null +++ b/lang/python/files/python-package-logging.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-logging +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) logging module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-logging, \ + /usr/lib/python$(PYTHON_VERSION)/logging \ +)) diff --git a/lang/python/files/python-package-multiprocessing.mk b/lang/python/files/python-package-multiprocessing.mk new file mode 100644 index 000000000..2a9f5b185 --- /dev/null +++ b/lang/python/files/python-package-multiprocessing.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-multiprocessing +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) multiprocessing + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-multiprocessing, \ + /usr/lib/python$(PYTHON_VERSION)/multiprocessing \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_multiprocessing.so \ +)) diff --git a/lang/python/files/python-package-ncurses.mk b/lang/python/files/python-package-ncurses.mk index a5ff20040..04751ef83 100644 --- a/lang/python/files/python-package-ncurses.mk +++ b/lang/python/files/python-package-ncurses.mk @@ -12,6 +12,7 @@ $(call Package/python/Default) endef $(eval $(call PyBasePackage,python-ncurses, \ + /usr/lib/python$(PYTHON_VERSION)/curses \ /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so \ /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so \ )) diff --git a/lang/python/files/python-package-pydoc.mk b/lang/python/files/python-package-pydoc.mk index 0df3cfd16..ca27f9b36 100644 --- a/lang/python/files/python-package-pydoc.mk +++ b/lang/python/files/python-package-pydoc.mk @@ -12,6 +12,7 @@ $(call Package/python/Default) endef $(eval $(call PyBasePackage,python-pydoc, \ + /usr/lib/python$(PYTHON_VERSION)/doctest.py \ /usr/lib/python$(PYTHON_VERSION)/pydoc.py \ /usr/lib/python$(PYTHON_VERSION)/pydoc_data \ )) diff --git a/lang/python/files/python-package-unittest.mk b/lang/python/files/python-package-unittest.mk new file mode 100644 index 000000000..6e1ab552d --- /dev/null +++ b/lang/python/files/python-package-unittest.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-unittest +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) unittest module + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-unittest, \ + /usr/lib/python$(PYTHON_VERSION)/unittest \ +)) diff --git a/lang/python/files/python-package-xml.mk b/lang/python/files/python-package-xml.mk new file mode 100644 index 000000000..69074ccb4 --- /dev/null +++ b/lang/python/files/python-package-xml.mk @@ -0,0 +1,20 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/python-xml +$(call Package/python/Default) + TITLE:=Python $(PYTHON_VERSION) xml libs + DEPENDS:=+python-light +endef + +$(eval $(call PyBasePackage,python-xml, \ + /usr/lib/python$(PYTHON_VERSION)/xml \ + /usr/lib/python$(PYTHON_VERSION)/xmllib.py \ + /usr/lib/python$(PYTHON_VERSION)/xmlrpclib.py \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/_elementtree.so \ + /usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so \ +)) -- cgit