From 56bac94a031bb98d6c1db62b9607a5f356cbaf48 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sat, 12 Aug 2023 02:00:12 +0800 Subject: [PATCH] python-psutil: Update to 5.9.5, replace patch 100_add_cross_platform_build_ability.patch was submitted upstream in https://github.com/giampaolo/psutil/pull/2068, but that pull request was closed without being merged. This replaces that patch with a simpler version that only updates setup.py, leaving the run-time library code unchanged. Signed-off-by: Jeffery To --- lang/python/python-psutil/Makefile | 13 ++-- .../patches/100-fix-non-Linux-compile.patch | 29 +++++++++ ...100_add_cross_platform_build_ability.patch | 59 ------------------- 3 files changed, 33 insertions(+), 68 deletions(-) create mode 100644 lang/python/python-psutil/patches/100-fix-non-Linux-compile.patch delete mode 100644 lang/python/python-psutil/patches/100_add_cross_platform_build_ability.patch diff --git a/lang/python/python-psutil/Makefile b/lang/python/python-psutil/Makefile index 07baf6693f..9e336a3072 100644 --- a/lang/python/python-psutil/Makefile +++ b/lang/python/python-psutil/Makefile @@ -8,18 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-psutil -PKG_VERSION:=5.9.0 -PKG_RELEASE:=2 +PKG_VERSION:=5.9.5 +PKG_RELEASE:=1 PYPI_NAME:=psutil -PKG_HASH:=869842dbd66bb80c3217158e629d6fceaecc3a3166d3d1faee515b05dd26ca25 +PKG_HASH:=5410638e4df39c54d957fc51ce03048acd8e6d60abc0f5107af51e5fb566eb3c PKG_MAINTAINER:=Jan Pavlinec PKG_LICENSE:=BSD 3-Clause PKG_LICENSE_FILES:=LICENSE -PKG_BUILD_DEPENDS:=python-setuptools-scm/host - include ../pypi.mk include $(INCLUDE_DIR)/package.mk include ../python3-package.mk @@ -28,7 +26,7 @@ define Package/python3-psutil SUBMENU:=Python SECTION:=lang CATEGORY:=Languages - TITLE:=psutil (process and system utilities) + TITLE:=Process and system monitoring URL:=https://github.com/giampaolo/psutil DEPENDS:=+python3-light endef @@ -38,9 +36,6 @@ define Package/python3-psutil/description on running processes and system utilization. endef -PYTHON3_VARS += \ - TARGET_SYS_PLATFORM=linux - $(eval $(call Py3Package,python3-psutil)) $(eval $(call BuildPackage,python3-psutil)) $(eval $(call BuildPackage,python3-psutil-src)) diff --git a/lang/python/python-psutil/patches/100-fix-non-Linux-compile.patch b/lang/python/python-psutil/patches/100-fix-non-Linux-compile.patch new file mode 100644 index 0000000000..eea19c8230 --- /dev/null +++ b/lang/python/python-psutil/patches/100-fix-non-Linux-compile.patch @@ -0,0 +1,29 @@ +--- a/setup.py ++++ b/setup.py +@@ -43,16 +43,16 @@ HERE = os.path.abspath(os.path.dirname(_ + # ...so we can import _common.py and _compat.py + sys.path.insert(0, os.path.join(HERE, "psutil")) + +-from _common import AIX # NOQA +-from _common import BSD # NOQA +-from _common import FREEBSD # NOQA +-from _common import LINUX # NOQA +-from _common import MACOS # NOQA +-from _common import NETBSD # NOQA +-from _common import OPENBSD # NOQA +-from _common import POSIX # NOQA +-from _common import SUNOS # NOQA +-from _common import WINDOWS # NOQA ++AIX = False ++BSD = False ++FREEBSD = False ++LINUX = True ++MACOS = False ++NETBSD = False ++OPENBSD = False ++POSIX = True ++SUNOS = False ++WINDOWS = False + from _common import hilite # NOQA + from _compat import PY3 # NOQA + from _compat import which # NOQA diff --git a/lang/python/python-psutil/patches/100_add_cross_platform_build_ability.patch b/lang/python/python-psutil/patches/100_add_cross_platform_build_ability.patch deleted file mode 100644 index e7e84f49a6..0000000000 --- a/lang/python/python-psutil/patches/100_add_cross_platform_build_ability.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: https://github.com/giampaolo/psutil/pull/2068/commits/9a5cb2b71d301a63ea765f02a196fd046e769685 - -From 9a5cb2b71d301a63ea765f02a196fd046e769685 Mon Sep 17 00:00:00 2001 -From: "Sergey V. Lobanov" -Date: Mon, 31 Jan 2022 17:48:14 +0300 -Subject: [PATCH] Add cross-platform build ability - -Currently it is not possible to build psutil on MacOS for Linux -target using external toolchain. It fails due to build script -detects build host OS and changes build logic according to detected -OS. - -This patch allows to redefine os.name and sys.platform using ENV -vars TARGET_OS_NAME and TARGET_SYS_PLATFORM. If these variables -are not defined then os.name and sys.platform is used as it does -currently. - -Using this patch it is possible to compile psutil on MacOS with -OpenWrt GCC Toolchain (OpenWrt is Linux). - -Signed-off-by: Sergey V. Lobanov ---- - psutil/_common.py | 23 ++++++++++++++--------- - 1 file changed, 14 insertions(+), 9 deletions(-) - ---- a/psutil/_common.py -+++ b/psutil/_common.py -@@ -81,17 +81,22 @@ __all__ = [ - # =================================================================== - - --POSIX = os.name == "posix" --WINDOWS = os.name == "nt" --LINUX = sys.platform.startswith("linux") --MACOS = sys.platform.startswith("darwin") -+# Allow to redefine os.name and sys.platform if build OS and target -+# OS are different (e.g. build OS is MacOS, target OS is Linux) -+target_os_name = os.getenv('TARGET_OS_NAME', os.name) -+target_sys_platform = os.getenv('TARGET_SYS_PLATFORM', sys.platform) -+ -+POSIX = target_os_name == "posix" -+WINDOWS = target_os_name == "nt" -+LINUX = target_sys_platform.startswith("linux") -+MACOS = target_sys_platform.startswith("darwin") - OSX = MACOS # deprecated alias --FREEBSD = sys.platform.startswith(("freebsd", "midnightbsd")) --OPENBSD = sys.platform.startswith("openbsd") --NETBSD = sys.platform.startswith("netbsd") -+FREEBSD = target_sys_platform.startswith(("freebsd", "midnightbsd")) -+OPENBSD = target_sys_platform.startswith("openbsd") -+NETBSD = target_sys_platform.startswith("netbsd") - BSD = FREEBSD or OPENBSD or NETBSD --SUNOS = sys.platform.startswith(("sunos", "solaris")) --AIX = sys.platform.startswith("aix") -+SUNOS = target_sys_platform.startswith(("sunos", "solaris")) -+AIX = target_sys_platform.startswith("aix") - - - # =================================================================== -- 2.30.2