All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH/next 1/1] package/i2c-tools: switch python support to setuptools
@ 2023-08-09 18:19 Bernd Kuhls
  2023-08-26 19:50 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2023-08-09 18:19 UTC (permalink / raw)
  To: buildroot; +Cc: Angelo Compagnucci

Add upstream patch to make package compatible with python 3.12.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 ...-Use-setuptools-instead-of-distutils.patch | 38 +++++++++++++++++++
 package/i2c-tools/i2c-tools.mk                | 10 ++---
 2 files changed, 43 insertions(+), 5 deletions(-)
 create mode 100644 package/i2c-tools/0001-py-smbus-Use-setuptools-instead-of-distutils.patch

diff --git a/package/i2c-tools/0001-py-smbus-Use-setuptools-instead-of-distutils.patch b/package/i2c-tools/0001-py-smbus-Use-setuptools-instead-of-distutils.patch
new file mode 100644
index 0000000000..63b2a7f82f
--- /dev/null
+++ b/package/i2c-tools/0001-py-smbus-Use-setuptools-instead-of-distutils.patch
@@ -0,0 +1,38 @@
+From cf3541b8a7ed50782edd05836020d31230fb86c6 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Wed, 19 Jan 2022 12:08:53 +0100
+Subject: py-smbus: Use setuptools instead of distutils
+
+As per [1], distutils is deprecated in Python 3.10 and will be removed
+entirely in Python 3.12.
+
+As setuptools is essentially an enhanced version of distutils, it's
+trivial to port to that.
+
+[1] https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated
+
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+
+Upstream: https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/commit/?id=cf3541b8a7ed50782edd05836020d31230fb86c6
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ py-smbus/setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/setup.py b/py-smbus/setup.py
+index 28a4500..26db33a 100644
+--- a/py-smbus/setup.py
++++ b/py-smbus/setup.py
+@@ -1,6 +1,6 @@
+ #!/usr/bin/env python
+ 
+-from distutils.core import setup, Extension
++from setuptools import setup, Extension
+ 
+ setup(	name="smbus",
+ 	version="1.1",
+-- 
+cgit 
+
diff --git a/package/i2c-tools/i2c-tools.mk b/package/i2c-tools/i2c-tools.mk
index 5c9ce26628..adccd9475d 100644
--- a/package/i2c-tools/i2c-tools.mk
+++ b/package/i2c-tools/i2c-tools.mk
@@ -14,7 +14,7 @@ I2C_TOOLS_MAKE_OPTS = EXTRA=eeprog
 I2C_TOOLS_INSTALL_STAGING = YES
 
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
-I2C_TOOLS_DEPENDENCIES += python3
+I2C_TOOLS_DEPENDENCIES += host-python-setuptools python3
 endif
 
 ifeq ($(BR2_STATIC_LIBS),y)
@@ -28,23 +28,23 @@ endif
 # Build/install steps mirror the distutil python package type in the python package
 # infrastructure
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
-# BASE_ENV taken from PKG_PYTHON_DISTUTILS_ENV in package/pkg-python.mk
+# BASE_ENV taken from PKG_PYTHON_SETUPTOOLS_ENV in package/pkg-python.mk
 I2C_TOOLS_PYTHON_BASE_ENV = \
-	$(PKG_PYTHON_DISTUTILS_ENV) \
+	$(PKG_PYTHON_SETUPTOOLS_ENV) \
 	CFLAGS="$(TARGET_CFLAGS) -I../include"
 
 define I2C_TOOLS_BUILD_PYSMBUS
 	(cd $(@D)/py-smbus; \
 	$(I2C_TOOLS_PYTHON_BASE_ENV) \
 		$(HOST_DIR)/bin/python setup.py build \
-		$(PKG_PYTHON_DISTUTILS_BUILD_OPTS))
+		$(PKG_PYTHON_SETUPTOOLS_BUILD_OPTS))
 endef
 
 define I2C_TOOLS_INSTALL_PYSMBUS
 	(cd $(@D)/py-smbus; \
 	$(I2C_TOOLS_PYTHON_BASE_ENV) \
 		$(HOST_DIR)/bin/python setup.py install \
-		$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS))
+		$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS))
 endef
 
 endif # BR2_PACKAGE_PYTHON3
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH/next 1/1] package/i2c-tools: switch python support to setuptools
  2023-08-09 18:19 [Buildroot] [PATCH/next 1/1] package/i2c-tools: switch python support to setuptools Bernd Kuhls
@ 2023-08-26 19:50 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-08-26 19:50 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: Angelo Compagnucci, buildroot

On Wed,  9 Aug 2023 20:19:25 +0200
Bernd Kuhls <bernd@kuhls.net> wrote:

> Add upstream patch to make package compatible with python 3.12.
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> ---
>  ...-Use-setuptools-instead-of-distutils.patch | 38 +++++++++++++++++++
>  package/i2c-tools/i2c-tools.mk                | 10 ++---
>  2 files changed, 43 insertions(+), 5 deletions(-)
>  create mode 100644 package/i2c-tools/0001-py-smbus-Use-setuptools-instead-of-distutils.patch

Applied to next with a slightly improved commit log, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-26 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 18:19 [Buildroot] [PATCH/next 1/1] package/i2c-tools: switch python support to setuptools Bernd Kuhls
2023-08-26 19:50 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.