Message ID | 20231026092701.12345-20-adam.duskett@amarulasolutions.com |
---|---|
State | Accepted |
Headers | show |
Series | package/python3: bump version to 3.12.0 | expand |
Hi Adam, On Thu, Oct 26, 2023 at 11:27 AM Adam Duskett <adam.duskett@amarulasolutions.com> wrote: > > In preperation of python 3.12.0, distutils has been removed completely. > This is a patch taken from the Fedora 39 RPM: libftdi-1.5-10.fc39.x86_64. > > Upstream commit: abd19b721f7e9b4d514ed319ece173ebc7b1ea72 > > Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> > --- > ...003-move-from-distutils-to-sysconfig.patch | 32 +++++++++++++++++++ > 1 file changed, 32 insertions(+) > create mode 100644 package/libftdi/0003-move-from-distutils-to-sysconfig.patch > > diff --git a/package/libftdi/0003-move-from-distutils-to-sysconfig.patch b/package/libftdi/0003-move-from-distutils-to-sysconfig.patch > new file mode 100644 > index 0000000000..cb179c7cde > --- /dev/null > +++ b/package/libftdi/0003-move-from-distutils-to-sysconfig.patch > @@ -0,0 +1,32 @@ > +From 872cd480990e6536d2cf48568627903ebf5acbeb Mon Sep 17 00:00:00 2001 > +From: Dan Hor <dan@danny.cz> > +Date: Tue, 24 Oct 2023 10:36:09 +0200 > +Subject: [PATCH] move from distutils to sysconfig > + > +The distutils module was deprecated in Python 3.10, thus switch to the > +sysconfig module instead. > + > +Upstream: committed abd19b721f7e9b4d514ed319ece173ebc7b1ea72 > + > +Signed-off-by: Dan Hor <dan@danny.cz> > +Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> > +--- > + python/CMakeLists.txt | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt > +index 5b6f420..19ce500 100644 > +--- a/python/CMakeLists.txt > ++++ b/python/CMakeLists.txt > +@@ -42,7 +42,7 @@ endif () > + > + set_target_properties ( ${SWIG_MODULE_ftdi1_REAL_NAME} PROPERTIES NO_SONAME ON ) > + > +-execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print( sysconfig.get_python_lib( plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )" > ++execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print( sysconfig.get_path( 'platlib', vars={'platbase': '${CMAKE_INSTALL_PREFIX}'} ) )" > + OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH > + OUTPUT_STRIP_TRAILING_WHITESPACE ) Do you mean libftdi1 package and not libftdi? Regards, Yegor
Hi Adam, Quite a few things went wrong with this patch... Other than it being the wrong package, as noted by Yegor, there are some more details: On 26/10/2023 11:26, Adam Duskett wrote: > In preperation of python 3.12.0, distutils has been removed completely. > This is a patch taken from the Fedora 39 RPM: libftdi-1.5-10.fc39.x86_64. > > Upstream commit: abd19b721f7e9b4d514ed319ece173ebc7b1ea72 > > Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> > --- > ...003-move-from-distutils-to-sysconfig.patch | 32 +++++++++++++++++++ > 1 file changed, 32 insertions(+) > create mode 100644 package/libftdi/0003-move-from-distutils-to-sysconfig.patch > > diff --git a/package/libftdi/0003-move-from-distutils-to-sysconfig.patch b/package/libftdi/0003-move-from-distutils-to-sysconfig.patch > new file mode 100644 > index 0000000000..cb179c7cde > --- /dev/null > +++ b/package/libftdi/0003-move-from-distutils-to-sysconfig.patch > @@ -0,0 +1,32 @@ > +From 872cd480990e6536d2cf48568627903ebf5acbeb Mon Sep 17 00:00:00 2001 > +From: Dan Hor <dan@danny.cz> The guy is called Dan Horák. I don't know how you managed to get this wrong - supposedly you took the patch from Fedore, but there it's recorded properly with =?UTF-8? stuff. > +Date: Tue, 24 Oct 2023 10:36:09 +0200 This is really weird... The patch is actually dated December 19, 2022. It got committed to libftdi1 on October 24, but at 17:33 +0200. > +Subject: [PATCH] move from distutils to sysconfig > + > +The distutils module was deprecated in Python 3.10, thus switch to the > +sysconfig module instead. The commit message was changed slightly when it was sent upstream. > + > +Upstream: committed abd19b721f7e9b4d514ed319ece173ebc7b1ea72 It's easier for people if you put a URL. Also, I think this should be put after the author signoff. However... > + > +Signed-off-by: Dan Hor <dan@danny.cz> The author didn't actually add a signoff! Please don't add one if it doesn't exist. Anyway, I fixed all of that up and applied to master, thanks. Regards, Arnout > +Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> > +--- > + python/CMakeLists.txt | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt > +index 5b6f420..19ce500 100644 > +--- a/python/CMakeLists.txt > ++++ b/python/CMakeLists.txt > +@@ -42,7 +42,7 @@ endif () > + > + set_target_properties ( ${SWIG_MODULE_ftdi1_REAL_NAME} PROPERTIES NO_SONAME ON ) > + > +-execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print( sysconfig.get_python_lib( plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )" > ++execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print( sysconfig.get_path( 'platlib', vars={'platbase': '${CMAKE_INSTALL_PREFIX}'} ) )" > + OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH > + OUTPUT_STRIP_TRAILING_WHITESPACE ) > + > +-- > +2.41.0 > +
diff --git a/package/libftdi/0003-move-from-distutils-to-sysconfig.patch b/package/libftdi/0003-move-from-distutils-to-sysconfig.patch new file mode 100644 index 0000000000..cb179c7cde --- /dev/null +++ b/package/libftdi/0003-move-from-distutils-to-sysconfig.patch @@ -0,0 +1,32 @@ +From 872cd480990e6536d2cf48568627903ebf5acbeb Mon Sep 17 00:00:00 2001 +From: Dan Hor <dan@danny.cz> +Date: Tue, 24 Oct 2023 10:36:09 +0200 +Subject: [PATCH] move from distutils to sysconfig + +The distutils module was deprecated in Python 3.10, thus switch to the +sysconfig module instead. + +Upstream: committed abd19b721f7e9b4d514ed319ece173ebc7b1ea72 + +Signed-off-by: Dan Hor <dan@danny.cz> +Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> +--- + python/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt +index 5b6f420..19ce500 100644 +--- a/python/CMakeLists.txt ++++ b/python/CMakeLists.txt +@@ -42,7 +42,7 @@ endif () + + set_target_properties ( ${SWIG_MODULE_ftdi1_REAL_NAME} PROPERTIES NO_SONAME ON ) + +-execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print( sysconfig.get_python_lib( plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}' ) )" ++execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print( sysconfig.get_path( 'platlib', vars={'platbase': '${CMAKE_INSTALL_PREFIX}'} ) )" + OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE ) + +-- +2.41.0 +
In preperation of python 3.12.0, distutils has been removed completely. This is a patch taken from the Fedora 39 RPM: libftdi-1.5-10.fc39.x86_64. Upstream commit: abd19b721f7e9b4d514ed319ece173ebc7b1ea72 Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> --- ...003-move-from-distutils-to-sysconfig.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/libftdi/0003-move-from-distutils-to-sysconfig.patch