Merge pull request #5419 from commodo/python-package-mk-localize
authorHannu Nyman <hannu.nyman@iki.fi>
Thu, 11 Jan 2018 14:33:33 +0000 (16:33 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Jan 2018 14:33:33 +0000 (16:33 +0200)
treewide: re-organizing python-package.mk & python3-package.mk

94 files changed:
lang/python/Flask/Makefile
lang/python/Jinja2/Makefile
lang/python/MarkupSafe/Makefile
lang/python/Werkzeug/Makefile
lang/python/chardet/Makefile
lang/python/click/Makefile
lang/python/django-appconf/Makefile
lang/python/django-compressor/Makefile
lang/python/django-constance/Makefile
lang/python/django-jsonfield/Makefile
lang/python/django-picklefield/Makefile
lang/python/django-postoffice/Makefile
lang/python/django-restframework/Makefile
lang/python/django-statici18n/Makefile
lang/python/django/Makefile
lang/python/et_xmlfile/Makefile
lang/python/flup/Makefile
lang/python/gunicorn/Makefile
lang/python/itsdangerous/Makefile
lang/python/jdcal/Makefile
lang/python/openpyxl/Makefile
lang/python/pillow/Makefile
lang/python/pyodbc/Makefile
lang/python/python-asn1crypto/Makefile
lang/python/python-attrs/Makefile
lang/python/python-cffi/Makefile
lang/python/python-crcmod/Makefile
lang/python/python-crypto/Makefile
lang/python/python-cryptography/Makefile
lang/python/python-curl/Makefile
lang/python/python-dateutil/Makefile
lang/python/python-dns/Makefile
lang/python/python-dpkt/Makefile
lang/python/python-egenix-mx-base/Makefile
lang/python/python-enum34/Makefile
lang/python/python-evdev/Makefile
lang/python/python-gmpy2/Makefile
lang/python/python-gnupg/Makefile
lang/python/python-host.mk [new file with mode: 0644]
lang/python/python-idna/Makefile
lang/python/python-ipaddress/Makefile
lang/python/python-ldap/Makefile
lang/python/python-lxml/Makefile
lang/python/python-mysql/Makefile
lang/python/python-package-install.sh [new file with mode: 0644]
lang/python/python-package.mk [new file with mode: 0644]
lang/python/python-packages/Makefile
lang/python/python-parsley/Makefile
lang/python/python-pcapy/Makefile
lang/python/python-ply/Makefile
lang/python/python-psycopg2/Makefile
lang/python/python-pyasn1-modules/Makefile
lang/python/python-pyasn1/Makefile
lang/python/python-pycparser/Makefile
lang/python/python-pyopenssl/Makefile
lang/python/python-pyptlib/Makefile
lang/python/python-pyserial/Makefile
lang/python/python-service-identity/Makefile
lang/python/python-six/Makefile
lang/python/python-txsocksx/Makefile
lang/python/python-urllib3/Makefile
lang/python/python-version.mk [new file with mode: 0644]
lang/python/python-yaml/Makefile
lang/python/python/Makefile
lang/python/python/files/python-host.mk [deleted file]
lang/python/python/files/python-package-install.sh [deleted file]
lang/python/python/files/python-package.mk [deleted file]
lang/python/python/files/python-version.mk [deleted file]
lang/python/python3-bottle/Makefile
lang/python/python3-host.mk [new file with mode: 0644]
lang/python/python3-package.mk [new file with mode: 0644]
lang/python/python3-version.mk [new file with mode: 0644]
lang/python/python3/Makefile
lang/python/python3/files/python3-host.mk [deleted file]
lang/python/python3/files/python3-package-install.sh [deleted file]
lang/python/python3/files/python3-package.mk [deleted file]
lang/python/python3/files/python3-version.mk [deleted file]
lang/python/pytz/Makefile
lang/python/rcssmin/Makefile
lang/python/simplejson/Makefile
lang/python/twisted/Makefile
lang/python/zope-interface/Makefile
libs/libimobiledevice/Makefile
libs/libsearpc/Makefile
net/danish/Makefile
net/obfsproxy/Makefile
net/openvswitch/Makefile
net/radicale/Makefile
net/scapy/Makefile
net/seafile-ccnet/Makefile
net/seafile-seahub/Makefile
net/seafile-seahub/patches/020-Makefile-fixes.patch
net/seafile-server/Makefile
utils/i2c-tools/Makefile

index 6ff14a2583c3a5abb4b55ad80e475c2a532c43cd..5e9dcd51c6e0c9595cc58df8ffdaef28cd7ad06d 100644 (file)
@@ -20,7 +20,7 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
+include ../python3-package.mk
 
 define Package/python3-flask
   SECTION:=lang
index 8b62569618590abbc8c9aab7e4b9d66d25280a07..7ef9e0b8a2435f1262cfeb627db582ec2afb6777 100644 (file)
@@ -20,7 +20,7 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
+include ../python3-package.mk
 
 define Package/python3-jinja2
   SECTION:=lang
index 0083516e410cbea4fa6ffa94571d5ff3bb9ae757..84cd184275b968538a7e3e08c82834257efbbecc 100644 (file)
@@ -20,7 +20,7 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
+include ../python3-package.mk
 
 define Package/python3-markupsafe
   SECTION:=lang
index 8192a61de8d2bc07baddc600b02173d3e2e06bd1..0f4a51a1ef41cbb4bedb6709ce3709ad2debcb13 100644 (file)
@@ -20,7 +20,7 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
+include ../python3-package.mk
 
 define Package/python3-werkzeug
   SECTION:=lang
index 72f09d6f51454c9b8424b3c217c91ea1d24aa85a..27020c75981ce0c3f206c6b864d37029163100e5 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0
 PKG_HASH:=84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/chardet
   SUBMENU:=Python
index e52e99938e8c5eca5a10983d273931a01f2189c7..021357895d9833da675629ea7bcdb516b031226d 100644 (file)
@@ -20,7 +20,7 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
+include ../python3-package.mk
 
 define Package/python3-click
   SECTION:=lang
index 4635cf577ea8579f87b9c60c94c7a12f5b4c7d6f..874e850be118b9e30a6984cea733c500a964bc4c 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/34/b9/d07195652ab494b026f7cb034
 PKG_HASH:=6a4d9aea683b4c224d97ab8ee11ad2d29a37072c0c6c509896dd9857466fb261
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django-appconf
   SUBMENU:=Python
index 8a14a3dd3994c07df199754b58d6b2bf6c83445a..19e0f3e787d802147edb8e39448f210eb873fa6c 100644 (file)
@@ -18,7 +18,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/django_compressor-$(PKG_VERSION)/
 PKG_HASH:=9616570e5b08e92fa9eadc7a1b1b49639cce07ef392fc27c74230ab08075b30f
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django-compressor
   SUBMENU:=Python
index 7d8a7e1e9be4cfe0d7195cc89214ed5efb825504..359ae8ba4058c588c673631f430984ef54b3520b 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/8a/37/4fa87dd0e43aa0a66fc419d58
 PKG_HASH:=6eec9f3ac4e5657b93e64f3379181d1e727088df10dd34f0398cd12119b9f0b0
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django-constance
   SUBMENU:=Python
index cd9a9a76511dd96e5d2c845efea48582a79d08cf..d3796d2c853d6b2b45a5ee8d92e46180a09d3440 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/e4/b2/a079f0a2218e0eb7892edbf40
 PKG_HASH:=6c0afd5554739365b55d86e285cf966cc3a45682fff963463364ea1f6511ca3e
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django-jsonfield
   SUBMENU:=Python
index 61438ce6cac734093146a3b34fa0a45845cf9757..4566cc6a162a0b2bec2830cf966701d11a4b9580 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/e8/69/232d78ef16cad8dd4c2f871b0
 PKG_HASH:=61e3ba7f6df82d8df9e6be3a8c55ef589eb3bf926c3d25d2b7949b07eae78354
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django-picklefield
   SUBMENU:=Python
index ac594a56a3dd9ec3f502eea269fc26fa9085360e..f3519f41f0777f9b989a8a59a4fa9905bf8dd6b0 100644 (file)
@@ -18,7 +18,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/django-post_office-$(PKG_VERSION)/
 PKG_HASH:=8d691b2e53ba8121d770ce448f05568874cf78a3cf63215918ad49536db5e76a
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django-postoffice
   SUBMENU:=Python
index d1d22102e17ec74fc1a106ab5a9bd89225614ccc..fb37b0e95a8562fcfd2d2f25a91c9c25bd8f4aa6 100644 (file)
@@ -18,7 +18,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/djangorestframework-$(PKG_VERSION)
 PKG_HASH:=305b2c6564ca46d3b558ba21110ed717135c467adf1a6dfd192bd85f4bb04d50
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django-restframework
   SUBMENU:=Python
index 51b707440d270fda5500321c4def157e5450de88..a93a022e6062cf4e3bd7839af4ae452bba162c63 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/29/4d/fd9ba0e9b86c05714d9bc945d
 PKG_HASH:=3cb5334d42cfabda49c9c0efb1c24f5663e318ed34b3a34fada5195232f75f65
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django-statici18n
   SUBMENU:=Python
index 43e657131f99968be41f46a8b51079bbddf0fd63..6d59cdd71d6355e7a0271833da90603a643fd2df 100644 (file)
@@ -20,7 +20,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MIRROR_HASH:=c82c2cc338ae46ba8572d9960fc98dca932edc43a00f011fed102810a86185ae
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/django
     SUBMENU:=Python
index b10492639e978b48b5b6ba9382f48a29154179bd..ae706811fe07e0e365e127d9d1e5f5f148d00501 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=http://pypi.python.org/packages/source/e/et_xmlfile/
 PKG_HASH:=614d9722d572f6246302c4491846d2c393c199cfa4edc9af593437691683335b
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/et_xmlfile
   SUBMENU:=Python
index baf4f8937d3d72a478c617a69595c8bad397f5e7..4a0142f323ae41c745413f5dec7fa9bf6b92357f 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=http://pypi.python.org/packages/source/f/flup/
 PKG_HASH:=4bad317a5fc1ce3d4fe5e9b6d846ec38a8023e16876785d4f88102f2c8097dd9
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/flup
   SUBMENU:=Python
index 73c224bfa136d6d3cdc1391ac7101e83528c7828..4ba2fc61b5a3249f75f057193551ca72ee41ef3f 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/30/3a/10bb213cede0cc4d13ac22633
 PKG_HASH:=eee1169f0ca667be05db3351a0960765620dad53f53434262ff8901b68a1b622
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/gunicorn
     SUBMENU:=Python
index e52603df2430a4ab37f192dd2d9b6b1b453f9996..e1e432ef45f282929707a2b0216f5c840aa15b53 100644 (file)
@@ -20,7 +20,7 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
+include ../python3-package.mk
 
 define Package/python3-itsdangerous
   SECTION:=lang
index 367b993b014aed76e15028df71204dba23b98912..2fba8a64d9c111365e45a90590e7d9a6a2340e85 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/9b/fa/40beb2aa43a13f740dd5be367
 PKG_HASH:=b760160f8dc8cc51d17875c6b663fafe64be699e10ce34b6a95184b5aa0fdc9e
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/jdcal
   SUBMENU:=Python
index 82de86a204fdf7c2a0fdaf7424911352a263b20e..93a3f06362ee447914ba9ad0b0f23794ac0626eb 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/88/3c/34fbe561fc92e6a75f297478b
 PKG_HASH:=3b42ece7933b46b2128f8d4111c57c80fb5aa46f4d16e7f83281f169e7398ba7
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/openpyxl
   SUBMENU:=Python
index 5e16b14541c12a9ba31cfb01590ebe2c50b56ffb..c1618e2f7d90858793789dcd6a6a8971c7dbf835 100644 (file)
@@ -20,7 +20,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MIRROR_HASH:=e7c36bcf89614337d9abc4d07780da0b346a745be7a9aa55b398fa427549273c
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/pillow
     SUBMENU:=Python
index 01371ad95c8022ebc29cccb5386889742925d64e..aec3e7e6329b70de3e3d05ec4d6161e8e95f5407 100644 (file)
@@ -20,8 +20,8 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 define Package/python-pyodbc/Default
   SECTION:=lang
index 7998a5a42ff274a85df7255dedbcb5160ea63f95..73e2f630597ff053f7956bcbbe5eacec00b5b6fb 100644 (file)
@@ -21,8 +21,8 @@ PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-asn1crypto-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index 9c3e6886cf13ee0dc43015358efbbdfa95bf7e34..3911a1d34b6903222fa48ddafa87bb5a5d753fc5 100644 (file)
@@ -22,8 +22,8 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index fd49f2e998dfede04fd4430f49f6442ef208fb19..8549a439f4ddfa066484291994c65ac75f4e2ed2 100644 (file)
@@ -27,8 +27,8 @@ HOST_PYTHON_PACKAGE_BUILD_DEPENDS:="cffi==$(PKG_VERSION)"
 HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="cffi==$(PKG_VERSION)"
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index 3ad02584547c2585f4aed04da19f7d75765d80a1..a4873ccad66a54c9fcb41b58f8fa389de5ab593e 100644 (file)
@@ -21,7 +21,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/crcmod-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-crcmod
   SUBMENU:=Python
index cdc5eebcff572994ae928652e241db3ebf5deb61..8d4aaefcede27b42da2b917ab6cf55fcae83e999 100644 (file)
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYRIGHT
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-crypto
        SECTION:=lang-python
index acae27fe7ff5f9680a7981f604df1d2444c893c6..73064d396484161573118ea608939523c26204b4 100644 (file)
@@ -22,8 +22,8 @@ PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleana
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-cryptography-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index f325560a4b6a356a47ea484093816bb78e67c0fa..12bff8fd49c71c3b3857bb90692c20e2d5e00118 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=https://dl.bintray.com/pycurl/pycurl/
 PKG_HASH:=43231bf2bafde923a6d9bb79e2407342a5f3382c1ef0a3b2e491c6a4e50b91aa
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-curl
   CATEGORY:=Languages
index 8b799b53d1188218d09ac41e0a0d3c198543795a..421758a55a69dd4575dc6e59bf2b1f44695105de 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/54/bb/f1db86504f7a49e1d9b930153
 PKG_HASH:=891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-dateutil
   SUBMENU:=Python
index 847ad9db0e50b09a75e041700b707974e370efc2..545a170e3b64db2ddac9009542d9734c072150eb 100644 (file)
@@ -19,7 +19,7 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_BUILD_DIR:=$(BUILD_DIR)/dnspython-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-dns
        SECTION:=language-python
index cf0c3153046467fd1e814558c67545488352a99e..e6b0417987fa89b5dde4f979d6f1d06e36f9f97e 100644 (file)
@@ -21,7 +21,7 @@ PKG_MIRROR_HASH:=fe8657552b1dbaf8b9eba50168730e200567dc88a06932aa1cf60dc93211d16
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-dpkt
        SECTION:=language-python
index f6c806fd1c84415beaa29ebee6defd798f8b6d30..374258cdae2252e27b2e5b14b83dff74a0daf659 100644 (file)
@@ -22,7 +22,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/egenix-mx-base-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-egenix-mx-base
   SUBMENU:=Python
index bc419705eb27e578c415c4635ae76837855155c9..165ec909d39366556203e59a35852e3a59589f28 100644 (file)
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=enum/LICENSE
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-enum34
        SECTION:=lang
index bb2acb64181e97f3e767f501fe0bbef081fe164a..4bdf5212ffbbbb2a950bf598528e701bda89c67f 100644 (file)
@@ -22,8 +22,8 @@ PKG_HASH:=57edafc469a414f58b51af1bfb9ee2babb9f626dd2df530d71c1176871850aa1
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-evdev-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index b517c87832928804afb1f45b4ee6f51ca47bcb50..99174136577a396b0fece4cfb22aaeb0faec818c 100644 (file)
@@ -22,8 +22,8 @@ PKG_LICENSE_FILES:=COPYING.LESSER
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=unzip -q -d $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_SOURCE); mv -f $(PKG_BUILD_DIR)/gmpy2-$(PKG_VERSION)/* $(PKG_BUILD_DIR)
 
index 408464bf4abc1cbf9265dd6e1d69940b81a4f385..0c209a7519b840a640d139c0043a6804a37cb6be 100644 (file)
@@ -20,8 +20,8 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 define Package/python-gnupg/Default
   SECTION:=lang
diff --git a/lang/python/python-host.mk b/lang/python/python-host.mk
new file mode 100644 (file)
index 0000000..d4dc81f
--- /dev/null
@@ -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.
+#
+
+# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
+#       if `python-package.mk` is included, this will already be included
+
+ifneq ($(__python_host_mk_inc),1)
+__python_host_mk_inc=1
+
+# For PYTHON_VERSION
+python_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
+include $(python_mk_path)python-version.mk
+
+HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
+HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
+HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
+
+HOST_PYTHON_PKG_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)/site-packages
+
+HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)
+
+HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(HOST_PYTHON_PKG_DIR)
+
+define HostPython
+       if [ "$(strip $(3))" == "HOST" ]; then \
+               export PYTHONPATH="$(HOST_PYTHONPATH)"; \
+               export PYTHONDONTWRITEBYTECODE=0; \
+       else \
+               export PYTHONPATH="$(PYTHONPATH)"; \
+               export PYTHONDONTWRITEBYTECODE=1; \
+               export _python_sysroot="$(STAGING_DIR)"; \
+               export _python_prefix="/usr"; \
+               export _python_exec_prefix="/usr"; \
+       fi; \
+       export PYTHONOPTIMIZE=""; \
+       $(1) \
+       $(HOST_PYTHON_BIN) $(2);
+endef
+
+define host_python_settings
+       ARCH="$(HOST_ARCH)" \
+       CC="$(HOSTCC)" \
+       CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
+       CXX="$(HOSTCXX)" \
+       LD="$(HOSTCC)" \
+       LDSHARED="$(HOSTCC) -shared" \
+       CFLAGS="$(HOST_CFLAGS)" \
+       CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
+       LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
+       _PYTHON_HOST_PLATFORM=linux2
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPyRunHost
+       $(call HostPython, \
+               $(if $(1),$(1);) \
+               $(call host_python_settings) \
+               $(3) \
+               , \
+               $(2) \
+               , \
+               HOST \
+       )
+endef
+
+# Note: I shamelessly copied this from Yousong's logic (from python-packages);
+HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
+define host_python_pip_install
+       $(call host_python_settings) \
+       $(HOST_PYTHON_PIP) install \
+               --root=$(1) \
+               --prefix=$(2) \
+               --ignore-installed \
+               $(3)
+endef
+
+define host_python_pip_install_host
+$(call host_python_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/HostPyMod
+       $(call Build/Compile/HostPyRunHost, \
+               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+endef
+
+endif # __python_host_mk_inc
index 3d17183a5a5e9a8ba7945690bed6831840d5d19e..d5af7d39d52ed3e46e2f3b341b6705ced41ac01b 100644 (file)
@@ -22,8 +22,8 @@ PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleana
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-idna-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index d4fecf7726dc6ae47e4d5e337ab4af5784acda89..77e97e7693bbcd6ac641fe2332a7d6ef23ca5ab7 100644 (file)
@@ -19,7 +19,7 @@ PKG_LICENSE:=Python-2.0
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-ipaddress
        SECTION:=lang
index 62b19046ce87b6971ff97d0463ebeebd4db33199..a8d983de36fe989472ccdb5937f63a97e94dc3d7 100644 (file)
@@ -19,7 +19,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/67/d9/fa0ea70d1792875745116ad62
 PKG_HASH:=5810f1b5a9ae9255df99fb9c2dcab7352fed325687efda56c0faae1a82c5e3cb
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-ldap
   SUBMENU:=Python
index 3e228bb607289a83ed39fe1632f360a215e62abe..0c543fce446ce1f5d39a5626afe070cf4ced0a01 100644 (file)
@@ -23,8 +23,8 @@ PKG_LICENSE_FILES:=LICENSES.txt
 PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 define Package/python-lxml/Default
   SECTION:=lang
index 596ac38446a17069828a3eb2084971117950a0d4..f776b74bbaaad583ef9aee00470464f61b86ad09 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/source/M/MySQL-python/
 PKG_HASH:=811040b647e5d5686f84db415efd697e6250008b112b6909ba77ac059e140c74
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-mysql
   SUBMENU:=Python
diff --git a/lang/python/python-package-install.sh b/lang/python/python-package-install.sh
new file mode 100644 (file)
index 0000000..d5a5032
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/sh
+set -e
+
+process_filespec() {
+       local src_dir="$1"
+       local dst_dir="$2"
+       local filespec="$3"
+       echo "$filespec" | (
+       IFS='|'
+       while read fop fspec fperm; do
+               local fop=`echo "$fop" | tr -d ' \t\n'`
+               if [ "$fop" = "+" ]; then
+                       if [ ! -e "${src_dir}${fspec}" ]; then
+                               echo "File not found '${src_dir}${fspec}'"
+                               exit 1
+                       fi
+                       dpath=`dirname "$fspec"`
+                       if [ -z "$fperm" ]; then
+                               dperm=`stat -c "%a" ${src_dir}${dpath}`
+                       fi
+                       mkdir -p -m$dperm ${dst_dir}${dpath}
+                       echo "copying: '$fspec'"
+                       cp -fpR ${src_dir}${fspec} ${dst_dir}${dpath}/
+                       if [ -n "$fperm" ]; then
+                               chmod -R $fperm ${dst_dir}${fspec}
+                       fi
+               elif [ "$fop" = "-" ]; then
+                       echo "removing: '$fspec'"
+                       rm -fR ${dst_dir}${fspec}
+               elif [ "$fop" = "=" ]; then
+                       echo "setting permissions: '$fperm' on '$fspec'"
+                       chmod -R $fperm ${dst_dir}${fspec}
+               fi
+       done
+       )
+}
+
+ver="$1"
+src_dir="$2"
+dst_dir="$3"
+python="$4"
+mode="$5"
+filespec="$6"
+
+process_filespec "$src_dir" "$dst_dir" "$filespec" || {
+       echo "process filespec error-ed"
+       exit 1
+}
+
+if [ "$mode" == "sources" ] ; then
+       # Copy only python source files
+       find $dst_dir -not -type d -not -name "*\.py" | xargs rm -f
+
+       # Delete empty folders (if the case)
+       if [ -d "$dst_dir/usr" ] ; then
+               find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
+               rmdir --ignore-fail-on-non-empty $dst_dir/usr
+       fi
+       exit 0
+fi
+
+legacy=
+[ "$ver" == "3" ] && legacy="-b"
+
+# XXX [So that you won't goof as I did]
+# Note: Yes, I tried to use the -O & -OO flags here.
+#       However the generated byte-codes were not portable.
+#       So, we just stuck to un-optimized byte-codes,
+#       which is still way better/faster than running
+#       Python sources all the time.
+$python -m compileall $legacy -d '/' $dst_dir || {
+       echo "python -m compileall err-ed"
+       exit 1
+}
+
+# Delete source files and pyc [ un-optimized bytecode files ]
+# We may want to make this optimization thing configurable later, but not sure atm
+find $dst_dir -type f -name "*\.py" | xargs rm -f
+
+# Delete empty folders (if the case)
+if [ -d "$dst_dir/usr" ] ; then
+       find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
+       rmdir --ignore-fail-on-non-empty $dst_dir/usr
+fi
+
+exit 0
diff --git a/lang/python/python-package.mk b/lang/python/python-package.mk
new file mode 100644 (file)
index 0000000..8bfd5e3
--- /dev/null
@@ -0,0 +1,135 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
+
+python_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
+include $(python_mk_path)python-host.mk
+
+PYTHON_DIR:=$(STAGING_DIR)/usr
+PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
+PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
+PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
+
+PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
+
+PYTHON:=python$(PYTHON_VERSION)
+
+PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+
+# These configure args are needed in detection of path to Python header files
+# using autotools.
+CONFIGURE_ARGS += \
+       _python_sysroot="$(STAGING_DIR)" \
+       _python_prefix="/usr" \
+       _python_exec_prefix="/usr"
+
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
+define PyPackage
+
+  define Package/$(1)-src
+    $(call Package/$(1))
+    TITLE+= (sources)
+    DEPENDS:=$$$$(foreach dep,$$$$(filter +python-%,$$$$(DEPENDS)),$$$$(dep)-src)
+  endef
+
+  define Package/$(1)-src/description
+    $(call Package/$(1)/description).
+    (Contains the Python sources for this package).
+  endef
+
+  # Add default PyPackage filespec none defined
+  ifndef PyPackage/$(1)/filespec
+    define PyPackage/$(1)/filespec
+      +|$(PYTHON_PKG_DIR)
+    endef
+  endif
+
+  ifndef PyPackage/$(1)/install
+    define PyPackage/$(1)/install
+               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
+                       $(INSTALL_DIR) $$(1)/usr/bin ; \
+                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
+               fi
+    endef
+  endif
+
+  ifndef Package/$(1)/install
+  $(call shexport,PyPackage/$(1)/filespec)
+
+  define Package/$(1)/install
+       $(call PyPackage/$(1)/install,$$(1))
+       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+       $(SHELL) $(python_mk_path)python-package-install.sh "2" \
+               "$(PKG_INSTALL_DIR)" "$$(1)" \
+               "$(HOST_PYTHON_BIN)" "$$(2)" \
+               "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)"
+  endef
+
+  define Package/$(1)-src/install
+       $$(call Package/$(1)/install,$$(1),sources)
+  endef
+  endif # Package/$(1)/install
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPyRunTarget
+       $(call HostPython, \
+               $(if $(1),$(1);) \
+               CC="$(TARGET_CC)" \
+               CCSHARED="$(TARGET_CC) $(FPIC)" \
+               CXX="$(TARGET_CXX)" \
+               LD="$(TARGET_CC)" \
+               LDSHARED="$(TARGET_CC) -shared" \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON_INC_DIR)" \
+               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)" \
+               _PYTHON_HOST_PLATFORM=linux2 \
+               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
+               $(3) \
+               , \
+               $(2) \
+       )
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/PyMod
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+       $(call Build/Compile/HostPyRunTarget, \
+               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+endef
+
+define PyBuild/Compile/Default
+       $(foreach pkg,$(HOST_PYTHON_PACKAGE_BUILD_DEPENDS),
+               $(call host_python_pip_install_host,$(pkg))
+       )
+       $(call Build/Compile/PyMod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+               --single-version-externally-managed \
+       )
+endef
+
+PyBuild/Compile=$(PyBuild/Compile/Default)
+
+ifeq ($(BUILD_VARIANT),python)
+define Build/Compile
+       $(call PyBuild/Compile)
+endef
+endif # python
index 7686e383452ac161c08c7348a7d04ad03d51f0d1..cefc2cb8693f670f6d30d6db69e216fa7ecb0e3f 100644 (file)
@@ -32,7 +32,7 @@ PKG_CONFIG_DEPENDS:= \
 PKG_BUILD_DEPENDS:=python python/host
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-packages
   SUBMENU:=Python
index 11e231ab0aab7e22b88df2c00d5826b1bee32a30..ab915ac32affdb81a22967a95b6ea2198c8a300a 100644 (file)
@@ -22,8 +22,8 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index 712361aeb8262a5772e80ffe2454c1b48c88bce8..c1dc932c26da6cd7e0f0adf477c724cd91e0b615 100644 (file)
@@ -21,7 +21,7 @@ PKG_SOURCE_VERSION:=b91a418374d1636408c435f11799ef725ef70097
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-pcapy
        SECTION:=language-python
index 212fdb03be1cd5c2131043b5f8439c8ebb2d1519..1d42831a18935b8991638126f262a29574b7bc54 100644 (file)
@@ -22,8 +22,8 @@ PKG_LICENSE_FILES:=README.md
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index 270bc8aff00dc50d6fcb2544b4c9be26609dbfaa..4feaf39b4de1a43973c411299e8f6dcc1b0f2425 100644 (file)
@@ -22,7 +22,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/psycopg2-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=python/host
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-psycopg2
   SUBMENU:=Python
index c76e48a26eda32bb7195d9b124b36ce935218f51..1407053c3754a220871ee1561d9461d686fdd241 100644 (file)
@@ -22,8 +22,8 @@ PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleana
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyasn1-modules-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index 78f82c85d0427f24063688cdea6e53211a8f34bb..5b002eeebd1887d3580bb998d64edbf15c01c014 100644 (file)
@@ -22,8 +22,8 @@ PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleana
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyasn1-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index ffd54e7c01ed7f94bfc323641a22621bc96b2a86..7bdad5cc860c183e05f9b09f9e96120c2b5cecb9 100644 (file)
@@ -25,8 +25,8 @@ HOST_PYTHON_PACKAGE_BUILD_DEPENDS:="ply==3.10"
 HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="ply==3.10"
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index 6f427928f618fcf381aac06623fc09892f8796ca..f07b2b2e378c2310cd3f283b693c72e4f8a4afb0 100644 (file)
@@ -22,8 +22,8 @@ PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleana
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-pyopenssl-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
index 17ee7ade00558a490a1507475263d8ffd085653f..32c8971fbd737de47bbdfd89ec58fc4e0c7d8842 100644 (file)
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-pyptlib
        SECTION:=lang
index 803884cc780019123f97da3b899b955bdad03b37..2342b02430dd29e481b29c57ed49213b7c76049c 100644 (file)
@@ -21,7 +21,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/pyserial-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=python
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-pyserial
   SUBMENU:=Python
index df57dfe2175afd0c8a5ce5a01fc18f077915fbe3..1f4f32d4f6169e7282d0c73af21d922c1b314e36 100644 (file)
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-service-identity
        SECTION:=lang
index ff91bde1178266edaac9b24cb2035e859cf4cd8c..e59784064cf62e1af474e67002f6f9429a2a7e20 100644 (file)
@@ -25,8 +25,8 @@ PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>, Alexandru Ardelean <ardeleana
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 HOST_UNPACK:=$(HOST_TAR) -C $(HOST_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
index 9e6e716a3ea0154c38604a37e7fcf8ee5ed1df8a..c61586381279ff0c2aa6df01dfc14f422c0d8086 100644 (file)
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-txsocksx
        SECTION:=lang
index ecb215862a58aeb9f521226e1554433d0d49b9cb..e014fca099ab4aae9d176d2040cb79377127a618 100644 (file)
@@ -18,7 +18,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/ee/11/7c59620aceedcc1ef65e156cc
 PKG_HASH:=cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/python-urllib3
   SUBMENU:=Python
diff --git a/lang/python/python-version.mk b/lang/python/python-version.mk
new file mode 100644 (file)
index 0000000..200461d
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+PYTHON_VERSION:=2.7
+PYTHON_VERSION_MICRO:=14
+
+PYTHON_SETUPTOOLS_VERSION:=28.8.0
+PYTHON_PIP_VERSION:=9.0.1
+
index c6314c8b15e6f31a94382b38b7b0f11f608dbfa7..7846ce26710b4af71e5bdf4120c8ccaeee0a0a90 100644 (file)
@@ -23,8 +23,8 @@ 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)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../python-package.mk
+include ../python3-package.mk
 
 define Package/python-yaml/Default
   SUBMENU:=Python
index e7500f66d3b3d85b2c0f1677945024da050123b2..84415d6bf868e44182b2cd7beccc89efd9d9d983 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 # For PYTHON_VERSION
-include ./files/python-version.mk
+include ../python-version.mk
 
 PKG_NAME:=python
 PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
@@ -22,10 +22,10 @@ PKG_LICENSE:=PSF
 PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
 
 # This file provides the necsessary host build variables
-include ./files/python-host.mk
+include ../python-host.mk
 
 # For PyPackage
-include ./files/python-package.mk
+include ../python-package.mk
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -190,16 +190,6 @@ define Build/Compile
        $(call Build/Compile/python-pip)
 endef
 
-define Build/InstallMkFiles
-       $(INSTALL_DIR) $(STAGING_DIR)/mk/
-       $(INSTALL_DATA) \
-               ./files/python-package.mk \
-               ./files/python-host.mk \
-               ./files/python-version.mk \
-               ./files/python-package-install.sh \
-               $(STAGING_DIR)/mk/
-endef
-
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/ $(1)/usr/lib/pkgconfig
        $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
@@ -218,7 +208,6 @@ define Build/InstallDev
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
                $(1)/usr/lib/python$(PYTHON_VERSION)/
-       $(call Build/InstallMkFiles)
 endef
 
 PYTHON_BASE_LIB_FILES:= \
@@ -298,7 +287,6 @@ define Host/Compile
 endef
 
 define Host/Install
-       $(call Build/InstallMkFiles)
        $(MAKE) -C $(HOST_BUILD_DIR) install
        $(INSTALL_DIR) $(HOST_PYTHON_DIR)/bin/
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON_DIR)/bin/pgen2
diff --git a/lang/python/python/files/python-host.mk b/lang/python/python/files/python-host.mk
deleted file mode 100644 (file)
index e836eae..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-ifneq ($(__python_host_mk_inc),1)
-__python_host_mk_inc=1
-
-# For PYTHON_VERSION
-$(call include_mk, python-version.mk)
-
-HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
-HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
-HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
-
-HOST_PYTHON_PKG_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)/site-packages
-
-HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)
-
-HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(HOST_PYTHON_PKG_DIR)
-
-define HostPython
-       if [ "$(strip $(3))" == "HOST" ]; then \
-               export PYTHONPATH="$(HOST_PYTHONPATH)"; \
-               export PYTHONDONTWRITEBYTECODE=0; \
-       else \
-               export PYTHONPATH="$(PYTHONPATH)"; \
-               export PYTHONDONTWRITEBYTECODE=1; \
-               export _python_sysroot="$(STAGING_DIR)"; \
-               export _python_prefix="/usr"; \
-               export _python_exec_prefix="/usr"; \
-       fi; \
-       export PYTHONOPTIMIZE=""; \
-       $(1) \
-       $(HOST_PYTHON_BIN) $(2);
-endef
-
-define host_python_settings
-       ARCH="$(HOST_ARCH)" \
-       CC="$(HOSTCC)" \
-       CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
-       CXX="$(HOSTCXX)" \
-       LD="$(HOSTCC)" \
-       LDSHARED="$(HOSTCC) -shared" \
-       CFLAGS="$(HOST_CFLAGS)" \
-       CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
-       LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
-       _PYTHON_HOST_PLATFORM=linux2
-endef
-
-# $(1) => commands to execute before running pythons script
-# $(2) => python script and its arguments
-# $(3) => additional variables
-define Build/Compile/HostPyRunHost
-       $(call HostPython, \
-               $(if $(1),$(1);) \
-               $(call host_python_settings) \
-               $(3) \
-               , \
-               $(2) \
-               , \
-               HOST \
-       )
-endef
-
-# Note: I shamelessly copied this from Yousong's logic (from python-packages);
-HOST_PYTHON_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON_VERSION)
-define host_python_pip_install
-       $(call host_python_settings) \
-       $(HOST_PYTHON_PIP) install \
-               --root=$(1) \
-               --prefix=$(2) \
-               --ignore-installed \
-               $(3)
-endef
-
-define host_python_pip_install_host
-$(call host_python_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
-endef
-
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
-# $(3) => additional variables
-define Build/Compile/HostPyMod
-       $(call Build/Compile/HostPyRunHost, \
-               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
-               ./setup.py $(2), \
-               $(3))
-endef
-
-endif # __python_host_mk_inc
diff --git a/lang/python/python/files/python-package-install.sh b/lang/python/python/files/python-package-install.sh
deleted file mode 100644 (file)
index 60c1e27..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-set -e
-
-process_filespec() {
-       local src_dir="$1"
-       local dst_dir="$2"
-       local filespec="$3"
-       echo "$filespec" | (
-       IFS='|'
-       while read fop fspec fperm; do
-               local fop=`echo "$fop" | tr -d ' \t\n'`
-               if [ "$fop" = "+" ]; then
-                       if [ ! -e "${src_dir}${fspec}" ]; then
-                               echo "File not found '${src_dir}${fspec}'"
-                               exit 1
-                       fi
-                       dpath=`dirname "$fspec"`
-                       if [ -z "$fperm" ]; then
-                               dperm=`stat -c "%a" ${src_dir}${dpath}`
-                       fi
-                       mkdir -p -m$dperm ${dst_dir}${dpath}
-                       echo "copying: '$fspec'"
-                       cp -fpR ${src_dir}${fspec} ${dst_dir}${dpath}/
-                       if [ -n "$fperm" ]; then
-                               chmod -R $fperm ${dst_dir}${fspec}
-                       fi
-               elif [ "$fop" = "-" ]; then
-                       echo "removing: '$fspec'"
-                       rm -fR ${dst_dir}${fspec}
-               elif [ "$fop" = "=" ]; then
-                       echo "setting permissions: '$fperm' on '$fspec'"
-                       chmod -R $fperm ${dst_dir}${fspec}
-               fi
-       done
-       )
-}
-
-src_dir="$1"
-dst_dir="$2"
-python="$3"
-mode="$4"
-filespec="$5"
-
-process_filespec "$src_dir" "$dst_dir" "$filespec" || {
-       echo "process filespec error-ed"
-       exit 1
-}
-
-if [ "$mode" == "sources" ] ; then
-       # Copy only python source files
-       find $dst_dir -not -type d -not -name "*\.py" | xargs rm -f
-
-       # Delete empty folders (if the case)
-       if [ -d "$dst_dir/usr" ] ; then
-               find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
-               rmdir --ignore-fail-on-non-empty $dst_dir/usr
-       fi
-       exit 0
-fi
-
-# XXX [So that you won't goof as I did]
-# Note: Yes, I tried to use the -O & -OO flags here.
-#       However the generated byte-codes were not portable.
-#       So, we just stuck to un-optimized byte-codes,
-#       which is still way better/faster than running
-#       Python sources all the time.
-$python -m compileall -d '/' $dst_dir || {
-       echo "python -m compileall err-ed"
-       exit 1
-}
-
-# Delete source files and pyc [ un-optimized bytecode files ]
-# We may want to make this optimization thing configurable later, but not sure atm
-find $dst_dir -type f -name "*\.py" | xargs rm -f
-
-# Delete empty folders (if the case)
-if [ -d "$dst_dir/usr" ] ; then
-       find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
-       rmdir --ignore-fail-on-non-empty $dst_dir/usr
-fi
-
-exit 0
diff --git a/lang/python/python/files/python-package.mk b/lang/python/python/files/python-package.mk
deleted file mode 100644 (file)
index 9c231f6..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# Copyright (C) 2006-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-$(call include_mk, python-version.mk)
-
-PYTHON_DIR:=$(STAGING_DIR)/usr
-PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
-PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
-PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
-
-PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
-
-PYTHON:=python$(PYTHON_VERSION)
-
-PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
-
-# These configure args are needed in detection of path to Python header files
-# using autotools.
-CONFIGURE_ARGS += \
-       _python_sysroot="$(STAGING_DIR)" \
-       _python_prefix="/usr" \
-       _python_exec_prefix="/usr"
-
-PKG_USE_MIPS16:=0
-# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
-# flags are inherited from the Python base package (via sysconfig module)
-ifdef CONFIG_USE_MIPS16
-  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
-endif
-
-define PyPackage
-
-  define Package/$(1)-src
-    $(call Package/$(1))
-    TITLE+= (sources)
-    DEPENDS:=$$$$(foreach dep,$$$$(filter +python-%,$$$$(DEPENDS)),$$$$(dep)-src)
-  endef
-
-  define Package/$(1)-src/description
-    $(call Package/$(1)/description).
-    (Contains the Python sources for this package).
-  endef
-
-  # Add default PyPackage filespec none defined
-  ifndef PyPackage/$(1)/filespec
-    define PyPackage/$(1)/filespec
-      +|$(PYTHON_PKG_DIR)
-    endef
-  endif
-
-  ifndef PyPackage/$(1)/install
-    define PyPackage/$(1)/install
-               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
-                       $(INSTALL_DIR) $$(1)/usr/bin ; \
-                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
-               fi
-    endef
-  endif
-
-  ifndef Package/$(1)/install
-  $(call shexport,PyPackage/$(1)/filespec)
-
-  define Package/$(1)/install
-       $(call PyPackage/$(1)/install,$$(1))
-       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
-       if [ -e files/python-package-install.sh ] ; then \
-               $(SHELL) files/python-package-install.sh \
-                       "$(PKG_INSTALL_DIR)" "$$(1)" \
-                       "$(HOST_PYTHON_BIN)" "$$(2)" \
-                       "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" ; \
-       elif [ -e $(STAGING_DIR)/mk/python-package-install.sh ] ; then \
-               $(SHELL) $(STAGING_DIR)/mk/python-package-install.sh \
-                       "$(PKG_INSTALL_DIR)" "$$(1)" \
-                       "$(HOST_PYTHON_BIN)" "$$(2)" \
-                       "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" ; \
-       else \
-               echo "No 'python-package-install.sh' script found" ; \
-               exit 1 ; \
-       fi
-  endef
-
-  define Package/$(1)-src/install
-       $$(call Package/$(1)/install,$$(1),sources)
-  endef
-  endif # Package/$(1)/install
-endef
-
-$(call include_mk, python-host.mk)
-
-# $(1) => commands to execute before running pythons script
-# $(2) => python script and its arguments
-# $(3) => additional variables
-define Build/Compile/HostPyRunTarget
-       $(call HostPython, \
-               $(if $(1),$(1);) \
-               CC="$(TARGET_CC)" \
-               CCSHARED="$(TARGET_CC) $(FPIC)" \
-               CXX="$(TARGET_CXX)" \
-               LD="$(TARGET_CC)" \
-               LDSHARED="$(TARGET_CC) -shared" \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON_INC_DIR)" \
-               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)" \
-               _PYTHON_HOST_PLATFORM=linux2 \
-               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
-               $(3) \
-               , \
-               $(2) \
-       )
-endef
-
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
-# $(3) => additional variables
-define Build/Compile/PyMod
-       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
-       $(call Build/Compile/HostPyRunTarget, \
-               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
-               ./setup.py $(2), \
-               $(3))
-       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
-endef
-
-define PyBuild/Compile/Default
-       $(foreach pkg,$(HOST_PYTHON_PACKAGE_BUILD_DEPENDS),
-               $(call host_python_pip_install_host,$(pkg))
-       )
-       $(call Build/Compile/PyMod,, \
-               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
-               --single-version-externally-managed \
-       )
-endef
-
-PyBuild/Compile=$(PyBuild/Compile/Default)
-
-ifeq ($(BUILD_VARIANT),python)
-define Build/Compile
-       $(call PyBuild/Compile)
-endef
-endif # python
diff --git a/lang/python/python/files/python-version.mk b/lang/python/python/files/python-version.mk
deleted file mode 100644 (file)
index 200461d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Copyright (C) 2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-PYTHON_VERSION:=2.7
-PYTHON_VERSION_MICRO:=14
-
-PYTHON_SETUPTOOLS_VERSION:=28.8.0
-PYTHON_PIP_VERSION:=9.0.1
-
index 8436c3a7914702c1184c0f52e593fd4a011c2114..f35913cbcbd4c4860cfb520f2001b890c5f713cf 100644 (file)
@@ -21,7 +21,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/bottle-$(PKG_VERSION)
 PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python3-package.mk)
+include ../python3-package.mk
 
 define Package/python3-bottle
        SECTION:=lang
diff --git a/lang/python/python3-host.mk b/lang/python/python3-host.mk
new file mode 100644 (file)
index 0000000..2a418d5
--- /dev/null
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
+#       if `python3-package.mk` is included, this will already be included
+
+ifneq ($(__python3_host_mk_inc),1)
+__python3_host_mk_inc=1
+
+# For PYTHON3_VERSION
+python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
+include $(python3_mk_path)python3-version.mk
+
+HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
+HOST_PYTHON3_INC_DIR:=$(HOST_PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
+HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
+
+HOST_PYTHON3_PKG_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)/site-packages
+
+HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION)
+
+HOST_PYTHON3PATH:=$(HOST_PYTHON3_LIB_DIR):$(HOST_PYTHON3_PKG_DIR)
+
+define HostPython3
+       if [ "$(strip $(3))" == "HOST" ]; then \
+               export PYTHONPATH="$(HOST_PYTHON3PATH)"; \
+               export PYTHONDONTWRITEBYTECODE=0; \
+       else \
+               export PYTHONPATH="$(PYTHON3PATH)"; \
+               export PYTHONDONTWRITEBYTECODE=1; \
+               export _python_sysroot="$(STAGING_DIR)"; \
+               export _python_prefix="/usr"; \
+               export _python_exec_prefix="/usr"; \
+       fi; \
+       export PYTHONOPTIMIZE=""; \
+       $(1) \
+       $(HOST_PYTHON3_BIN) $(2);
+endef
+
+define host_python3_settings
+       ARCH="$(HOST_ARCH)" \
+       CC="$(HOSTCC)" \
+       CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
+       CXX="$(HOSTCXX)" \
+       LD="$(HOSTCC)" \
+       LDSHARED="$(HOSTCC) -shared" \
+       CFLAGS="$(HOST_CFLAGS)" \
+       CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
+       LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
+       _PYTHON_HOST_PLATFORM=linux2
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPy3RunHost
+       $(call HostPython3, \
+               $(if $(1),$(1);) \
+               $(call host_python3_settings) \
+               $(3) \
+               , \
+               $(2) \
+               , \
+               HOST \
+       )
+endef
+
+# Note: I shamelessly copied this from Yousong's logic (from python-packages);
+HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
+define host_python3_pip_install
+       $(call host_python3_settings) \
+       $(HOST_PYTHON3_PIP) install \
+               --root=$(1) \
+               --prefix=$(2) \
+               --ignore-installed \
+               $(3)
+endef
+
+define host_python3_pip_install_host
+$(call host_python3_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/HostPy3Mod
+       $(call Build/Compile/HostPy3RunHost, \
+               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+endef
+
+endif # __python3_host_mk_inc
diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk
new file mode 100644 (file)
index 0000000..c5bfd71
--- /dev/null
@@ -0,0 +1,134 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
+python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
+include $(python3_mk_path)python3-host.mk
+
+PYTHON3_DIR:=$(STAGING_DIR)/usr
+PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
+PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
+PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
+
+PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
+
+PYTHON3:=python$(PYTHON3_VERSION)
+
+PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
+
+# These configure args are needed in detection of path to Python header files
+# using autotools.
+CONFIGURE_ARGS += \
+       _python_sysroot="$(STAGING_DIR)" \
+       _python_prefix="/usr" \
+       _python_exec_prefix="/usr"
+
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
+define Py3Package
+
+  define Package/$(1)-src
+    $(call Package/$(1))
+    TITLE+= (sources)
+    DEPENDS:=$$$$(foreach dep,$$$$(filter +python3-%,$$$$(DEPENDS)),$$$$(dep)-src)
+  endef
+
+  define Package/$(1)-src/description
+    $(call Package/$(1)/description).
+    (Contains the Python3 sources for this package).
+  endef
+
+  # Add default PyPackage filespec none defined
+  ifndef Py3Package/$(1)/filespec
+    define Py3Package/$(1)/filespec
+      +|$(PYTHON3_PKG_DIR)
+    endef
+  endif
+
+  ifndef Py3Package/$(1)/install
+    define Py3Package/$(1)/install
+               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
+                       $(INSTALL_DIR) $$(1)/usr/bin ; \
+                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
+               fi
+    endef
+  endif
+
+  ifndef Package/$(1)/install
+  $(call shexport,Py3Package/$(1)/filespec)
+
+  define Package/$(1)/install
+       $(call Py3Package/$(1)/install,$$(1))
+       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+       $(SHELL) $(python3_mk_path)python-package-install.sh "3" \
+               "$(PKG_INSTALL_DIR)" "$$(1)" \
+               "$(HOST_PYTHON3_BIN)" "$$(2)" \
+               "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)"
+  endef
+
+  define Package/$(1)-src/install
+       $$(call Package/$(1)/install,$$(1),sources)
+  endef
+  endif # Package/$(1)/install
+endef
+
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
+# $(3) => additional variables
+define Build/Compile/HostPy3RunTarget
+       $(call HostPython3, \
+               $(if $(1),$(1);) \
+               CC="$(TARGET_CC)" \
+               CCSHARED="$(TARGET_CC) $(FPIC)" \
+               CXX="$(TARGET_CXX)" \
+               LD="$(TARGET_CC)" \
+               LDSHARED="$(TARGET_CC) -shared" \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
+               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
+               _PYTHON_HOST_PLATFORM=linux2 \
+               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
+               $(3) \
+               , \
+               $(2) \
+       )
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/Py3Mod
+       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
+       $(call Build/Compile/HostPy3RunTarget, \
+               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
+               ./setup.py $(2), \
+               $(3))
+       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
+endef
+
+define Py3Build/Compile/Default
+       $(foreach pkg,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
+               $(call host_python3_pip_install_host,$(pkg))
+       )
+       $(call Build/Compile/Py3Mod,, \
+               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
+               --single-version-externally-managed \
+       )
+endef
+
+Py3Build/Compile=$(Py3Build/Compile/Default)
+
+ifeq ($(BUILD_VARIANT),python3)
+define Build/Compile
+       $(call Py3Build/Compile)
+endef
+endif # python3
diff --git a/lang/python/python3-version.mk b/lang/python/python3-version.mk
new file mode 100644 (file)
index 0000000..e42eeb8
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# Note: keep in sync with setuptools & pip
+PYTHON3_VERSION_MAJOR:=3
+PYTHON3_VERSION_MINOR:=6
+PYTHON3_VERSION_MICRO:=4
+
+PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
+
+PYTHON3_SETUPTOOLS_VERSION:=28.8.0
+PYTHON3_PIP_VERSION:=9.0.1
+
index 7ab3c51dacc770170f409e681cb8d3f6f3c6094d..dbda239abea34f20ae7174ac92d4ee6fb6365756 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 # The file included below defines PYTHON_VERSION
-include ./files/python3-version.mk
+include ../python3-version.mk
 
 PYTHON_VERSION:=$(PYTHON3_VERSION)
 PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
@@ -25,10 +25,10 @@ PKG_LICENSE:=PSF
 PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
 
 # This file provides the necsessary host build variables
-include ./files/python3-host.mk
+include ../python3-host.mk
 
 # For Py3Package
-include ./files/python3-package.mk
+include ../python3-package.mk
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
@@ -194,16 +194,6 @@ define Build/Compile
        $(call Build/Compile/python3-pip)
 endef
 
-define Build/InstallMkFiles
-       $(INSTALL_DIR) $(STAGING_DIR)/mk/
-       $(INSTALL_DATA) \
-               ./files/python3-package.mk \
-               ./files/python3-host.mk \
-               ./files/python3-version.mk \
-               ./files/python3-package-install.sh \
-               $(STAGING_DIR)/mk/
-endef
-
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
@@ -217,7 +207,6 @@ define Build/InstallDev
        $(CP) \
                $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
                $(1)/usr/lib/python$(PYTHON_VERSION)/
-       $(call Build/InstallMkFiles)
 endef
 
 PYTHON3_BASE_LIB_FILES:= \
@@ -295,7 +284,6 @@ define Host/Compile
 endef
 
 define Host/Install
-       $(call Build/InstallMkFiles)
        $(MAKE) -C $(HOST_BUILD_DIR) install
        $(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON3_DIR)/bin/pgen3
diff --git a/lang/python/python3/files/python3-host.mk b/lang/python/python3/files/python3-host.mk
deleted file mode 100644 (file)
index 4990d33..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#
-# Copyright (C) 2017 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-ifneq ($(__python3_host_mk_inc),1)
-__python3_host_mk_inc=1
-
-# For PYTHON3_VERSION
-$(call include_mk, python3-version.mk)
-
-HOST_PYTHON3_DIR:=$(STAGING_DIR_HOSTPKG)
-HOST_PYTHON3_INC_DIR:=$(HOST_PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
-HOST_PYTHON3_LIB_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
-
-HOST_PYTHON3_PKG_DIR:=$(HOST_PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)/site-packages
-
-HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION)
-
-HOST_PYTHON3PATH:=$(HOST_PYTHON3_LIB_DIR):$(HOST_PYTHON3_PKG_DIR)
-
-define HostPython3
-       if [ "$(strip $(3))" == "HOST" ]; then \
-               export PYTHONPATH="$(HOST_PYTHON3PATH)"; \
-               export PYTHONDONTWRITEBYTECODE=0; \
-       else \
-               export PYTHONPATH="$(PYTHON3PATH)"; \
-               export PYTHONDONTWRITEBYTECODE=1; \
-               export _python_sysroot="$(STAGING_DIR)"; \
-               export _python_prefix="/usr"; \
-               export _python_exec_prefix="/usr"; \
-       fi; \
-       export PYTHONOPTIMIZE=""; \
-       $(1) \
-       $(HOST_PYTHON3_BIN) $(2);
-endef
-
-define host_python3_settings
-       ARCH="$(HOST_ARCH)" \
-       CC="$(HOSTCC)" \
-       CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
-       CXX="$(HOSTCXX)" \
-       LD="$(HOSTCC)" \
-       LDSHARED="$(HOSTCC) -shared" \
-       CFLAGS="$(HOST_CFLAGS)" \
-       CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
-       LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
-       _PYTHON_HOST_PLATFORM=linux2
-endef
-
-# $(1) => commands to execute before running pythons script
-# $(2) => python script and its arguments
-# $(3) => additional variables
-define Build/Compile/HostPy3RunHost
-       $(call HostPython3, \
-               $(if $(1),$(1);) \
-               $(call host_python3_settings) \
-               $(3) \
-               , \
-               $(2) \
-               , \
-               HOST \
-       )
-endef
-
-# Note: I shamelessly copied this from Yousong's logic (from python-packages);
-HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
-define host_python3_pip_install
-       $(call host_python3_settings) \
-       $(HOST_PYTHON3_PIP) install \
-               --root=$(1) \
-               --prefix=$(2) \
-               --ignore-installed \
-               $(3)
-endef
-
-define host_python3_pip_install_host
-$(call host_python3_pip_install,$(STAGING_DIR_HOSTPKG),"",$(1))
-endef
-
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
-# $(3) => additional variables
-define Build/Compile/HostPy3Mod
-       $(call Build/Compile/HostPy3RunHost, \
-               cd $(HOST_BUILD_DIR)/$(strip $(1)), \
-               ./setup.py $(2), \
-               $(3))
-endef
-
-endif # __python3_host_mk_inc
diff --git a/lang/python/python3/files/python3-package-install.sh b/lang/python/python3/files/python3-package-install.sh
deleted file mode 100644 (file)
index 373f315..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-set -e
-
-process_filespec() {
-       local src_dir="$1"
-       local dst_dir="$2"
-       local filespec="$3"
-       echo "$filespec" | (
-       IFS='|'
-       while read fop fspec fperm; do
-               local fop=`echo "$fop" | tr -d ' \t\n'`
-               if [ "$fop" = "+" ]; then
-                       if [ ! -e "${src_dir}${fspec}" ]; then
-                               echo "File not found '${src_dir}${fspec}'"
-                               exit 1
-                       fi
-                       dpath=`dirname "$fspec"`
-                       if [ -z "$fperm" ]; then
-                               dperm=`stat -c "%a" ${src_dir}${dpath}`
-                       fi
-                       mkdir -p -m$dperm ${dst_dir}${dpath}
-                       echo "copying: '$fspec'"
-                       cp -fpR ${src_dir}${fspec} ${dst_dir}${dpath}/
-                       if [ -n "$fperm" ]; then
-                               chmod -R $fperm ${dst_dir}${fspec}
-                       fi
-               elif [ "$fop" = "-" ]; then
-                       echo "removing: '$fspec'"
-                       rm -fR ${dst_dir}${fspec}
-               elif [ "$fop" = "=" ]; then
-                       echo "setting permissions: '$fperm' on '$fspec'"
-                       chmod -R $fperm ${dst_dir}${fspec}
-               fi
-       done
-       )
-}
-
-src_dir="$1"
-dst_dir="$2"
-python="$3"
-mode="$4"
-filespec="$5"
-
-process_filespec "$src_dir" "$dst_dir" "$filespec" || {
-       echo "process filespec error-ed"
-       exit 1
-}
-
-if [ "$mode" == "sources" ] ; then
-       # Copy only python source files
-       find $dst_dir -not -type d -not -name "*\.py" | xargs rm -f
-
-       # Delete empty folders (if the case)
-       if [ -d "$dst_dir/usr" ] ; then
-               find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
-               rmdir --ignore-fail-on-non-empty $dst_dir/usr
-       fi
-       exit 0
-fi
-
-# XXX [So that you won't goof as I did]
-# Note: Yes, I tried to use the -O & -OO flags here.
-#       However the generated byte-codes were not portable.
-#       So, we just stuck to un-optimized byte-codes,
-#       which is still way better/faster than running
-#       Python sources all the time.
-$python -m compileall -b -d '/' $dst_dir || {
-       echo "python -m compileall err-ed"
-       exit 1
-}
-
-# Delete source files and pyc [ un-optimized bytecode files ]
-# We may want to make this optimization thing configurable later, but not sure atm
-find $dst_dir -type f -name "*\.py" | xargs rm -f
-
-# Delete empty folders (if the case)
-if [ -d "$dst_dir/usr" ] ; then
-       find $dst_dir/usr -type d | xargs rmdir --ignore-fail-on-non-empty
-       rmdir --ignore-fail-on-non-empty $dst_dir/usr
-fi
-
-exit 0
diff --git a/lang/python/python3/files/python3-package.mk b/lang/python/python3/files/python3-package.mk
deleted file mode 100644 (file)
index 93b14fa..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-$(call include_mk, python3-version.mk)
-
-PYTHON3_DIR:=$(STAGING_DIR)/usr
-PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
-PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
-PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
-
-PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
-
-PYTHON3:=python$(PYTHON3_VERSION)
-
-PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
-
-# These configure args are needed in detection of path to Python header files
-# using autotools.
-CONFIGURE_ARGS += \
-       _python_sysroot="$(STAGING_DIR)" \
-       _python_prefix="/usr" \
-       _python_exec_prefix="/usr"
-
-PKG_USE_MIPS16:=0
-# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
-# flags are inherited from the Python base package (via sysconfig module)
-ifdef CONFIG_USE_MIPS16
-  TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
-endif
-
-define Py3Package
-
-  define Package/$(1)-src
-    $(call Package/$(1))
-    TITLE+= (sources)
-    DEPENDS:=$$$$(foreach dep,$$$$(filter +python3-%,$$$$(DEPENDS)),$$$$(dep)-src)
-  endef
-
-  define Package/$(1)-src/description
-    $(call Package/$(1)/description).
-    (Contains the Python3 sources for this package).
-  endef
-
-  # Add default PyPackage filespec none defined
-  ifndef Py3Package/$(1)/filespec
-    define Py3Package/$(1)/filespec
-      +|$(PYTHON3_PKG_DIR)
-    endef
-  endif
-
-  ifndef Py3Package/$(1)/install
-    define Py3Package/$(1)/install
-               if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
-                       $(INSTALL_DIR) $$(1)/usr/bin ; \
-                       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
-               fi
-    endef
-  endif
-
-  ifndef Package/$(1)/install
-  $(call shexport,Py3Package/$(1)/filespec)
-
-  define Package/$(1)/install
-       $(call Py3Package/$(1)/install,$$(1))
-       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
-       if [ -e files/python3-package-install.sh ] ; then \
-               $(SHELL) files/python3-package-install.sh \
-                       "$(PKG_INSTALL_DIR)" "$$(1)" \
-                       "$(HOST_PYTHON3_BIN)" "$$(2)" \
-                       "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" ; \
-       elif [ -e $(STAGING_DIR)/mk/python3-package-install.sh ] ; then \
-               $(SHELL) $(STAGING_DIR)/mk/python3-package-install.sh \
-                       "$(PKG_INSTALL_DIR)" "$$(1)" \
-                       "$(HOST_PYTHON3_BIN)" "$$(2)" \
-                       "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" ; \
-       else \
-               echo "No 'python3-package-install.sh' script found" ; \
-               exit 1 ; \
-       fi
-  endef
-
-  define Package/$(1)-src/install
-       $$(call Package/$(1)/install,$$(1),sources)
-  endef
-  endif # Package/$(1)/install
-endef
-
-$(call include_mk, python3-host.mk)
-
-# $(1) => commands to execute before running pythons script
-# $(2) => python script and its arguments
-# $(3) => additional variables
-define Build/Compile/HostPy3RunTarget
-       $(call HostPython3, \
-               $(if $(1),$(1);) \
-               CC="$(TARGET_CC)" \
-               CCSHARED="$(TARGET_CC) $(FPIC)" \
-               CXX="$(TARGET_CXX)" \
-               LD="$(TARGET_CC)" \
-               LDSHARED="$(TARGET_CC) -shared" \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
-               LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
-               _PYTHON_HOST_PLATFORM=linux2 \
-               __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
-               $(3) \
-               , \
-               $(2) \
-       )
-endef
-
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
-# $(3) => additional variables
-define Build/Compile/Py3Mod
-       $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
-       $(call Build/Compile/HostPy3RunTarget, \
-               cd $(PKG_BUILD_DIR)/$(strip $(1)), \
-               ./setup.py $(2), \
-               $(3))
-       find $(PKG_INSTALL_DIR) -name "*\.exe" | xargs rm -f
-endef
-
-define Py3Build/Compile/Default
-       $(foreach pkg,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
-               $(call host_python3_pip_install_host,$(pkg))
-       )
-       $(call Build/Compile/Py3Mod,, \
-               install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
-               --single-version-externally-managed \
-       )
-endef
-
-Py3Build/Compile=$(Py3Build/Compile/Default)
-
-ifeq ($(BUILD_VARIANT),python3)
-define Build/Compile
-       $(call Py3Build/Compile)
-endef
-endif # python3
diff --git a/lang/python/python3/files/python3-version.mk b/lang/python/python3/files/python3-version.mk
deleted file mode 100644 (file)
index e42eeb8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2007-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-# Note: keep in sync with setuptools & pip
-PYTHON3_VERSION_MAJOR:=3
-PYTHON3_VERSION_MINOR:=6
-PYTHON3_VERSION_MICRO:=4
-
-PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
-
-PYTHON3_SETUPTOOLS_VERSION:=28.8.0
-PYTHON3_PIP_VERSION:=9.0.1
-
index 3843653e5a747326f7c7bb42f3777a3dbdc3fd7e..4d9c3fd40f796e074eda69b740de6c6b3af177df 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/a4/09/c47e57fc9c7062b4e83b075d4
 PKG_HASH:=f5c056e8f62d45ba8215e5cb8f50dfccb198b4b9fbea8500674f3443e4689589
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/pytz
   SUBMENU:=Python
index 10c43439424515c8113aa103eab32bef960bac2a..804b585764a267bbba7ef6b15871b911383fa21b 100644 (file)
@@ -20,7 +20,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MIRROR_HASH:=a52728cc5653bf3c2a2f92954c6001338442a6e589bd364c497ba615c4365211
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/rcssmin
     SUBMENU:=Python
index 21f051ff3def8702b1596bed37d5e0f9a6306c10..aa4c662129fcffb278f8b35137262e358a4a7fd8 100644 (file)
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://pypi.python.org/packages/08/48/c97b668d6da7d7bebe7ea1817
 PKG_HASH:=01a22d49ddd9a168b136f26cac87d9a335660ce07aa5c630b8e3607d6f4325e7
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/simplejson
   SUBMENU:=Python
index 997e9718fa86da3be685131cf434ccf0c0412d69..210569d2b3281c143344cb6cfc431aa41a0f2ee3 100644 (file)
@@ -24,7 +24,7 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/twisted
   SUBMENU:=Python
index 737a6354ee6eff39eb4bf486bfaabde03ab2d6e9..d9a41a35241bf0813ee0f652beee36b1afdf55b4 100644 (file)
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=LICENSE.txt
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../python-package.mk
 
 define Package/zope-interface
   SECTION:=lang
index ddc863813783be2dbbd75a03327db4819190fd54..b0d49838e8532ea9412b5f5cb278bf5b47b6ea77 100644 (file)
@@ -27,7 +27,7 @@ PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/libimobiledevice/Default
   TITLE:=A library that talks to Apple devices.
index bf05c6d92454d5e08212f81d3411f00303f577d6..b6cba662451d32d416ffae96bebe2e23fec4af36 100644 (file)
@@ -23,7 +23,7 @@ PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/libsearpc
     SECTION:=libs
index 0e6e2ccae28650b62193ff659cef7fd92d7cd721..7b59594119a4068dd64c2c088793d114a7578226 100644 (file)
@@ -21,7 +21,7 @@ PKG_MIRROR_HASH:=cb0b4bb7a210091d807ee8e4a2876865f32a9bf195836eb2e1edf6c5975d113
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/danish
        SECTION:=net
index 80f0e02a3bd53e15a81d65002a37f44325bd3bd1..fbf308e412b728af5bbb58a1e686dc2ebbe8b8e7 100644 (file)
@@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/obfsproxy
        SECTION:=net
index 6e8baa475b7e46b47ba9b7b7925edf7f895d0571..ee3cd0aaaa7ba91c8b191663ef571dcdb71c78c4 100644 (file)
@@ -32,7 +32,7 @@ PKG_INSTALL:=1
 SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3||LINUX_4_4||LINUX_4_9
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/openvswitch/Default
   SECTION:=net
index b3f60d183b7e05d5f2519c755c2edbd58c394f5d..513e0bbac8a121c42b123f993dc9e329866329f3 100644 (file)
@@ -22,8 +22,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../../lang/python/python-package.mk
+include ../../lang/python/python3-package.mk
 
 # no default dependencies
 PKG_DEFAULT_DEPENDS:=
index ea066525e08418fda2ebda1c0c118add7eb0a42a..c03a14e857459618275b8d5502621e4173147c50 100644 (file)
@@ -18,7 +18,7 @@ PKG_SOURCE_URL:=https://bitbucket.org/secdev/scapy/downloads/
 PKG_HASH:=8972c02e39a826a10c02c2bdd5025f7251dce9589c57befd9bb55c65f02e4934
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/scapy
   SECTION:=net
index 30def93ea1158b07cabfc05cfd943661005675bb..64603ed8fe551dd25a9ca674ec124fc3148342f9 100644 (file)
@@ -23,7 +23,7 @@ PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/seafile-ccnet
     SECTION:=net
index 332739caee8b2546149a73a4b3b5bb16b74fce9d..2cf27aef1f1cb2fbb724196c0263d9e1e08d8594 100644 (file)
@@ -20,7 +20,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 PKG_MIRROR_HASH:=511500c40dd7b1009f77109c6df810df1cf2c17a84a8f6841d592a9e05d22064
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/seafile-seahub
     SECTION:=net
index c25f3d5552275c4495294e17f1ba2258605d6e38..efae34d131262ceefd22af0847f84c1f55e415e7 100644 (file)
@@ -3,7 +3,7 @@ diff -rupN seafile-seahub-6.2.2.orig/Makefile seafile-seahub-6.2.2/Makefile
 +++ seafile-seahub-6.2.2/Makefile      2017-10-22 22:46:18.007470936 +0200
 @@ -1,3 +1,6 @@
 +include $(TOPDIR)/rules.mk
-+$(call include_mk, python-package.mk)
++include $(TOPDIR)/feeds/packages/lang/python/python-package.mk
 +
  PROJECT=seahub
  
index 0a0506b38fa51d3ef36384ba83d85034ed7497ee..12b2b2c471a0f2249a8dda93bc9aa53a258aab90 100644 (file)
@@ -23,7 +23,7 @@ PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
-$(call include_mk, python-package.mk)
+include ../../lang/python/python-package.mk
 
 define Package/seafile-server
     SECTION:=net
index c98ab8bbe7aefec1e1854c4a79ec56e86f96eb16..88dd6b3f6aeecdcd85075f83c1d68300ace37937 100644 (file)
@@ -25,8 +25,8 @@ PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
-$(call include_mk, python-package.mk)
-$(call include_mk, python3-package.mk)
+include ../../lang/python/python-package.mk
+include ../../lang/python/python3-package.mk
 
 define Package/i2c/Default
   URL:=http://lm-sensors.org/wiki/I2CTools