aboutsummaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorAlexandru Ardelean <ardeleanalex@gmail.com>2018-01-10 09:29:41 +0200
committerAlexandru Ardelean <ardeleanalex@gmail.com>2018-01-10 23:01:51 +0200
commitccdc6bc530444283a510ceb6a50878493fe356f2 (patch)
tree4bbde4652f654ab7b47611c450d717f67e3c1d43 /lang
parent55c0b5ae19afa8d160c6ccf10869c22fd3bd0c03 (diff)
python,python3: export mk files outside of python package dirs
Since `lang/python` is it's own folder of Python packages (for both Python 2 & 3), and these build rules are needed in a lot of packages [especially Python packages], putting them here makes sense architecturally, to be shared. This also helps get rid of the `include_mk` construct which relies on OpenWrt core to provide, and seems like a broken design idea that has persisted for a while. Reason is: it requires that Python 2/3 be built to provide these mk files for other Python packages, which seems like a bad idea. Long-term, there could be an issue where some other feeds would require these mk files [e.g. telephony] for some Python packages. We'll see how we handle this a bit later. For now we limit this to this feed. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Diffstat (limited to 'lang')
-rw-r--r--lang/python/python-host.mk (renamed from lang/python/python/files/python-host.mk)6
-rw-r--r--lang/python/python-package-install.sh (renamed from lang/python/python/files/python-package-install.sh)0
-rw-r--r--lang/python/python-package.mk (renamed from lang/python/python/files/python-package.mk)7
-rw-r--r--lang/python/python-version.mk (renamed from lang/python/python/files/python-version.mk)0
-rw-r--r--lang/python/python/Makefile6
-rw-r--r--lang/python/python3-host.mk (renamed from lang/python/python3/files/python3-host.mk)6
-rw-r--r--lang/python/python3-package-install.sh (renamed from lang/python/python3/files/python3-package-install.sh)0
-rw-r--r--lang/python/python3-package.mk (renamed from lang/python/python3/files/python3-package.mk)6
-rw-r--r--lang/python/python3-version.mk (renamed from lang/python/python3/files/python3-version.mk)0
-rw-r--r--lang/python/python3/Makefile6
10 files changed, 23 insertions, 14 deletions
diff --git a/lang/python/python/files/python-host.mk b/lang/python/python-host.mk
index e836eae71..d4dc81fa9 100644
--- a/lang/python/python/files/python-host.mk
+++ b/lang/python/python-host.mk
@@ -5,11 +5,15 @@
# 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
-$(call include_mk, python-version.mk)
+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)
diff --git a/lang/python/python/files/python-package-install.sh b/lang/python/python-package-install.sh
index 60c1e273c..60c1e273c 100644
--- a/lang/python/python/files/python-package-install.sh
+++ b/lang/python/python-package-install.sh
diff --git a/lang/python/python/files/python-package.mk b/lang/python/python-package.mk
index 9c231f6ec..2bcae919e 100644
--- a/lang/python/python/files/python-package.mk
+++ b/lang/python/python-package.mk
@@ -5,7 +5,10 @@
# See /LICENSE for more information.
#
-$(call include_mk, python-version.mk)
+# 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
@@ -89,8 +92,6 @@ define PyPackage
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
diff --git a/lang/python/python/files/python-version.mk b/lang/python/python-version.mk
index 200461d4f..200461d4f 100644
--- a/lang/python/python/files/python-version.mk
+++ b/lang/python/python-version.mk
diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile
index 3c7b3bf6c..84415d6bf 100644
--- a/lang/python/python/Makefile
+++ b/lang/python/python/Makefile
@@ -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
diff --git a/lang/python/python3/files/python3-host.mk b/lang/python/python3-host.mk
index 4990d33a0..2a418d504 100644
--- a/lang/python/python3/files/python3-host.mk
+++ b/lang/python/python3-host.mk
@@ -5,11 +5,15 @@
# 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
-$(call include_mk, python3-version.mk)
+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)
diff --git a/lang/python/python3/files/python3-package-install.sh b/lang/python/python3-package-install.sh
index 373f315a1..373f315a1 100644
--- a/lang/python/python3/files/python3-package-install.sh
+++ b/lang/python/python3-package-install.sh
diff --git a/lang/python/python3/files/python3-package.mk b/lang/python/python3-package.mk
index 93b14fac2..25d98342a 100644
--- a/lang/python/python3/files/python3-package.mk
+++ b/lang/python/python3-package.mk
@@ -5,7 +5,9 @@
# See /LICENSE for more information.
#
-$(call include_mk, python3-version.mk)
+# 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
@@ -89,8 +91,6 @@ define Py3Package
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
diff --git a/lang/python/python3/files/python3-version.mk b/lang/python/python3-version.mk
index e42eeb8a0..e42eeb8a0 100644
--- a/lang/python/python3/files/python3-version.mk
+++ b/lang/python/python3-version.mk
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
index 6c293ef4d..dbda239ab 100644
--- a/lang/python/python3/Makefile
+++ b/lang/python/python3/Makefile
@@ -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