From d1eea4f90ce9238cae36a8d4ae0161a8a3748616 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Thu, 4 Jan 2024 18:17:36 +0100 Subject: [PATCH] package/python-pysensors: fix build without host lm-sensors Fix the following build failure raised since the addition of the package in commit c8ff8d41c06f6b1cbc5cf8702a516411084ead16: File "/home/buildroot/autobuild/instance-2/output-1/build/python-pysensors-0.0.4/setup.py", line 3, in import sensors File "/home/buildroot/autobuild/instance-2/output-1/build/python-pysensors-0.0.4/sensors/__init__.py", line 20, in raise ImportError("can't find the sensors library.") Fixes: - http://autobuild.buildroot.org/results/acd8583fb635ea27811405a2478182ddcd5642f7 Signed-off-by: Fabrice Fontaine Tested-by: Brandon Maier Signed-off-by: Thomas Petazzoni --- ...-Remove-import-sensors-from-setup-py.patch | 55 +++++++++++++++++++ package/python-pysensors/Config.in | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 package/python-pysensors/0001-Remove-import-sensors-from-setup-py.patch diff --git a/package/python-pysensors/0001-Remove-import-sensors-from-setup-py.patch b/package/python-pysensors/0001-Remove-import-sensors-from-setup-py.patch new file mode 100644 index 0000000000..737f194fd4 --- /dev/null +++ b/package/python-pysensors/0001-Remove-import-sensors-from-setup-py.patch @@ -0,0 +1,55 @@ +Remove import sensors from setup.py + +Don't import sensors in setup.py to avoid adding a dependency on host +lm-sensors. Instead, move __version__, __author__, __contact__ and +__license__ to setup.py + +Signed-off-by: Fabrice Fontaine +Upstream: upstream is dead since 2019 + +diff '--color=auto' -Nura PySensors-0.0.4.orig/sensors/__init__.py PySensors-0.0.4/sensors/__init__.py +--- PySensors-0.0.4.orig/sensors/__init__.py 2024-01-04 13:47:07.114179107 +0100 ++++ PySensors-0.0.4/sensors/__init__.py 2024-01-04 14:07:24.701178768 +0100 +@@ -6,12 +6,6 @@ + + from sensors import stdc + +-__version__ = "0.0.4" +-__date__ = "2019-09-19" +-__author__ = "Marc 'BlackJack' Rintsch" +-__contact__ = 'marc@rintsch.de' +-__license__ = 'LGPL v2.1' +- + API_VERSION = 4 + DEFAULT_CONFIG_FILENAME = b"/etc/sensors3.conf" + +diff '--color=auto' -Nura PySensors-0.0.4.orig/setup.py PySensors-0.0.4/setup.py +--- PySensors-0.0.4.orig/setup.py 2024-01-04 13:47:07.114179107 +0100 ++++ PySensors-0.0.4/setup.py 2024-01-04 14:07:04.657260411 +0100 +@@ -1,17 +1,21 @@ + #!/usr/bin/env python3 + from setuptools import setup +-import sensors ++ ++__version__ = "0.0.4" ++__author__ = "Marc 'BlackJack' Rintsch" ++__contact__ = 'marc@rintsch.de' ++__license__ = 'LGPL v2.1' + + setup( + name='PySensors', +- version=sensors.__version__, +- author=sensors.__author__, +- author_email=sensors.__contact__, ++ version=__version__, ++ author=__author__, ++ author_email=__contact__, + packages=['sensors'], + # scripts=[], + url='http://pypi.python.org/pypi/PySensors/', + # download_url='', +- license=sensors.__license__, ++ license=__license__, + description='Python bindings to libsensors (via ctypes)', + long_description=open('README.rst').read(), + long_description_content_type="text/x-rst", diff --git a/package/python-pysensors/Config.in b/package/python-pysensors/Config.in index f8e056506b..952d14c351 100644 --- a/package/python-pysensors/Config.in +++ b/package/python-pysensors/Config.in @@ -1,6 +1,6 @@ config BR2_PACKAGE_PYTHON_PYSENSORS bool "python-pysensors" - select BR2_PACKAGE_LM_SENSORS + select BR2_PACKAGE_LM_SENSORS # runtime help Python bindings for libsensors.so from the lm-sensors project via ctypes. Supports API version 4, i.e. libsensors version