From 5e00a051d6c78ca7ec5e93e0de0e612ec909fb5a Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 30 Aug 2021 10:00:39 +0300 Subject: [PATCH 1/2] seafile-seahub: move Django-1.11.txt in package folder Django 1.11 (host-build) is only needed for Seahub. And won't ever be needed for anything else (hopefully). This change moves it to the Seahub folder. Signed-off-by: Alexandru Ardelean --- .../seafile-seahub}/Django-1.11.txt | 0 net/seafile-seahub/Makefile | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {lang/python/host-pip-requirements => net/seafile-seahub}/Django-1.11.txt (100%) diff --git a/lang/python/host-pip-requirements/Django-1.11.txt b/net/seafile-seahub/Django-1.11.txt similarity index 100% rename from lang/python/host-pip-requirements/Django-1.11.txt rename to net/seafile-seahub/Django-1.11.txt diff --git a/net/seafile-seahub/Makefile b/net/seafile-seahub/Makefile index 0e4e8af24c..d16ae9f667 100644 --- a/net/seafile-seahub/Makefile +++ b/net/seafile-seahub/Makefile @@ -21,7 +21,7 @@ PKG_LICENSE_FILES:=LICENSE.txt PKG_BUILD_DIR:=$(BUILD_DIR)/seahub-$(PKG_VERSION)-server -HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=Django-1.11 +HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=./Django-1.11.txt PKG_BUILD_PARALLEL:=1 PYTHON3_PKG_BUILD:=0 From 9725de1de4426b02062ca7d86b750013af8e0e05 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Wed, 25 Aug 2021 15:59:56 +0300 Subject: [PATCH 2/2] python3-package.mk: add check for dependencies in host-pip-requirements It often happens that we update a package to a new version (e.g. cffi) to a newer version, but we forget to update the version for cffi in the `lang/python/host-pip-requirements/cffi.txt` file. This check adds a minimal check, so that when a build occurs for a Python package, if there is a mention/listing of this package in `lang/python/host-pip-requirements/` it will check that the versions match. This way, when we update a package, we get a build failure and update the host version as well. This will omit packages (like Cython) that are not packaged for OpenWrt, but are host-side dependencies only. But until we find some mechanism to check for those, we will probably only notice to update them when another build occurs (at the very least). Signed-off-by: Alexandru Ardelean --- lang/python/python3-package.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lang/python/python3-package.mk b/lang/python/python3-package.mk index 5673d15bb0..96fafe4450 100644 --- a/lang/python/python3-package.mk +++ b/lang/python/python3-package.mk @@ -204,6 +204,17 @@ define Py3Build/FindStdlibDepends $(SHELL) $(python3_mk_path)python3-find-stdlib-depends.sh -n "$(PKG_NAME)" "$(PKG_BUILD_DIR)" endef +ifneq ($(strip $(PYPI_NAME)),) +define Py3Build/CheckHostPipVersionMatch + if grep -q "$(PYPI_NAME)==" $(python3_mk_path)host-pip-requirements/*.txt ; then \ + if ! grep -q "$(PYPI_NAME)==$(PKG_VERSION)" $(python3_mk_path)host-pip-requirements/*.txt ; then \ + printf "\nPlease update version of $(PYPI_NAME) to $(PKG_VERSION) in 'host-pip-requirements'/\n\n" ; \ + exit 1 ; \ + fi \ + fi +endef +endif + define Py3Build/Compile/Default $(if $(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS), \ $(call HostPython3/PipInstall,$(PYTHON3_PKG_HOST_PIP_INSTALL_ARGS)) \ @@ -226,5 +237,6 @@ ifeq ($(strip $(PYTHON3_PKG_BUILD)),1) ifeq ($(PY3),stdlib) Hooks/Configure/Post+=Py3Build/FindStdlibDepends endif + Hooks/Configure/Post+=Py3Build/CheckHostPipVersionMatch Build/Compile=$(Py3Build/Compile) endif