Browse Source

python3: replicate packaging work done in python package

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
lilik-openwrt-22.03
Alexandru Ardelean 10 years ago
parent
commit
741fdfd1e0
17 changed files with 350 additions and 19 deletions
  1. +73
    -19
      lang/python3/Makefile
  2. +16
    -0
      lang/python3/files/python3-package-asyncio.mk
  3. +23
    -0
      lang/python3/files/python3-package-codecs.mk
  4. +18
    -0
      lang/python3/files/python3-package-ctypes.mk
  5. +17
    -0
      lang/python3/files/python3-package-dbm.mk
  6. +17
    -0
      lang/python3/files/python3-package-decimal.mk
  7. +16
    -0
      lang/python3/files/python3-package-distutils.mk
  8. +16
    -0
      lang/python3/files/python3-package-email.mk
  9. +16
    -0
      lang/python3/files/python3-package-gdbm.mk
  10. +16
    -0
      lang/python3/files/python3-package-logging.mk
  11. +17
    -0
      lang/python3/files/python3-package-multiprocessing.mk
  12. +18
    -0
      lang/python3/files/python3-package-ncurses.mk
  13. +17
    -0
      lang/python3/files/python3-package-openssl.mk
  14. +18
    -0
      lang/python3/files/python3-package-pydoc.mk
  15. +17
    -0
      lang/python3/files/python3-package-sqlite3.mk
  16. +16
    -0
      lang/python3/files/python3-package-unittest.mk
  17. +19
    -0
      lang/python3/files/python3-package-xml.mk

+ 73
- 19
lang/python3/Makefile View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2014 OpenWrt.org
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -57,7 +57,7 @@ endef
define Package/python3-base
$(call Package/python3/Default)
TITLE:=Python $(PYTHON_VERSION) interpreter
DEPENDS:=+libpthread +zlib +libffi +libopenssl
DEPENDS:=+libpthread +zlib
endef
define Package/python3-base/description
@ -65,13 +65,45 @@ define Package/python3-base/description
for the interpreter to start.
endef
define Package/python3-light
$(call Package/python3/Default)
TITLE:=Python $(PYTHON_VERSION) light installation
DEPENDS:=+python3-base +libffi +libbz2
endef
define Package/python3-light/description
This package is essentially the python3-base package plus
a few of the rarely used (and big) libraries stripped out
into separate packages.
endef
# Define newline here, since it's not defined in OpenWRT
define newline
endef
PYTHON3_LIB_FILES_DEL:=
PYTHON3_PACKAGES:=
PYTHON3_SO_SUFFIX:=cpython-34.so
define Py3BasePackage
PYTHON3_PACKAGES+=$(1)
PYTHON3_LIB_FILES_DEL+=$(2)
define Py3Package/$(1)/filespec
$(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
endef
endef
include ./files/python3-package-*.mk
define Package/python3
$(call Package/python3/Default)
DEPENDS:=+python3-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libdb47
DEPENDS:=+python3-light $(foreach package,$(PYTHON3_PACKAGES),+$(package))
endef
define Package/python3/description
This package contains the (almost) full Python install.
It's python3-light + all other packages.
endef
MAKE_FLAGS+=\
@ -123,29 +155,34 @@ define Build/InstallDev
$(1)/usr/lib/python$(PYTHON_VERSION)/
endef
PYTHON3_BASE_LIB_FILES:= \
/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py \
/usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.py \
/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py \
/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py \
/usr/lib/python$(PYTHON_VERSION)/abc.py \
/usr/lib/python$(PYTHON_VERSION)/codecs.py \
/usr/lib/python$(PYTHON_VERSION)/genericpath.py \
/usr/lib/python$(PYTHON_VERSION)/io.py \
/usr/lib/python$(PYTHON_VERSION)/os.py \
/usr/lib/python$(PYTHON_VERSION)/posixpath.py \
/usr/lib/python$(PYTHON_VERSION)/site.py \
/usr/lib/python$(PYTHON_VERSION)/sysconfig.py \
/usr/lib/python$(PYTHON_VERSION)/stat.py
PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES)
define Py3Package/python3-base/filespec
+|/usr/bin/python$(PYTHON_VERSION)
+|/usr/lib/python$(PYTHON_VERSION)/encodings
+|/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py
+|/usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.py
+|/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py
+|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
+|/usr/lib/python$(PYTHON_VERSION)/abc.py
+|/usr/lib/python$(PYTHON_VERSION)/codecs.py
+|/usr/lib/python$(PYTHON_VERSION)/genericpath.py
+|/usr/lib/python$(PYTHON_VERSION)/io.py
+|/usr/lib/python$(PYTHON_VERSION)/os.py
+|/usr/lib/python$(PYTHON_VERSION)/posixpath.py
+|/usr/lib/python$(PYTHON_VERSION)/site.py
+|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
+|/usr/lib/python$(PYTHON_VERSION)/stat.py
$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES),+|$(lib_file)))
endef
define Py3Package/python3/filespec
define Py3Package/python3-light/filespec
+|/usr/lib/python$(PYTHON_VERSION)
-|/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)
-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
-|/usr/lib/python$(PYTHON_VERSION)/ensurepip
-|/usr/lib/python$(PYTHON_VERSION)/idlelib
-|/usr/lib/python$(PYTHON_VERSION)/lib2to3
-|/usr/lib/python$(PYTHON_VERSION)/tkinter
@ -157,6 +194,8 @@ define Py3Package/python3/filespec
-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
-|/usr/lib/python$(PYTHON_VERSION)/*/test
-|/usr/lib/python$(PYTHON_VERSION)/*/tests
-|/usr/lib/python$(PYTHON_VERSION)/_osx_support.py
$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_LIB_FILES_DEL),-|$(lib_file)))
endef
define Py3Package/python3-base/install
@ -167,6 +206,14 @@ define Py3Package/python3-base/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
endef
define Py3Package/python3/filespec
-|$(PYTHON3_PKG_DIR)
endef
HOST_CFLAGS+= \
-I/usr/include/ncursesw \
-I/usr/include/ncurses
HOST_CONFIGURE_ARGS+= \
--without-cxx-main \
--without-pymalloc \
@ -174,7 +221,7 @@ HOST_CONFIGURE_ARGS+= \
--prefix=$(STAGING_DIR_HOST) \
--with-ensurepip=upgrade \
CONFIG_SITE= \
OPT="$(HOST_CFLAGS)"
CFLAGS="$(HOST_CFLAGS)"
define Host/Compile
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
@ -189,8 +236,15 @@ endef
$(eval $(call HostBuild))
$(foreach package, $(PYTHON3_PACKAGES), \
$(eval $(call Py3Package,$(package))) \
$(eval $(call BuildPackage,$(package))) \
)
$(eval $(call Py3Package,python3-base))
$(eval $(call Py3Package,python3-light))
$(eval $(call Py3Package,python3))
$(eval $(call BuildPackage,python3-base))
$(eval $(call BuildPackage,python3-light))
$(eval $(call BuildPackage,python3))

+ 16
- 0
lang/python3/files/python3-package-asyncio.mk View File

@ -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/python3-asyncio
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) asyncio module
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-asyncio, \
/usr/lib/python$(PYTHON3_VERSION)/asyncio \
))

+ 23
- 0
lang/python3/files/python3-package-codecs.mk View File

@ -0,0 +1,23 @@
#
# 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/python3-codecs
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) codecs + unicode support
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-codecs, \
/usr/lib/python$(PYTHON3_VERSION)/encodings \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_cn.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_hk.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_iso2022.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_jp.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_kr.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_codecs_tw.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/unicodedata.$(PYTHON3_SO_SUFFIX) \
))

+ 18
- 0
lang/python3/files/python3-package-ctypes.mk View File

@ -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/python3-ctypes
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) ctypes module
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-ctypes, \
/usr/lib/python$(PYTHON3_VERSION)/ctypes \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ctypes_test.$(PYTHON3_SO_SUFFIX) \
))

+ 17
- 0
lang/python3/files/python3-package-dbm.mk View File

@ -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/python3-dbm
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) dbm module
DEPENDS:=+python3-light +libdb47
endef
$(eval $(call Py3BasePackage,python3-dbm, \
/usr/lib/python$(PYTHON3_VERSION)/dbm \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_dbm.$(PYTHON3_SO_SUFFIX) \
))

+ 17
- 0
lang/python3/files/python3-package-decimal.mk View File

@ -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/python3-decimal
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) decimal module
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-decimal, \
/usr/lib/python$(PYTHON3_VERSION)/decimal.py \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_decimal.$(PYTHON3_SO_SUFFIX) \
))

+ 16
- 0
lang/python3/files/python3-package-distutils.mk View File

@ -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/python3-distutils
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) distutils module
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-distutils, \
/usr/lib/python$(PYTHON3_VERSION)/distutils \
))

+ 16
- 0
lang/python3/files/python3-package-email.mk View File

@ -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/python3-email
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) email module
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-email, \
/usr/lib/python$(PYTHON3_VERSION)/email \
))

+ 16
- 0
lang/python3/files/python3-package-gdbm.mk View File

@ -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/python3-gdbm
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) gdbm module
DEPENDS:=+python3-light +libgdbm
endef
$(eval $(call Py3BasePackage,python3-gdbm, \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_gdbm.$(PYTHON3_SO_SUFFIX) \
))

+ 16
- 0
lang/python3/files/python3-package-logging.mk View File

@ -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/python3-logging
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) logging module
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-logging, \
/usr/lib/python$(PYTHON3_VERSION)/logging \
))

+ 17
- 0
lang/python3/files/python3-package-multiprocessing.mk View File

@ -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/python3-multiprocessing
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) multiprocessing
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-multiprocessing, \
/usr/lib/python$(PYTHON3_VERSION)/multiprocessing \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_multiprocessing.$(PYTHON3_SO_SUFFIX) \
))

+ 18
- 0
lang/python3/files/python3-package-ncurses.mk View File

@ -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/python3-ncurses
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) ncurses module
DEPENDS:=+python3-light +libncursesw
endef
$(eval $(call Py3BasePackage,python3-ncurses, \
/usr/lib/python$(PYTHON3_VERSION)/curses \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_curses_panel.$(PYTHON3_SO_SUFFIX) \
))

+ 17
- 0
lang/python3/files/python3-package-openssl.mk View File

@ -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/python3-openssl
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) SSL module
DEPENDS:=+python3-light +libopenssl
endef
$(eval $(call Py3BasePackage,python3-openssl, \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_hashlib.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_ssl.$(PYTHON3_SO_SUFFIX) \
))

+ 18
- 0
lang/python3/files/python3-package-pydoc.mk View File

@ -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/python3-pydoc
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) pydoc module
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-pydoc, \
/usr/lib/python$(PYTHON3_VERSION)/doctest.py \
/usr/lib/python$(PYTHON3_VERSION)/pydoc.py \
/usr/lib/python$(PYTHON3_VERSION)/pydoc_data \
))

+ 17
- 0
lang/python3/files/python3-package-sqlite3.mk View File

@ -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/python3-sqlite3
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) sqlite3 module
DEPENDS:=+python3-light +libsqlite3
endef
$(eval $(call Py3BasePackage,python3-sqlite3, \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_sqlite3.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/sqlite3 \
))

+ 16
- 0
lang/python3/files/python3-package-unittest.mk View File

@ -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/python3-unittest
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) unittest module
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-unittest, \
/usr/lib/python$(PYTHON3_VERSION)/unittest \
))

+ 19
- 0
lang/python3/files/python3-package-xml.mk View File

@ -0,0 +1,19 @@
#
# 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/python3-xml
$(call Package/python3/Default)
TITLE:=Python $(PYTHON3_VERSION) xml libs
DEPENDS:=+python3-light
endef
$(eval $(call Py3BasePackage,python3-xml, \
/usr/lib/python$(PYTHON3_VERSION)/xml \
/usr/lib/python$(PYTHON3_VERSION)/xmlrpc \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_elementtree.$(PYTHON3_SO_SUFFIX) \
/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/pyexpat.$(PYTHON3_SO_SUFFIX) \
))

Loading…
Cancel
Save