* [PR PATCH] i2c-tools: change upstream and add python subpkg
@ 2022-03-23 21:23 0x5c
2022-03-23 21:44 ` leahneukirchen
` (17 more replies)
0 siblings, 18 replies; 19+ messages in thread
From: 0x5c @ 2022-03-23 21:23 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]
There is a new pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
Things I am still unsure about:
- The subpackage name and short_desc
- How to ensure the subpackage's version is the version of the python module (it is versioned separately)
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 4900 bytes --]
From 8b95621de3ae24626a09ee89a9b707fd6801a751 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Wed, 23 Mar 2022 17:07:47 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 19 +++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 84 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..3b3a1b8f5440 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,15 +1,17 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
@@ -27,3 +29,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+=" - Python3 bindings"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() { # TODO: How to set version properly, since it is in the distfile
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
@ 2022-03-23 21:44 ` leahneukirchen
2022-03-29 11:11 ` [PR PATCH] [Updated] " 0x5c
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: leahneukirchen @ 2022-03-23 21:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 292 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#issuecomment-1076850120
Comment:
You can't have a different version for a subpkg. Either make a new package, or just put it into the main package. Or use the "wrong" version.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Updated] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
2022-03-23 21:44 ` leahneukirchen
@ 2022-03-29 11:11 ` 0x5c
2022-03-29 11:16 ` 0x5c
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-03-29 11:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]
There is an updated pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [ ] Crossbuilds fine
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 4858 bytes --]
From 0627b8effd145e73d1e6e810ccfc4493e999a7b7 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 29 Mar 2022 07:10:25 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 19 +++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 84 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..bd1f6a42d196 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,15 +1,17 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
@@ -27,3 +29,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+="Python 3 bindings for libi2c from i2c-tools"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() {
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
2022-03-23 21:44 ` leahneukirchen
2022-03-29 11:11 ` [PR PATCH] [Updated] " 0x5c
@ 2022-03-29 11:16 ` 0x5c
2022-05-07 9:11 ` [PR PATCH] [Updated] " 0x5c
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-03-29 11:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 554 bytes --]
New comment by 0x5c on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#issuecomment-1081741551
Comment:
I decided that the version would simply be i2c-tools' version; since the version is only exposed in the module metadata inside i2c-tools' distfile, and since the distfile is versioned with i2c-tools' version, it would be an absolute mess to deal as a separate package.
I still have to fix crossbuilds and the python module building in the install phase, but I have a lead on that, just no testing time right now.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Updated] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (2 preceding siblings ...)
2022-03-29 11:16 ` 0x5c
@ 2022-05-07 9:11 ` 0x5c
2022-05-07 9:26 ` 0x5c
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-07 9:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
Closes #36156
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [ ] Crossbuilds fine
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 4893 bytes --]
From 1804e8527df8c037db1330b7758371230be25b69 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 29 Mar 2022 07:10:25 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 20 ++++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 85 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..9e17f97091d9 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,15 +1,18 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_build_args="EXTRA=py-smbus"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
@@ -27,3 +30,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+="Python 3 bindings for libi2c from i2c-tools"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() {
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (3 preceding siblings ...)
2022-05-07 9:11 ` [PR PATCH] [Updated] " 0x5c
@ 2022-05-07 9:26 ` 0x5c
2022-05-07 22:55 ` [PR PATCH] [Updated] " 0x5c
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-07 9:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 383 bytes --]
New comment by 0x5c on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#issuecomment-1120174174
Comment:
The python module build happening in do_install has been fixed, but cross builds still have the problem where `Python.h` cannot be found.
However, the build succeeds if `python3-devel` is moved to hostmakedends, which doesn't seem right to me.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Updated] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (4 preceding siblings ...)
2022-05-07 9:26 ` 0x5c
@ 2022-05-07 22:55 ` 0x5c
2022-05-22 19:33 ` [PR REVIEW] " classabbyamp
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-07 22:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
Closes #36156
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [ ] Crossbuilds fine
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 5190 bytes --]
From 74acddb072b30418b59cb82240d40b07b81cdb04 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 29 Mar 2022 07:10:25 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 25 ++++++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 90 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..08d0d283ad33 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,18 +1,26 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_build_args="EXTRA=py-smbus"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
+
+export PYPREFIX="$XBPS_CROSS_BASE"
+export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
+export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
+
post_install() {
vinstall "${FILESDIR}/45-i2c-tools.rules" 644 usr/lib/udev/rules.d
}
@@ -27,3 +35,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+="Python 3 bindings for libi2c from i2c-tools"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() {
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR REVIEW] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (5 preceding siblings ...)
2022-05-07 22:55 ` [PR PATCH] [Updated] " 0x5c
@ 2022-05-22 19:33 ` classabbyamp
2022-05-22 19:34 ` classabbyamp
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: classabbyamp @ 2022-05-22 19:33 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 757 bytes --]
New review comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#discussion_r878915734
Comment:
```suggestion
if [ -n "$CROSS_BUILD" ]; then
export PYPREFIX="$XBPS_CROSS_BASE"
export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
export LDSHARED="${CC} -shared $LDFLAGS"
export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
f=${f##*/}
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
done
export _PYTHON_SYSCONFIGDATA_NAME
fi
```
i think this should work
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR REVIEW] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (6 preceding siblings ...)
2022-05-22 19:33 ` [PR REVIEW] " classabbyamp
@ 2022-05-22 19:34 ` classabbyamp
2022-05-23 4:52 ` [PR PATCH] [Updated] " 0x5c
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: classabbyamp @ 2022-05-22 19:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 865 bytes --]
New review comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#discussion_r878915734
Comment:
```suggestion
if [ -n "$CROSS_BUILD" ]; then
export PYPREFIX="$XBPS_CROSS_BASE"
export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
export LDSHARED="${CC} -shared $LDFLAGS"
export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
f=${f##*/}
_PYTHON_SYSCONFIGDATA_NAME=${f%.py}
done
export _PYTHON_SYSCONFIGDATA_NAME
fi
```
i think this should work. the critical thing was the `_PYTHON_SYSCONFIGDATA_NAME` from the host leaking in when it wasn't specified.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Updated] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (7 preceding siblings ...)
2022-05-22 19:34 ` classabbyamp
@ 2022-05-23 4:52 ` 0x5c
2022-05-23 4:57 ` [PR REVIEW] " 0x5c
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-23 4:52 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
Closes #36156
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [ ] Crossbuilds fine
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 5571 bytes --]
From c12988170e9c161e140c3f264dcdbc39077f2b39 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 29 Mar 2022 07:10:25 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
Closes #36156
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 35 ++++++++++++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 100 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..ec522fd6f71b 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,18 +1,36 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_build_args="EXTRA=py-smbus"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
+
+if [ -n "$CROSS_BUILD" ]; then
+ export PYPREFIX="$XBPS_CROSS_BASE"
+ export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
+ export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
+ export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
+ export LDSHARED="${CC} -shared $LDFLAGS"
+ export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
+ for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+ f=${f##*/}
+ _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+ done
+ export _PYTHON_SYSCONFIGDATA_NAME
+fi
+
post_install() {
vinstall "${FILESDIR}/45-i2c-tools.rules" 644 usr/lib/udev/rules.d
}
@@ -27,3 +45,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+="Python 3 bindings for libi2c from i2c-tools"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() {
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR REVIEW] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (8 preceding siblings ...)
2022-05-23 4:52 ` [PR PATCH] [Updated] " 0x5c
@ 2022-05-23 4:57 ` 0x5c
2022-05-23 4:59 ` 0x5c
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-23 4:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 170 bytes --]
New review comment by 0x5c on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#discussion_r879024051
Comment:
That indeed worked, thanks
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (9 preceding siblings ...)
2022-05-23 4:57 ` [PR REVIEW] " 0x5c
@ 2022-05-23 4:59 ` 0x5c
2022-05-23 4:59 ` 0x5c
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-23 4:59 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
New comment by 0x5c on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#issuecomment-1134181382
Comment:
All problems fixed, remains to test if it actually works
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (10 preceding siblings ...)
2022-05-23 4:59 ` 0x5c
@ 2022-05-23 4:59 ` 0x5c
2022-05-27 22:54 ` [PR PATCH] [Updated] " 0x5c
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-23 4:59 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 203 bytes --]
New comment by 0x5c on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#issuecomment-1134181382
Comment:
All problems fixed, remains to test if it actually runs properly
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Updated] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (11 preceding siblings ...)
2022-05-23 4:59 ` 0x5c
@ 2022-05-27 22:54 ` 0x5c
2022-05-27 23:05 ` 0x5c
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-27 22:54 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
Closes #36156
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [x] Crossbuilds fine
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 5571 bytes --]
From ae68256ea44fd08a344d28dc7c218279d46543d8 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 29 Mar 2022 07:10:25 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
Closes #36156
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 35 ++++++++++++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 100 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..ec522fd6f71b 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,18 +1,36 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_build_args="EXTRA=py-smbus"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
+
+if [ -n "$CROSS_BUILD" ]; then
+ export PYPREFIX="$XBPS_CROSS_BASE"
+ export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
+ export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
+ export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
+ export LDSHARED="${CC} -shared $LDFLAGS"
+ export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
+ for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+ f=${f##*/}
+ _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+ done
+ export _PYTHON_SYSCONFIGDATA_NAME
+fi
+
post_install() {
vinstall "${FILESDIR}/45-i2c-tools.rules" 644 usr/lib/udev/rules.d
}
@@ -27,3 +45,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+="Python 3 bindings for libi2c from i2c-tools"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() {
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Updated] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (12 preceding siblings ...)
2022-05-27 22:54 ` [PR PATCH] [Updated] " 0x5c
@ 2022-05-27 23:05 ` 0x5c
2022-05-27 23:22 ` 0x5c
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-27 23:05 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
Closes #36156
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [x] Crossbuilds fine
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 5571 bytes --]
From 27d1d749111a50600b04ccff057a41df865751db Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 29 Mar 2022 07:10:25 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
Closes #36156
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 35 ++++++++++++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 100 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..ec522fd6f71b 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,18 +1,36 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_build_args="EXTRA=py-smbus"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
+
+if [ -n "$CROSS_BUILD" ]; then
+ export PYPREFIX="$XBPS_CROSS_BASE"
+ export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
+ export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
+ export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
+ export LDSHARED="${CC} -shared $LDFLAGS"
+ export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
+ for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+ f=${f##*/}
+ _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+ done
+ export _PYTHON_SYSCONFIGDATA_NAME
+fi
+
post_install() {
vinstall "${FILESDIR}/45-i2c-tools.rules" 644 usr/lib/udev/rules.d
}
@@ -27,3 +45,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+="Python 3 bindings for libi2c from i2c-tools"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() {
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Updated] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (13 preceding siblings ...)
2022-05-27 23:05 ` 0x5c
@ 2022-05-27 23:22 ` 0x5c
2022-06-12 1:14 ` 0x5c
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-05-27 23:22 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
Closes #36156
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [x] Crossbuilds fine
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 5571 bytes --]
From 6f752cc4807ae050fb3aeebf1b59fc0e40b2cd5a Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 29 Mar 2022 07:10:25 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
Closes #36156
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 35 ++++++++++++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 100 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..ec522fd6f71b 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,18 +1,36 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_build_args="EXTRA=py-smbus"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
+
+if [ -n "$CROSS_BUILD" ]; then
+ export PYPREFIX="$XBPS_CROSS_BASE"
+ export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
+ export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
+ export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
+ export LDSHARED="${CC} -shared $LDFLAGS"
+ export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
+ for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+ f=${f##*/}
+ _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+ done
+ export _PYTHON_SYSCONFIGDATA_NAME
+fi
+
post_install() {
vinstall "${FILESDIR}/45-i2c-tools.rules" 644 usr/lib/udev/rules.d
}
@@ -27,3 +45,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+="Python 3 bindings for libi2c from i2c-tools"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() {
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Updated] i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (14 preceding siblings ...)
2022-05-27 23:22 ` 0x5c
@ 2022-06-12 1:14 ` 0x5c
2022-06-12 1:19 ` 0x5c
2022-06-13 8:27 ` [PR PATCH] [Merged]: " leahneukirchen
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-06-12 1:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
There is an updated pull request by 0x5c against master on the void-packages repository
https://github.com/0x5c/void-packages i2c-python
https://github.com/void-linux/void-packages/pull/36304
i2c-tools: change upstream and add python subpkg
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
Closes #36156
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [x] Crossbuilds fine
- [ ] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/36304.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-i2c-python-36304.patch --]
[-- Type: text/x-diff, Size: 5571 bytes --]
From b8a9ab5426b387eacb142608c258985224b795a4 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Tue, 29 Mar 2022 07:10:25 -0400
Subject: [PATCH] i2c-tools: change upstream and add python subpkg
Closes #36156
---
.../patches/py-smbus_fix-destdir.patch | 35 +++++++++++++++++++
.../patches/py-smbus_use-setuptools.patch | 33 +++++++++++++++++
srcpkgs/i2c-tools/template | 35 ++++++++++++++++---
srcpkgs/python3-smbus | 1 +
4 files changed, 100 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
create mode 100644 srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
create mode 120000 srcpkgs/python3-smbus
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
new file mode 100644
index 000000000000..f61e4122cd62
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_fix-destdir.patch
@@ -0,0 +1,35 @@
+I had to add '--root' to the patch for it to not poison the masterdir.
+ That part will still be needed as a patch when the next version gets released.
+ -- 0x5c
+original message below
+
+From a4609318b6fa594f970673d77397f1ca74b4120a Mon Sep 17 00:00:00 2001
+From: Morten Linderud <morten@linderud.pw>
+Date: Mon, 4 Oct 2021 20:01:53 +0200
+Subject: py-smbus/Module.mk: Install with PREFIX defined
+
+If we are building to a defined destdir py-smbus is going to ignore this
+and try install to the actual root. This breaks packaging setups as the
+install section would fail.
+
+Signed-off-by: Morten Linderud <morten@linderud.pw>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ py-smbus/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/py-smbus/Module.mk b/py-smbus/Module.mk
+index 04ceb64..1e2ded1 100644
+--- a/py-smbus/Module.mk
++++ b/py-smbus/Module.mk
+@@ -22,7 +22,7 @@ clean-python:
+ rm -rf py-smbus/build
+
+ install-python:
+- $(DISTUTILS) install
++ $(DISTUTILS) install --prefix="$(PREFIX)" --root="$(DESTDIR)"
+
+ all: all-python
+
+--
+cgit 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
new file mode 100644
index 000000000000..c31e8757b4f0
--- /dev/null
+++ b/srcpkgs/i2c-tools/patches/py-smbus_use-setuptools.patch
@@ -0,0 +1,33 @@
+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>
+---
+ 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 1.2.3-1.el7
diff --git a/srcpkgs/i2c-tools/template b/srcpkgs/i2c-tools/template
index a121effff538..ec522fd6f71b 100644
--- a/srcpkgs/i2c-tools/template
+++ b/srcpkgs/i2c-tools/template
@@ -1,18 +1,36 @@
# Template file for 'i2c-tools'
pkgname=i2c-tools
version=4.3
-revision=1
+revision=2
build_style=gnu-makefile
-make_install_args="sbindir=/usr/bin"
+make_build_args="EXTRA=py-smbus"
+make_install_args="sbindir=/usr/bin EXTRA=py-smbus"
+hostmakedepends="python3 python3-setuptools"
+makedepends="python3-devel"
depends="perl"
short_desc="Heterogeneous set of I2C tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
-homepage="https://packages.debian.org/sid/i2c-tools"
-distfiles="${DEBIAN_SITE}/main/i/${pkgname}/${pkgname}_${version}.orig.tar.xz"
+homepage="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+distfiles="https://mirrors.edge.kernel.org/pub/software/utils/i2c-tools/i2c-tools-${version}.tar.xz"
checksum=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
system_groups="i2c"
+
+if [ -n "$CROSS_BUILD" ]; then
+ export PYPREFIX="$XBPS_CROSS_BASE"
+ export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
+ export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
+ export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
+ export LDSHARED="${CC} -shared $LDFLAGS"
+ export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
+ for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+ f=${f##*/}
+ _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+ done
+ export _PYTHON_SYSCONFIGDATA_NAME
+fi
+
post_install() {
vinstall "${FILESDIR}/45-i2c-tools.rules" 644 usr/lib/udev/rules.d
}
@@ -27,3 +45,12 @@ i2c-tools-devel_package() {
vmove "usr/lib/*.so"
}
}
+
+python3-smbus_package() {
+ short_desc+="Python 3 bindings for libi2c from i2c-tools"
+ depends="${sourcepkg}>=${version}_${revision}"
+ lib32disabled=yes
+ pkg_install() {
+ vmove "usr/lib/python3.*"
+ }
+}
diff --git a/srcpkgs/python3-smbus b/srcpkgs/python3-smbus
new file mode 120000
index 000000000000..a82cddc3349e
--- /dev/null
+++ b/srcpkgs/python3-smbus
@@ -0,0 +1 @@
+i2c-tools
\ No newline at end of file
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (15 preceding siblings ...)
2022-06-12 1:14 ` 0x5c
@ 2022-06-12 1:19 ` 0x5c
2022-06-13 8:27 ` [PR PATCH] [Merged]: " leahneukirchen
17 siblings, 0 replies; 19+ messages in thread
From: 0x5c @ 2022-06-12 1:19 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 213 bytes --]
New comment by 0x5c on void-packages repository
https://github.com/void-linux/void-packages/pull/36304#issuecomment-1153038201
Comment:
I was finally able to test this on a rpi1b
This is now ready for review
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PR PATCH] [Merged]: i2c-tools: change upstream and add python subpkg
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
` (16 preceding siblings ...)
2022-06-12 1:19 ` 0x5c
@ 2022-06-13 8:27 ` leahneukirchen
17 siblings, 0 replies; 19+ messages in thread
From: leahneukirchen @ 2022-06-13 8:27 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]
There's a merged pull request on the void-packages repository
i2c-tools: change upstream and add python subpkg
https://github.com/void-linux/void-packages/pull/36304
Description:
~~Things I am still unsure about:~~
- ~~The subpackage name and short_desc~~
- ~~How to ensure the subpackage's version is the version of the python module (it is versioned separately)~~
Closes #36156
#### Testing the changes
- I tested the changes in this PR: **briefly**
- [x] Distfile location change had no impact (same exact file as debian's)
- [x] Package builds fine and with the right files in the right place
- [x] Crossbuilds fine
- [x] Tested the python bindings
@leahneukirchen
<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2022-06-13 8:27 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23 21:23 [PR PATCH] i2c-tools: change upstream and add python subpkg 0x5c
2022-03-23 21:44 ` leahneukirchen
2022-03-29 11:11 ` [PR PATCH] [Updated] " 0x5c
2022-03-29 11:16 ` 0x5c
2022-05-07 9:11 ` [PR PATCH] [Updated] " 0x5c
2022-05-07 9:26 ` 0x5c
2022-05-07 22:55 ` [PR PATCH] [Updated] " 0x5c
2022-05-22 19:33 ` [PR REVIEW] " classabbyamp
2022-05-22 19:34 ` classabbyamp
2022-05-23 4:52 ` [PR PATCH] [Updated] " 0x5c
2022-05-23 4:57 ` [PR REVIEW] " 0x5c
2022-05-23 4:59 ` 0x5c
2022-05-23 4:59 ` 0x5c
2022-05-27 22:54 ` [PR PATCH] [Updated] " 0x5c
2022-05-27 23:05 ` 0x5c
2022-05-27 23:22 ` 0x5c
2022-06-12 1:14 ` 0x5c
2022-06-12 1:19 ` 0x5c
2022-06-13 8:27 ` [PR PATCH] [Merged]: " leahneukirchen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).