summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2019-06-09 14:05:55 +0800
committerJeffery To <jeffery.to@gmail.com>2019-06-10 20:33:06 +0800
commit64959a1dd07b40e3757eed100f6580f151a9adc4 (patch)
treef463e04633abd4674c0795413c59afadfcb0f171 /lang/python
parent1c4b6fef5f57364d65fda1c1e072cc960e9d3dfb (diff)
python,python3: Move python-config to $(STAGING_DIR)/host
Build/InstallDev is passed a second argument, a path where host binaries should be placed (ultimately $(STAGING_DIR)/host). This change moves python[3]-config to that directory. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'lang/python')
-rw-r--r--lang/python/python/Makefile7
-rw-r--r--lang/python/python/files/python-config.in3
-rw-r--r--lang/python/python3/Makefile7
3 files changed, 10 insertions, 7 deletions
diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile
index 9aea532b0..3bf5cbacd 100644
--- a/lang/python/python/Makefile
+++ b/lang/python/python/Makefile
@@ -205,7 +205,7 @@ endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
- $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_DIR) $(2)/bin
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)-openwrt
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
@@ -219,10 +219,11 @@ define Build/InstallDev
$(1)/usr/lib/pkgconfig
$(INSTALL_BIN) \
./files/python-config.in \
- $(1)/usr/bin/python$(PYTHON_VERSION)-config
+ $(2)/bin/python$(PYTHON_VERSION)-config
$(SED) \
's|@EXENAME@|$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)|' \
- $(1)/usr/bin/python$(PYTHON_VERSION)-config
+ -e 's|@TARGET_PREFIX@|$(PYTHON_DIR)|' \
+ $(2)/bin/python$(PYTHON_VERSION)-config
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py \
$(1)/usr/lib/python$(PYTHON_VERSION)-openwrt/_sysconfigdatatarget.py
diff --git a/lang/python/python/files/python-config.in b/lang/python/python/files/python-config.in
index 46f6c9cd4..c4a9c27ad 100644
--- a/lang/python/python/files/python-config.in
+++ b/lang/python/python/files/python-config.in
@@ -8,8 +8,7 @@ from distutils import sysconfig
# start changes
host_prefix = sysconfig.PREFIX
-target_bin_dir = os.path.dirname(os.path.abspath(__file__))
-target_prefix = os.path.normpath(os.path.join(target_bin_dir, '..'))
+target_prefix = '@TARGET_PREFIX@'
target_data_dir = os.path.join(target_prefix, 'lib', 'python' + sysconfig.get_config_var('VERSION') + '-openwrt')
sys.path.append(target_data_dir)
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
index 11ee77f09..34ba31fb0 100644
--- a/lang/python/python3/Makefile
+++ b/lang/python/python3/Makefile
@@ -209,7 +209,7 @@ endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
- $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_DIR) $(2)/bin
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(1)/usr/include/
@@ -222,7 +222,10 @@ define Build/InstallDev
$(1)/usr/lib/pkgconfig
$(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON_VERSION)-config \
- $(1)/usr/bin/
+ $(2)/bin/
+ $(SED) \
+ 's|^prefix_real=.*$$$$|prefix_real="$(PYTHON3_DIR)"|' \
+ $(2)/bin/python$(PYTHON_VERSION)-config
endef
PYTHON3_BASE_LIB_FILES:= \