Skip to content
Snippets Groups Projects
Verified Commit c75e5831 authored by Karel Koci's avatar Karel Koci :metal:
Browse files

patches/packages: try to drop python packages

Let's see if upstream fixed problems we had. These no longer apply so we
would have to reimplement them anyway.
parent 1cfb7ecc
No related branches found
No related tags found
1 merge request!123Turris OS 5.0 (HBK)
From 824b8e8e5f6ffa277133d19449f83e0589bbcc92 Mon Sep 17 00:00:00 2001
From: Michal Hrusecky <Michal@Hrusecky.net>
Date: Thu, 18 Jan 2018 13:19:06 +0100
Subject: [PATCH] python: Fix build
In installation ffi library couldn't be found, adding LD_LIBRARY_PATH fixes it.
Signed-off-by: Michal Hrusecky <Michal@Hrusecky.net>
---
lang/python/python-host.mk | 1 +
lang/python/python/Makefile | 1 +
lang/python/python3-host.mk | 1 +
lang/python/python3/Makefile | 1 +
4 files changed, 4 insertions(+)
diff --git a/lang/python/python-host.mk b/lang/python/python-host.mk
index d4dc81f..b271fd6 100644
--- a/lang/python/python-host.mk
+++ b/lang/python/python-host.mk
@@ -36,6 +36,7 @@ define HostPython
export _python_prefix="/usr"; \
export _python_exec_prefix="/usr"; \
fi; \
+ export LD_LIBRARY_PATH="$$(STAGING_DIR_HOST)/lib:$$(STAGING_DIR_HOSTPKG)/lib"; \
export PYTHONOPTIMIZE=""; \
$(1) \
$(HOST_PYTHON_BIN) $(2);
diff --git a/lang/python/python/Makefile b/lang/python/python/Makefile
index c70c486..58262d7 100644
--- a/lang/python/python/Makefile
+++ b/lang/python/python/Makefile
@@ -287,6 +287,7 @@ define Host/Compile
endef
define Host/Install
+ LD_LIBRARY_PATH="$$(STAGING_DIR_HOST)/lib:$$(STAGING_DIR_HOSTPKG)/lib" \
$(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/python3-host.mk b/lang/python/python3-host.mk
index 2a418d5..e545b96 100644
--- a/lang/python/python3-host.mk
+++ b/lang/python/python3-host.mk
@@ -36,6 +36,7 @@ define HostPython3
export _python_prefix="/usr"; \
export _python_exec_prefix="/usr"; \
fi; \
+ export LD_LIBRARY_PATH="$$(STAGING_DIR_HOST)/lib:$$(STAGING_DIR_HOSTPKG)/lib"; \
export PYTHONOPTIMIZE=""; \
$(1) \
$(HOST_PYTHON3_BIN) $(2);
diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile
index cd97378..329092f 100644
--- a/lang/python/python3/Makefile
+++ b/lang/python/python3/Makefile
@@ -284,6 +284,7 @@ define Host/Compile
endef
define Host/Install
+ LD_LIBRARY_PATH="$$(STAGING_DIR_HOST)/lib:$$(STAGING_DIR_HOSTPKG)/lib" \
$(MAKE) -C $(HOST_BUILD_DIR) install
$(INSTALL_DIR) $(HOST_PYTHON3_DIR)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_PYTHON3_DIR)/bin/pgen3
--
2.15.1
From 412d2785bb3be65045043e78a99faac24bc3d5e1 Mon Sep 17 00:00:00 2001
From: Stepan Henek <stepan.henek@nic.cz>
Date: Mon, 27 Aug 2018 12:29:49 +0200
Subject: [PATCH] pythons: intepreter in scripts fix
Signed-off-by: Stepan Henek <stepan.henek@nic.cz>
---
lang/python/python-package.mk | 12 +++++++++++-
lang/python/python3-package.mk | 15 ++++++++++++++-
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/lang/python/python-package.mk b/lang/python/python-package.mk
index 9990d53..f86b6a3 100644
--- a/lang/python/python-package.mk
+++ b/lang/python/python-package.mk
@@ -96,7 +96,6 @@ define Build/Compile/HostPyRunTarget
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON_INC_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)" \
_PYTHON_HOST_PLATFORM=linux2 \
- __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
$(3) \
, \
$(2) \
@@ -118,6 +117,16 @@ PYTHON_PKG_SETUP_DIR ?=
PYTHON_PKG_SETUP_ARGS ?= --single-version-externally-managed
PYTHON_PKG_SETUP_VARS ?=
+define python_fix_interpreter_paths
+ # iterate files and if the first line contains path to host python interpreter
+ # replace it with a proper path
+ for file in "$(PKG_INSTALL_DIR)"/usr/bin/* ; do \
+ if head -1 $$$$file | grep -q "$(HOST_PYTHON_BIN)" ; then \
+ $(SED) '1s%.*%#!/usr/bin/$(PYTHON)%' $$$$file ; \
+ fi \
+ done
+endef
+
define PyBuild/Compile/Default
$(foreach pkg,$(HOST_PYTHON_PACKAGE_BUILD_DEPENDS),
$(call host_python_pip_install_host,$(pkg))
@@ -128,6 +137,7 @@ define PyBuild/Compile/Default
$(PYTHON_PKG_SETUP_ARGS), \
$(PYTHON_PKG_SETUP_VARS) \
)
+ $(call python_fix_interpreter_paths)
endef
PyBuild/Compile=$(PyBuild/Compile/Default)
diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk
index e52a152..5cdc456 100644
--- a/lang/python/python3-package.mk
+++ b/lang/python/python3-package.mk
@@ -95,7 +95,6 @@ define Build/Compile/HostPy3RunTarget
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
_PYTHON_HOST_PLATFORM=linux2 \
- __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
$(3) \
, \
$(2) \
@@ -117,6 +116,16 @@ PYTHON3_PKG_SETUP_DIR ?=
PYTHON3_PKG_SETUP_ARGS ?= --single-version-externally-managed
PYTHON3_PKG_SETUP_VARS ?=
+define python3_fix_interpreter_paths
+ # iterate files and if the first line contains path to host python interpreter
+ # replace it with a proper path
+ for file in "$(PKG_INSTALL_DIR)"/usr/bin/* ; do \
+ if head -1 $$$${file} | grep -q "$(HOST_PYTHON3_BIN)" ; then \
+ $(SED) '1s%.*%#!/usr/bin/$(PYTHON3)%' $$$${file} ; \
+ fi \
+ done
+endef
+
define Py3Build/Compile/Default
$(foreach pkg,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
$(call host_python3_pip_install_host,$(pkg))
@@ -127,10 +136,14 @@ define Py3Build/Compile/Default
$(PYTHON3_PKG_SETUP_ARGS), \
$(PYTHON3_PKG_SETUP_VARS) \
)
+ $(call python3_fix_interpreter_paths)
endef
Py3Build/Compile=$(Py3Build/Compile/Default)
+
+Hooks/Compile/Post += python3_fix_interpreter_paths
+
ifeq ($(BUILD_VARIANT),python3)
define Build/Compile
$(call Py3Build/Compile)
--
2.20.1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment