Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps
@ 2023-09-17 23:39 tornaria
  2023-09-17 23:41 ` tornaria
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: tornaria @ 2023-09-17 23:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1847 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages matplotlib
https://github.com/void-linux/void-packages/pull/46109

python3-matplotlib: update to 3.8.0, also update deps
- python3-matplotlib: update to 3.8.0. (@ahesford)
- python3-kiwisolver: update to 1.4.5, adopt.
- python3-contourpy: update to 1.1.1. (@misuchiru03) 

#### Testing the changes
- I tested the changes in this PR: **briefly**

The update to matplotlib affects sagemath in a mild way (see https://github.com/sagemath/sage/pull/36279 which contains a fix).

I have not yet tested the updates to contourpy and kiwisolver with sagemath, will do.

I'm not sure it's necessary to patch sagemath now as the issue is very minor.

Btw, I'm thinking of packaging https://matplotlib.org/ipympl/ since it seems it will be a standard dependency of sagemath soon (https://github.com/sagemath/sage/pull/36129#issuecomment-1696062778)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
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/46109.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-matplotlib-46109.patch --]
[-- Type: text/x-diff, Size: 5517 bytes --]

From 578e79bf4b8e7dc760efeb6933c2c1f84e2a4e80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:47:30 -0300
Subject: [PATCH 1/3] python3-contourpy: update to 1.1.1.

---
 srcpkgs/python3-contourpy/template | 14 +++++++++-----
 srcpkgs/python3-contourpy/update   |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/python3-contourpy/update

diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index 70e3833c8b55a..bec86f8ee7959 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -1,9 +1,9 @@
 # Template file for 'python3-contourpy'
 pkgname=python3-contourpy
-version=1.0.5
-revision=2
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-pybind11"
+version=1.1.1
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-meson-python python3-pybind11"
 makedepends="python3-pybind11"
 depends="python3"
 checkdepends="${depends} python3-pytest-xdist python3-numpy"
@@ -11,8 +11,12 @@ short_desc="Python library for calculating contours of 2D quadrilateral grids"
 maintainer="Alex Childs <misuchiru03+github@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/contourpy/contourpy"
+changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/changelog.rst"
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
-checksum=896631cd40222aef3697e4e51177d14c3709fda49d30983269d584f034acc8a4
+checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
+
+# This test needs `wurlitzer`, not packaged
+make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 
 # Pulling python3-matplotlib creates a build-time dependency
 if [ "$XBPS_CHECK_PKGS" = full ]; then
diff --git a/srcpkgs/python3-contourpy/update b/srcpkgs/python3-contourpy/update
new file mode 100644
index 0000000000000..e299d00ea67cd
--- /dev/null
+++ b/srcpkgs/python3-contourpy/update
@@ -0,0 +1 @@
+ignore="*rc*"

From 5884dbfb405141fd8473c749ba69c7577a490662 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:56:57 -0300
Subject: [PATCH 2/3] python3-kiwisolver: update to 1.4.5, adopt.

---
 srcpkgs/python3-kiwisolver/template | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 3e4e2d55823da..8ebb7358be99e 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -1,17 +1,19 @@
 # Template file for 'python3-kiwisolver'
 pkgname=python3-kiwisolver
-version=1.3.1
-revision=4
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-cppy"
+version=1.4.5
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools_scm python3-wheel python3-cppy"
 makedepends="python3-devel python3-cppy"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Fast implementation of the Cassowary constraint solver (Python3)"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://github.com/nucleic/kiwi"
+changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
-checksum=950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248
+checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
 post_patch() {
 	# When cross building, make sure target cppy headers are used

From 461474c87ec0f5367ea7a2f1262f661b27841d96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 13:15:51 -0300
Subject: [PATCH 3/3] python3-matplotlib: update to 3.8.0.

---
 srcpkgs/python3-matplotlib/template | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-matplotlib/template b/srcpkgs/python3-matplotlib/template
index e8c3b07f9b9ca..90e899c2b2f52 100644
--- a/srcpkgs/python3-matplotlib/template
+++ b/srcpkgs/python3-matplotlib/template
@@ -1,11 +1,11 @@
 # Template file for 'python3-matplotlib'
 pkgname=python3-matplotlib
-version=3.7.2
+version=3.8.0
 revision=1
-build_style=python3-module
+build_style=python3-pep517
 build_helper="numpy"
 hostmakedepends="pkg-config python3-setuptools_scm python3-certifi
- python3-numpy python3-pybind11"
+ python3-numpy python3-pybind11 python3-wheel"
 makedepends="python3-devel freetype-devel libpng-devel libqhull-devel python3-pybind11"
 depends="python3-cycler fonttools python3-kiwisolver python3-numpy
  python3-packaging python3-Pillow python3-parsing python3-dateutil
@@ -14,8 +14,9 @@ short_desc="Python3 2D/3D plotting library"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="custom:matplotlib, BSD-3-Clause, MIT"
 homepage="https://matplotlib.org/"
+changelog="https://github.com/matplotlib/matplotlib/releases"
 distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz"
-checksum=a8cdb91dddb04436bd2f098b8fdf4b81352e68cf4d2c6756fcc414791076569b
+checksum=df8505e1c19d5c2c26aff3497a7cbd3ccfc2e97043d1e4db3e76afa399164b69
 replaces="python3-matplotlib-data>=0"
 # Comparison of images is too frail for validation
 make_check="no"
@@ -26,6 +27,7 @@ pre_build() {
 	system_freetype = true
 	system_qhull = true
 	EOF
+	vsed -e "s|'-flto'|'-flto=auto'|" -i setup.py
 }
 
 post_install() {

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
@ 2023-09-17 23:41 ` tornaria
  2023-09-17 23:43 ` tornaria
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-17 23:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1722599968

Comment:
Also, maybe it's time to remove `INSTALL.msg` (or move to `README.voidlinux`) ?

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
  2023-09-17 23:41 ` tornaria
@ 2023-09-17 23:43 ` tornaria
  2023-09-18  0:09 ` tornaria
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-17 23:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1722600390

Comment:
My bad, I didn't try to cross build contourpy, which moved build to meson. Will do later.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
  2023-09-17 23:41 ` tornaria
  2023-09-17 23:43 ` tornaria
@ 2023-09-18  0:09 ` tornaria
  2023-09-20  3:03 ` [PR PATCH] [Updated] " tornaria
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-18  0:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1722608867

Comment:
```
../meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/builddir/python3-contourpy-1.1.1/.mesonpy-_m950dhd/meson-private/sanitycheckcpp.exe'.
```

Seems meson needs to be configured for cross build. However, `build_style=meson` + `build_helper=python3` doesn't work out of the box, and there is no build helper for meson... The only template using mesonpy seems to be scipy, which does `build_style=meson` + `build_helper=python3` but then needs custom `do_build()` and `do_install()`.

I rather prefer it there was a build helper for meson which fixes whatever is necessary for meson to build, if such a thing is possible...

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

* Re: [PR PATCH] [Updated] python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (2 preceding siblings ...)
  2023-09-18  0:09 ` tornaria
@ 2023-09-20  3:03 ` tornaria
  2023-09-20  3:09 ` tornaria
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20  3:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages matplotlib
https://github.com/void-linux/void-packages/pull/46109

python3-matplotlib: update to 3.8.0, also update deps
- python3-matplotlib: update to 3.8.0. (@ahesford)
- python3-kiwisolver: update to 1.4.5, adopt.
- python3-contourpy: update to 1.1.1. (@misuchiru03) 

#### Testing the changes
- I tested the changes in this PR: **briefly**

The update to matplotlib affects sagemath in a mild way (see https://github.com/sagemath/sage/pull/36279 which contains a fix).

I have not yet tested the updates to contourpy and kiwisolver with sagemath, will do.

I'm not sure it's necessary to patch sagemath now as the issue is very minor.

Btw, I'm thinking of packaging https://matplotlib.org/ipympl/ since it seems it will be a standard dependency of sagemath soon (https://github.com/sagemath/sage/pull/36129#issuecomment-1696062778)

Edit: in #46003 I added a patch to sagemath, to support matplotlib 3.8.0, so we don't need to rebuild sagemath twice.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
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/46109.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-matplotlib-46109.patch --]
[-- Type: text/x-diff, Size: 9769 bytes --]

From 154461d9cc7067730fc01b46e24a9ac6fdff18f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:47:30 -0300
Subject: [PATCH 1/4] python3-contourpy: update to 1.1.1.

---
 srcpkgs/python3-contourpy/template | 14 +++++++++-----
 srcpkgs/python3-contourpy/update   |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/python3-contourpy/update

diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index 70e3833c8b55a..bec86f8ee7959 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -1,9 +1,9 @@
 # Template file for 'python3-contourpy'
 pkgname=python3-contourpy
-version=1.0.5
-revision=2
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-pybind11"
+version=1.1.1
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-meson-python python3-pybind11"
 makedepends="python3-pybind11"
 depends="python3"
 checkdepends="${depends} python3-pytest-xdist python3-numpy"
@@ -11,8 +11,12 @@ short_desc="Python library for calculating contours of 2D quadrilateral grids"
 maintainer="Alex Childs <misuchiru03+github@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/contourpy/contourpy"
+changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/changelog.rst"
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
-checksum=896631cd40222aef3697e4e51177d14c3709fda49d30983269d584f034acc8a4
+checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
+
+# This test needs `wurlitzer`, not packaged
+make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 
 # Pulling python3-matplotlib creates a build-time dependency
 if [ "$XBPS_CHECK_PKGS" = full ]; then
diff --git a/srcpkgs/python3-contourpy/update b/srcpkgs/python3-contourpy/update
new file mode 100644
index 0000000000000..e299d00ea67cd
--- /dev/null
+++ b/srcpkgs/python3-contourpy/update
@@ -0,0 +1 @@
+ignore="*rc*"

From c324df6ee76995e7ce1e932f966e7144201b0ec6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:56:57 -0300
Subject: [PATCH 2/4] python3-kiwisolver: update to 1.4.5, adopt.

---
 srcpkgs/python3-kiwisolver/template | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 3e4e2d55823da..8ebb7358be99e 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -1,17 +1,19 @@
 # Template file for 'python3-kiwisolver'
 pkgname=python3-kiwisolver
-version=1.3.1
-revision=4
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-cppy"
+version=1.4.5
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools_scm python3-wheel python3-cppy"
 makedepends="python3-devel python3-cppy"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Fast implementation of the Cassowary constraint solver (Python3)"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://github.com/nucleic/kiwi"
+changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
-checksum=950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248
+checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
 post_patch() {
 	# When cross building, make sure target cppy headers are used

From 2fd25f09f3dfbacc3b899ae59741a5c9e3a876a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 13:15:51 -0300
Subject: [PATCH 3/4] python3-matplotlib: update to 3.8.0.

---
 srcpkgs/python3-matplotlib/template | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-matplotlib/template b/srcpkgs/python3-matplotlib/template
index e8c3b07f9b9ca..90e899c2b2f52 100644
--- a/srcpkgs/python3-matplotlib/template
+++ b/srcpkgs/python3-matplotlib/template
@@ -1,11 +1,11 @@
 # Template file for 'python3-matplotlib'
 pkgname=python3-matplotlib
-version=3.7.2
+version=3.8.0
 revision=1
-build_style=python3-module
+build_style=python3-pep517
 build_helper="numpy"
 hostmakedepends="pkg-config python3-setuptools_scm python3-certifi
- python3-numpy python3-pybind11"
+ python3-numpy python3-pybind11 python3-wheel"
 makedepends="python3-devel freetype-devel libpng-devel libqhull-devel python3-pybind11"
 depends="python3-cycler fonttools python3-kiwisolver python3-numpy
  python3-packaging python3-Pillow python3-parsing python3-dateutil
@@ -14,8 +14,9 @@ short_desc="Python3 2D/3D plotting library"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="custom:matplotlib, BSD-3-Clause, MIT"
 homepage="https://matplotlib.org/"
+changelog="https://github.com/matplotlib/matplotlib/releases"
 distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz"
-checksum=a8cdb91dddb04436bd2f098b8fdf4b81352e68cf4d2c6756fcc414791076569b
+checksum=df8505e1c19d5c2c26aff3497a7cbd3ccfc2e97043d1e4db3e76afa399164b69
 replaces="python3-matplotlib-data>=0"
 # Comparison of images is too frail for validation
 make_check="no"
@@ -26,6 +27,7 @@ pre_build() {
 	system_freetype = true
 	system_qhull = true
 	EOF
+	vsed -e "s|'-flto'|'-flto=auto'|" -i setup.py
 }
 
 post_install() {

From 089ef376d78871b30133ef125c6266a4a8a1e187 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 00:01:58 -0300
Subject: [PATCH 4/4] python3-contourpy: fix cross build

---
 common/build-style/python3-pep517.sh          |  4 +-
 .../post-patch/00-create-meson_crossfile.sh   | 79 +++++++++++++++++++
 srcpkgs/python3-contourpy/template            |  5 ++
 3 files changed, 86 insertions(+), 2 deletions(-)
 create mode 100644 common/hooks/post-patch/00-create-meson_crossfile.sh

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 2d5ff7caf34eb..5c067e5a04ac2 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -4,8 +4,8 @@
 
 do_build() {
 	: ${make_build_target:=.}
-	: ${make_build_args:=--no-isolation  --wheel}
-	python3 -m build ${make_build_args} ${make_build_target}
+	python3 -m build --no-isolation --wheel \
+		${make_build_args} ${make_build_target}
 }
 
 do_check() {
diff --git a/common/hooks/post-patch/00-create-meson_crossfile.sh b/common/hooks/post-patch/00-create-meson_crossfile.sh
new file mode 100644
index 0000000000000..0291481fc7b64
--- /dev/null
+++ b/common/hooks/post-patch/00-create-meson_crossfile.sh
@@ -0,0 +1,79 @@
+# This hook creates a meson crossfile in ${meson_crossfile} (if set)
+
+hook() {
+	[ ${meson_crossfile} ] || return 0
+
+	local _MESON_TARGET_ENDIAN=little
+	# drop the -musl suffix to the target cpu, meson doesn't recognize it
+	local _MESON_TARGET_CPU=${XBPS_TARGET_MACHINE/-musl/}
+	local _MESON_CPU_FAMILY=${_MESON_TARGET_CPU}
+	case "$XBPS_TARGET_MACHINE" in
+		mips|mips-musl|mipshf-musl)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=mips
+			;;
+		armv*)
+			_MESON_CPU_FAMILY=arm
+			;;
+		i686*)
+			_MESON_CPU_FAMILY=x86
+			;;
+		ppc64le*)
+			_MESON_CPU_FAMILY=ppc64
+			;;
+		ppc64*)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=ppc64
+			;;
+		ppcle*)
+			_MESON_CPU_FAMILY=ppc
+			;;
+		ppc*)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=ppc
+			;;
+	esac
+
+	local _MESON_EXE_WRAPPER=""
+	if [[ " $build_helper " = *" qemu "* ]]; then
+		_MESON_EXE_WRAPPER="exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static'"
+	fi
+
+	# Record cross-compiling information in cross file.
+	# CFLAGS and LDFLAGS must be set as c_args and c_link_args.
+	mkdir -p $(dirname ${meson_crossfile})
+	cat > ${meson_crossfile} <<-EOF
+		[binaries]
+		c = '${CC}'
+		cpp = '${CXX}'
+		ar = '${XBPS_CROSS_TRIPLET}-gcc-ar'
+		nm = '${NM}'
+		ld = '${LD}'
+		strip = '${STRIP}'
+		readelf = '${READELF}'
+		objcopy = '${OBJCOPY}'
+		pkgconfig = '${PKG_CONFIG}'
+		rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROSS_BASE}/usr']
+		g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
+		g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
+		g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
+		llvm-config = '/usr/bin/llvm-config'
+		cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
+
+		[properties]
+		needs_exe_wrapper = true
+
+		[built-in options]
+		c_args = ['$(echo ${CFLAGS} | sed -r "s/\s+/','/g")']
+		c_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
+
+		cpp_args = ['$(echo ${CXXFLAGS} | sed -r "s/\s+/','/g")']
+		cpp_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
+
+		[host_machine]
+		system = 'linux'
+		cpu_family = '${_MESON_CPU_FAMILY}'
+		cpu = '${_MESON_TARGET_CPU}'
+		endian = '${_MESON_TARGET_ENDIAN}'
+		EOF
+}
diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index bec86f8ee7959..1675dadfdea16 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -15,6 +15,11 @@ changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/chang
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
 checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
 
+if [ $CROSS_BUILD ]; then
+	meson_crossfile=$wrksrc/xbps_meson.cross
+	make_build_args="--config-setting=setup-args=--cross-file=$meson_crossfile"
+fi
+
 # This test needs `wurlitzer`, not packaged
 make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (3 preceding siblings ...)
  2023-09-20  3:03 ` [PR PATCH] [Updated] " tornaria
@ 2023-09-20  3:09 ` tornaria
  2023-09-20  3:11 ` tornaria
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20  3:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 758 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1726817020

Comment:
Here's a first proof of concept of fixing cross build for contourpy (see also: #46117).

Summary:
 1. there is a post-patch hook which will create a meson cross file in `$meson_crossfile` if that variable is set.
 2. the template for `python3-contourpy` will, if cross building, set `meson_crossfile=$wrksrc/xbps_meson.cross` to instruct the hook to create the crossfile; and it also sets `make_build_args=--config-setting=setup-args=--cross-file=$meson_crossfile` so the crossfile gets passed to meson
 3. note that I had to change the `python3-pep517" build-style so the `make_build_args` variable is usable.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (4 preceding siblings ...)
  2023-09-20  3:09 ` tornaria
@ 2023-09-20  3:11 ` tornaria
  2023-09-20  3:34 ` [PR PATCH] [Updated] " tornaria
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20  3:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1726818197

Comment:
Ok, now CI fails on cross because of `kiwisolver`, but the meson thing seems to be working fine.

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

* Re: [PR PATCH] [Updated] python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (5 preceding siblings ...)
  2023-09-20  3:11 ` tornaria
@ 2023-09-20  3:34 ` tornaria
  2023-09-20  4:22 ` tornaria
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20  3:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages matplotlib
https://github.com/void-linux/void-packages/pull/46109

python3-matplotlib: update to 3.8.0, also update deps
- python3-matplotlib: update to 3.8.0. (@ahesford)
- python3-kiwisolver: update to 1.4.5, adopt.
- python3-contourpy: update to 1.1.1. (@misuchiru03) 

#### Testing the changes
- I tested the changes in this PR: **briefly**

The update to matplotlib affects sagemath in a mild way (see https://github.com/sagemath/sage/pull/36279 which contains a fix).

I have not yet tested the updates to contourpy and kiwisolver with sagemath, will do.

I'm not sure it's necessary to patch sagemath now as the issue is very minor.

Btw, I'm thinking of packaging https://matplotlib.org/ipympl/ since it seems it will be a standard dependency of sagemath soon (https://github.com/sagemath/sage/pull/36129#issuecomment-1696062778)

Edit: in #46003 I added a patch to sagemath, to support matplotlib 3.8.0, so we don't need to rebuild sagemath twice.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
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/46109.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-matplotlib-46109.patch --]
[-- Type: text/x-diff, Size: 10804 bytes --]

From 154461d9cc7067730fc01b46e24a9ac6fdff18f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:47:30 -0300
Subject: [PATCH 1/5] python3-contourpy: update to 1.1.1.

---
 srcpkgs/python3-contourpy/template | 14 +++++++++-----
 srcpkgs/python3-contourpy/update   |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/python3-contourpy/update

diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index 70e3833c8b55a..bec86f8ee7959 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -1,9 +1,9 @@
 # Template file for 'python3-contourpy'
 pkgname=python3-contourpy
-version=1.0.5
-revision=2
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-pybind11"
+version=1.1.1
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-meson-python python3-pybind11"
 makedepends="python3-pybind11"
 depends="python3"
 checkdepends="${depends} python3-pytest-xdist python3-numpy"
@@ -11,8 +11,12 @@ short_desc="Python library for calculating contours of 2D quadrilateral grids"
 maintainer="Alex Childs <misuchiru03+github@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/contourpy/contourpy"
+changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/changelog.rst"
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
-checksum=896631cd40222aef3697e4e51177d14c3709fda49d30983269d584f034acc8a4
+checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
+
+# This test needs `wurlitzer`, not packaged
+make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 
 # Pulling python3-matplotlib creates a build-time dependency
 if [ "$XBPS_CHECK_PKGS" = full ]; then
diff --git a/srcpkgs/python3-contourpy/update b/srcpkgs/python3-contourpy/update
new file mode 100644
index 0000000000000..e299d00ea67cd
--- /dev/null
+++ b/srcpkgs/python3-contourpy/update
@@ -0,0 +1 @@
+ignore="*rc*"

From c324df6ee76995e7ce1e932f966e7144201b0ec6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:56:57 -0300
Subject: [PATCH 2/5] python3-kiwisolver: update to 1.4.5, adopt.

---
 srcpkgs/python3-kiwisolver/template | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 3e4e2d55823da..8ebb7358be99e 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -1,17 +1,19 @@
 # Template file for 'python3-kiwisolver'
 pkgname=python3-kiwisolver
-version=1.3.1
-revision=4
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-cppy"
+version=1.4.5
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools_scm python3-wheel python3-cppy"
 makedepends="python3-devel python3-cppy"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Fast implementation of the Cassowary constraint solver (Python3)"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://github.com/nucleic/kiwi"
+changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
-checksum=950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248
+checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
 post_patch() {
 	# When cross building, make sure target cppy headers are used

From 2fd25f09f3dfbacc3b899ae59741a5c9e3a876a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 13:15:51 -0300
Subject: [PATCH 3/5] python3-matplotlib: update to 3.8.0.

---
 srcpkgs/python3-matplotlib/template | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-matplotlib/template b/srcpkgs/python3-matplotlib/template
index e8c3b07f9b9ca..90e899c2b2f52 100644
--- a/srcpkgs/python3-matplotlib/template
+++ b/srcpkgs/python3-matplotlib/template
@@ -1,11 +1,11 @@
 # Template file for 'python3-matplotlib'
 pkgname=python3-matplotlib
-version=3.7.2
+version=3.8.0
 revision=1
-build_style=python3-module
+build_style=python3-pep517
 build_helper="numpy"
 hostmakedepends="pkg-config python3-setuptools_scm python3-certifi
- python3-numpy python3-pybind11"
+ python3-numpy python3-pybind11 python3-wheel"
 makedepends="python3-devel freetype-devel libpng-devel libqhull-devel python3-pybind11"
 depends="python3-cycler fonttools python3-kiwisolver python3-numpy
  python3-packaging python3-Pillow python3-parsing python3-dateutil
@@ -14,8 +14,9 @@ short_desc="Python3 2D/3D plotting library"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="custom:matplotlib, BSD-3-Clause, MIT"
 homepage="https://matplotlib.org/"
+changelog="https://github.com/matplotlib/matplotlib/releases"
 distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz"
-checksum=a8cdb91dddb04436bd2f098b8fdf4b81352e68cf4d2c6756fcc414791076569b
+checksum=df8505e1c19d5c2c26aff3497a7cbd3ccfc2e97043d1e4db3e76afa399164b69
 replaces="python3-matplotlib-data>=0"
 # Comparison of images is too frail for validation
 make_check="no"
@@ -26,6 +27,7 @@ pre_build() {
 	system_freetype = true
 	system_qhull = true
 	EOF
+	vsed -e "s|'-flto'|'-flto=auto'|" -i setup.py
 }
 
 post_install() {

From 089ef376d78871b30133ef125c6266a4a8a1e187 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 00:01:58 -0300
Subject: [PATCH 4/5] python3-contourpy: fix cross build

---
 common/build-style/python3-pep517.sh          |  4 +-
 .../post-patch/00-create-meson_crossfile.sh   | 79 +++++++++++++++++++
 srcpkgs/python3-contourpy/template            |  5 ++
 3 files changed, 86 insertions(+), 2 deletions(-)
 create mode 100644 common/hooks/post-patch/00-create-meson_crossfile.sh

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 2d5ff7caf34eb..5c067e5a04ac2 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -4,8 +4,8 @@
 
 do_build() {
 	: ${make_build_target:=.}
-	: ${make_build_args:=--no-isolation  --wheel}
-	python3 -m build ${make_build_args} ${make_build_target}
+	python3 -m build --no-isolation --wheel \
+		${make_build_args} ${make_build_target}
 }
 
 do_check() {
diff --git a/common/hooks/post-patch/00-create-meson_crossfile.sh b/common/hooks/post-patch/00-create-meson_crossfile.sh
new file mode 100644
index 0000000000000..0291481fc7b64
--- /dev/null
+++ b/common/hooks/post-patch/00-create-meson_crossfile.sh
@@ -0,0 +1,79 @@
+# This hook creates a meson crossfile in ${meson_crossfile} (if set)
+
+hook() {
+	[ ${meson_crossfile} ] || return 0
+
+	local _MESON_TARGET_ENDIAN=little
+	# drop the -musl suffix to the target cpu, meson doesn't recognize it
+	local _MESON_TARGET_CPU=${XBPS_TARGET_MACHINE/-musl/}
+	local _MESON_CPU_FAMILY=${_MESON_TARGET_CPU}
+	case "$XBPS_TARGET_MACHINE" in
+		mips|mips-musl|mipshf-musl)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=mips
+			;;
+		armv*)
+			_MESON_CPU_FAMILY=arm
+			;;
+		i686*)
+			_MESON_CPU_FAMILY=x86
+			;;
+		ppc64le*)
+			_MESON_CPU_FAMILY=ppc64
+			;;
+		ppc64*)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=ppc64
+			;;
+		ppcle*)
+			_MESON_CPU_FAMILY=ppc
+			;;
+		ppc*)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=ppc
+			;;
+	esac
+
+	local _MESON_EXE_WRAPPER=""
+	if [[ " $build_helper " = *" qemu "* ]]; then
+		_MESON_EXE_WRAPPER="exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static'"
+	fi
+
+	# Record cross-compiling information in cross file.
+	# CFLAGS and LDFLAGS must be set as c_args and c_link_args.
+	mkdir -p $(dirname ${meson_crossfile})
+	cat > ${meson_crossfile} <<-EOF
+		[binaries]
+		c = '${CC}'
+		cpp = '${CXX}'
+		ar = '${XBPS_CROSS_TRIPLET}-gcc-ar'
+		nm = '${NM}'
+		ld = '${LD}'
+		strip = '${STRIP}'
+		readelf = '${READELF}'
+		objcopy = '${OBJCOPY}'
+		pkgconfig = '${PKG_CONFIG}'
+		rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROSS_BASE}/usr']
+		g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
+		g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
+		g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
+		llvm-config = '/usr/bin/llvm-config'
+		cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
+
+		[properties]
+		needs_exe_wrapper = true
+
+		[built-in options]
+		c_args = ['$(echo ${CFLAGS} | sed -r "s/\s+/','/g")']
+		c_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
+
+		cpp_args = ['$(echo ${CXXFLAGS} | sed -r "s/\s+/','/g")']
+		cpp_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
+
+		[host_machine]
+		system = 'linux'
+		cpu_family = '${_MESON_CPU_FAMILY}'
+		cpu = '${_MESON_TARGET_CPU}'
+		endian = '${_MESON_TARGET_ENDIAN}'
+		EOF
+}
diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index bec86f8ee7959..1675dadfdea16 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -15,6 +15,11 @@ changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/chang
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
 checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
 
+if [ $CROSS_BUILD ]; then
+	meson_crossfile=$wrksrc/xbps_meson.cross
+	make_build_args="--config-setting=setup-args=--cross-file=$meson_crossfile"
+fi
+
 # This test needs `wurlitzer`, not packaged
 make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 

From d2de647a72c7c65d692b956c66518ce4a8fbcc40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 00:34:19 -0300
Subject: [PATCH 5/5] python3-kiwisolver: fix cross build

---
 srcpkgs/python3-kiwisolver/template | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 8ebb7358be99e..ecea82d14e06c 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -15,14 +15,6 @@ changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
 checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
-post_patch() {
-	# When cross building, make sure target cppy headers are used
-	if [ -n "${XBPS_CROSS_BASE}" ]; then
-		vsed -i setup.py \
-			-e "s@cppy.get_include()@&.replace('/usr/', '${XBPS_CROSS_BASE}/usr/')@"
-	fi
-}
-
 post_install() {
 	vlicense LICENSE
 }

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (6 preceding siblings ...)
  2023-09-20  3:34 ` [PR PATCH] [Updated] " tornaria
@ 2023-09-20  4:22 ` tornaria
  2023-09-20  4:40 ` [PR PATCH] [Updated] " tornaria
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20  4:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1726943603

Comment:
So it seems the build is picking up incorrect include paths, e.g. `-I/usr/include/python3.11` and this causes trouble when target word size is different from host wordsize...

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

* Re: [PR PATCH] [Updated] python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (7 preceding siblings ...)
  2023-09-20  4:22 ` tornaria
@ 2023-09-20  4:40 ` tornaria
  2023-09-20  4:42 ` tornaria
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20  4:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages matplotlib
https://github.com/void-linux/void-packages/pull/46109

python3-matplotlib: update to 3.8.0, also update deps
- python3-matplotlib: update to 3.8.0. (@ahesford)
- python3-kiwisolver: update to 1.4.5, adopt.
- python3-contourpy: update to 1.1.1. (@misuchiru03) 

#### Testing the changes
- I tested the changes in this PR: **briefly**

The update to matplotlib affects sagemath in a mild way (see https://github.com/sagemath/sage/pull/36279 which contains a fix).

I have not yet tested the updates to contourpy and kiwisolver with sagemath, will do.

I'm not sure it's necessary to patch sagemath now as the issue is very minor.

Btw, I'm thinking of packaging https://matplotlib.org/ipympl/ since it seems it will be a standard dependency of sagemath soon (https://github.com/sagemath/sage/pull/36129#issuecomment-1696062778)

Edit: in #46003 I added a patch to sagemath, to support matplotlib 3.8.0, so we don't need to rebuild sagemath twice.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
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/46109.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-matplotlib-46109.patch --]
[-- Type: text/x-diff, Size: 12941 bytes --]

From 154461d9cc7067730fc01b46e24a9ac6fdff18f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:47:30 -0300
Subject: [PATCH 1/6] python3-contourpy: update to 1.1.1.

---
 srcpkgs/python3-contourpy/template | 14 +++++++++-----
 srcpkgs/python3-contourpy/update   |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/python3-contourpy/update

diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index 70e3833c8b55a..bec86f8ee7959 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -1,9 +1,9 @@
 # Template file for 'python3-contourpy'
 pkgname=python3-contourpy
-version=1.0.5
-revision=2
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-pybind11"
+version=1.1.1
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-meson-python python3-pybind11"
 makedepends="python3-pybind11"
 depends="python3"
 checkdepends="${depends} python3-pytest-xdist python3-numpy"
@@ -11,8 +11,12 @@ short_desc="Python library for calculating contours of 2D quadrilateral grids"
 maintainer="Alex Childs <misuchiru03+github@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/contourpy/contourpy"
+changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/changelog.rst"
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
-checksum=896631cd40222aef3697e4e51177d14c3709fda49d30983269d584f034acc8a4
+checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
+
+# This test needs `wurlitzer`, not packaged
+make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 
 # Pulling python3-matplotlib creates a build-time dependency
 if [ "$XBPS_CHECK_PKGS" = full ]; then
diff --git a/srcpkgs/python3-contourpy/update b/srcpkgs/python3-contourpy/update
new file mode 100644
index 0000000000000..e299d00ea67cd
--- /dev/null
+++ b/srcpkgs/python3-contourpy/update
@@ -0,0 +1 @@
+ignore="*rc*"

From c324df6ee76995e7ce1e932f966e7144201b0ec6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:56:57 -0300
Subject: [PATCH 2/6] python3-kiwisolver: update to 1.4.5, adopt.

---
 srcpkgs/python3-kiwisolver/template | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 3e4e2d55823da..8ebb7358be99e 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -1,17 +1,19 @@
 # Template file for 'python3-kiwisolver'
 pkgname=python3-kiwisolver
-version=1.3.1
-revision=4
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-cppy"
+version=1.4.5
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools_scm python3-wheel python3-cppy"
 makedepends="python3-devel python3-cppy"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Fast implementation of the Cassowary constraint solver (Python3)"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://github.com/nucleic/kiwi"
+changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
-checksum=950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248
+checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
 post_patch() {
 	# When cross building, make sure target cppy headers are used

From 2fd25f09f3dfbacc3b899ae59741a5c9e3a876a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 13:15:51 -0300
Subject: [PATCH 3/6] python3-matplotlib: update to 3.8.0.

---
 srcpkgs/python3-matplotlib/template | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-matplotlib/template b/srcpkgs/python3-matplotlib/template
index e8c3b07f9b9ca..90e899c2b2f52 100644
--- a/srcpkgs/python3-matplotlib/template
+++ b/srcpkgs/python3-matplotlib/template
@@ -1,11 +1,11 @@
 # Template file for 'python3-matplotlib'
 pkgname=python3-matplotlib
-version=3.7.2
+version=3.8.0
 revision=1
-build_style=python3-module
+build_style=python3-pep517
 build_helper="numpy"
 hostmakedepends="pkg-config python3-setuptools_scm python3-certifi
- python3-numpy python3-pybind11"
+ python3-numpy python3-pybind11 python3-wheel"
 makedepends="python3-devel freetype-devel libpng-devel libqhull-devel python3-pybind11"
 depends="python3-cycler fonttools python3-kiwisolver python3-numpy
  python3-packaging python3-Pillow python3-parsing python3-dateutil
@@ -14,8 +14,9 @@ short_desc="Python3 2D/3D plotting library"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="custom:matplotlib, BSD-3-Clause, MIT"
 homepage="https://matplotlib.org/"
+changelog="https://github.com/matplotlib/matplotlib/releases"
 distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz"
-checksum=a8cdb91dddb04436bd2f098b8fdf4b81352e68cf4d2c6756fcc414791076569b
+checksum=df8505e1c19d5c2c26aff3497a7cbd3ccfc2e97043d1e4db3e76afa399164b69
 replaces="python3-matplotlib-data>=0"
 # Comparison of images is too frail for validation
 make_check="no"
@@ -26,6 +27,7 @@ pre_build() {
 	system_freetype = true
 	system_qhull = true
 	EOF
+	vsed -e "s|'-flto'|'-flto=auto'|" -i setup.py
 }
 
 post_install() {

From 089ef376d78871b30133ef125c6266a4a8a1e187 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 00:01:58 -0300
Subject: [PATCH 4/6] python3-contourpy: fix cross build

---
 common/build-style/python3-pep517.sh          |  4 +-
 .../post-patch/00-create-meson_crossfile.sh   | 79 +++++++++++++++++++
 srcpkgs/python3-contourpy/template            |  5 ++
 3 files changed, 86 insertions(+), 2 deletions(-)
 create mode 100644 common/hooks/post-patch/00-create-meson_crossfile.sh

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 2d5ff7caf34eb..5c067e5a04ac2 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -4,8 +4,8 @@
 
 do_build() {
 	: ${make_build_target:=.}
-	: ${make_build_args:=--no-isolation  --wheel}
-	python3 -m build ${make_build_args} ${make_build_target}
+	python3 -m build --no-isolation --wheel \
+		${make_build_args} ${make_build_target}
 }
 
 do_check() {
diff --git a/common/hooks/post-patch/00-create-meson_crossfile.sh b/common/hooks/post-patch/00-create-meson_crossfile.sh
new file mode 100644
index 0000000000000..0291481fc7b64
--- /dev/null
+++ b/common/hooks/post-patch/00-create-meson_crossfile.sh
@@ -0,0 +1,79 @@
+# This hook creates a meson crossfile in ${meson_crossfile} (if set)
+
+hook() {
+	[ ${meson_crossfile} ] || return 0
+
+	local _MESON_TARGET_ENDIAN=little
+	# drop the -musl suffix to the target cpu, meson doesn't recognize it
+	local _MESON_TARGET_CPU=${XBPS_TARGET_MACHINE/-musl/}
+	local _MESON_CPU_FAMILY=${_MESON_TARGET_CPU}
+	case "$XBPS_TARGET_MACHINE" in
+		mips|mips-musl|mipshf-musl)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=mips
+			;;
+		armv*)
+			_MESON_CPU_FAMILY=arm
+			;;
+		i686*)
+			_MESON_CPU_FAMILY=x86
+			;;
+		ppc64le*)
+			_MESON_CPU_FAMILY=ppc64
+			;;
+		ppc64*)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=ppc64
+			;;
+		ppcle*)
+			_MESON_CPU_FAMILY=ppc
+			;;
+		ppc*)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=ppc
+			;;
+	esac
+
+	local _MESON_EXE_WRAPPER=""
+	if [[ " $build_helper " = *" qemu "* ]]; then
+		_MESON_EXE_WRAPPER="exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static'"
+	fi
+
+	# Record cross-compiling information in cross file.
+	# CFLAGS and LDFLAGS must be set as c_args and c_link_args.
+	mkdir -p $(dirname ${meson_crossfile})
+	cat > ${meson_crossfile} <<-EOF
+		[binaries]
+		c = '${CC}'
+		cpp = '${CXX}'
+		ar = '${XBPS_CROSS_TRIPLET}-gcc-ar'
+		nm = '${NM}'
+		ld = '${LD}'
+		strip = '${STRIP}'
+		readelf = '${READELF}'
+		objcopy = '${OBJCOPY}'
+		pkgconfig = '${PKG_CONFIG}'
+		rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROSS_BASE}/usr']
+		g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
+		g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
+		g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
+		llvm-config = '/usr/bin/llvm-config'
+		cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
+
+		[properties]
+		needs_exe_wrapper = true
+
+		[built-in options]
+		c_args = ['$(echo ${CFLAGS} | sed -r "s/\s+/','/g")']
+		c_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
+
+		cpp_args = ['$(echo ${CXXFLAGS} | sed -r "s/\s+/','/g")']
+		cpp_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
+
+		[host_machine]
+		system = 'linux'
+		cpu_family = '${_MESON_CPU_FAMILY}'
+		cpu = '${_MESON_TARGET_CPU}'
+		endian = '${_MESON_TARGET_ENDIAN}'
+		EOF
+}
diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index bec86f8ee7959..1675dadfdea16 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -15,6 +15,11 @@ changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/chang
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
 checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
 
+if [ $CROSS_BUILD ]; then
+	meson_crossfile=$wrksrc/xbps_meson.cross
+	make_build_args="--config-setting=setup-args=--cross-file=$meson_crossfile"
+fi
+
 # This test needs `wurlitzer`, not packaged
 make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 

From d2de647a72c7c65d692b956c66518ce4a8fbcc40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 00:34:19 -0300
Subject: [PATCH 5/6] python3-kiwisolver: fix cross build

---
 srcpkgs/python3-kiwisolver/template | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 8ebb7358be99e..ecea82d14e06c 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -15,14 +15,6 @@ changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
 checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
-post_patch() {
-	# When cross building, make sure target cppy headers are used
-	if [ -n "${XBPS_CROSS_BASE}" ]; then
-		vsed -i setup.py \
-			-e "s@cppy.get_include()@&.replace('/usr/', '${XBPS_CROSS_BASE}/usr/')@"
-	fi
-}
-
 post_install() {
 	vlicense LICENSE
 }

From 090d6ef4a114d00cf68cf8dbf77cee4070cdcf0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 01:37:35 -0300
Subject: [PATCH 6/6] python3-contourpy: fix cross build 32bit

---
 common/hooks/post-patch/00-create-meson_crossfile.sh | 1 +
 srcpkgs/python3-contourpy/template                   | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/common/hooks/post-patch/00-create-meson_crossfile.sh b/common/hooks/post-patch/00-create-meson_crossfile.sh
index 0291481fc7b64..b8dad3361db39 100644
--- a/common/hooks/post-patch/00-create-meson_crossfile.sh
+++ b/common/hooks/post-patch/00-create-meson_crossfile.sh
@@ -44,6 +44,7 @@ hook() {
 	mkdir -p $(dirname ${meson_crossfile})
 	cat > ${meson_crossfile} <<-EOF
 		[binaries]
+		${_MESON_EXE_WRAPPER}
 		c = '${CC}'
 		cpp = '${CXX}'
 		ar = '${XBPS_CROSS_TRIPLET}-gcc-ar'
diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index 1675dadfdea16..f84f44dd28d27 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -3,7 +3,7 @@ pkgname=python3-contourpy
 version=1.1.1
 revision=1
 build_style=python3-pep517
-hostmakedepends="python3-meson-python python3-pybind11"
+hostmakedepends="python3-meson-python python3-pybind11 pkg-config"
 makedepends="python3-pybind11"
 depends="python3"
 checkdepends="${depends} python3-pytest-xdist python3-numpy"
@@ -18,6 +18,13 @@ checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
 if [ $CROSS_BUILD ]; then
 	meson_crossfile=$wrksrc/xbps_meson.cross
 	make_build_args="--config-setting=setup-args=--cross-file=$meson_crossfile"
+
+	_pybind11_dir="${py3_sitelib}/pybind11"
+	export PKG_CONFIG_PATH="${XBPS_CROSS_BASE}/${_pybind11_dir}/share/pkgconfig"
+	# pybind11 uses a path relative to the pkgconfig file to set $prefix,
+	# which causes the wrapper to double-include $XBPS_CROSS_BASE; override
+	# so that the wrapper properly points to the right location
+	export PKG_CONFIG_PYBIND11_PREFIX="/${_pybind11_dir}"
 fi
 
 # This test needs `wurlitzer`, not packaged

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (8 preceding siblings ...)
  2023-09-20  4:40 ` [PR PATCH] [Updated] " tornaria
@ 2023-09-20  4:42 ` tornaria
  2023-09-20 15:07 ` ahesford
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20  4:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1726958156

Comment:
I copied a fix from `python3-scipy`, seems working now... :crossed_fingers: 

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (9 preceding siblings ...)
  2023-09-20  4:42 ` tornaria
@ 2023-09-20 15:07 ` ahesford
  2023-09-20 15:14 ` ahesford
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2023-09-20 15:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1386 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1727917244

Comment:
I think the hook brings too much magic. Setting `$meson_crossfile` and having the file magically appear is not really intuitive, and hooks are also somewhat less discoverable than build styles and build helpers. It also makes it more difficult for users to write a custom `$meson_crossfile`, because the hook will clobber it. If there is an argument for putting this behavior in a hook rather than a build style, I think that
1. It ought to write somewhere like `$XBPS_WRAPPERDIR`, which is a good place for "automatic" XBPS stuff.
2. It ought to be controlled by an indepedent variable (which is my major argument for using the helper; you opt in by adding the meson helper, but you can fine-tune `$meson_crossfile` as desired).

I seem to have https://github.com/void-linux/void-packages/pull/46117 working as expected but will do a more thorough test, and I've moved `python3-scipy` to this new mechanism over there (the dependencies for scipy complicate things quite a bit and don't really provide an advantage for `python3-pep517+meson` over `meson+python3`, but the helper should make your `contourpy` update no more complicated than it is with your hook approach.

Comments on the merits of the competing approach are appreciated.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (10 preceding siblings ...)
  2023-09-20 15:07 ` ahesford
@ 2023-09-20 15:14 ` ahesford
  2023-09-20 23:47 ` [PR PATCH] [Updated] " tornaria
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2023-09-20 15:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1727929462

Comment:
Regarding the change in `make_build_args` behavior to always force `--no-isolation` `--wheel`: this is a fine change, but if you keep it, please drop the corresponding arguments in the `pylint` template.

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

* Re: [PR PATCH] [Updated] python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (11 preceding siblings ...)
  2023-09-20 15:14 ` ahesford
@ 2023-09-20 23:47 ` tornaria
  2023-09-20 23:49 ` tornaria
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20 23:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages matplotlib
https://github.com/void-linux/void-packages/pull/46109

python3-matplotlib: update to 3.8.0, also update deps
- python3-matplotlib: update to 3.8.0. (@ahesford)
- python3-kiwisolver: update to 1.4.5, adopt.
- python3-contourpy: update to 1.1.1. (@misuchiru03) 

#### Testing the changes
- I tested the changes in this PR: **briefly**

The update to matplotlib affects sagemath in a mild way (see https://github.com/sagemath/sage/pull/36279 which contains a fix).

I have not yet tested the updates to contourpy and kiwisolver with sagemath, will do.

I'm not sure it's necessary to patch sagemath now as the issue is very minor.

Btw, I'm thinking of packaging https://matplotlib.org/ipympl/ since it seems it will be a standard dependency of sagemath soon (https://github.com/sagemath/sage/pull/36129#issuecomment-1696062778)

Edit: in #46003 I added a patch to sagemath, to support matplotlib 3.8.0, so we don't need to rebuild sagemath twice.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
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/46109.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-matplotlib-46109.patch --]
[-- Type: text/x-diff, Size: 16255 bytes --]

From 076cc35afc9441cd84e303a88e268c2994fda97b Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Mon, 18 Sep 2023 15:40:49 -0400
Subject: [PATCH 1/6] common/build-helper/meson.sh: new build helper, used by
 meson build style

---
 common/build-helper/meson.sh            | 82 ++++++++++++++++++++++++
 common/build-style/meson.sh             | 85 +------------------------
 common/environment/build-style/meson.sh |  1 +
 3 files changed, 84 insertions(+), 84 deletions(-)
 create mode 100644 common/build-helper/meson.sh

diff --git a/common/build-helper/meson.sh b/common/build-helper/meson.sh
new file mode 100644
index 0000000000000..1933306c18a4b
--- /dev/null
+++ b/common/build-helper/meson.sh
@@ -0,0 +1,82 @@
+# This bulid-helper writes a Meson cross-file, allowing other build styles
+# to properly drive cross-builds in Meson when appropriate
+
+if [ "$CROSS_BUILD" ]; then
+	mkdir -p "${XBPS_WRAPPERDIR}/meson"
+
+	_MESON_TARGET_ENDIAN=little
+	# drop the -musl suffix to the target cpu, meson doesn't recognize it
+	_MESON_TARGET_CPU=${XBPS_TARGET_MACHINE/-musl/}
+	case "$XBPS_TARGET_MACHINE" in
+		mips|mips-musl|mipshf-musl)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=mips
+			;;
+		armv*)
+			_MESON_CPU_FAMILY=arm
+			;;
+		i686*)
+			_MESON_CPU_FAMILY=x86
+			;;
+		ppc64le*)
+			_MESON_CPU_FAMILY=ppc64
+			;;
+		ppc64*)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=ppc64
+			;;
+		ppcle*)
+			_MESON_CPU_FAMILY=ppc
+			;;
+		ppc*)
+			_MESON_TARGET_ENDIAN=big
+			_MESON_CPU_FAMILY=ppc
+			;;
+		*)
+			# if we reached here that means that the cpu and cpu_family
+			# are the same like 'x86_64' and 'aarch64'
+			_MESON_CPU_FAMILY=${_MESON_TARGET_CPU}
+			;;
+	esac
+
+	# Tell meson to run binaries with qemu if desired
+	_MESON_EXE_WRAPPER=""
+	if [[ "${build_helper}" = *qemu* ]]; then
+		_MESON_EXE_WRAPPER="exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static'"
+	fi
+
+	# Record cross-compiling information in cross file.
+	#
+	# CFLAGS, CXXFLAGS and LDFLAGS are not yet available and
+	# will be taken from the environment at configure time.
+	cat > "${XBPS_WRAPPERDIR}/meson/xbps_meson.cross" <<-EOF
+		[binaries]
+		${_MESON_EXE_WRAPPER:-# exe_wrapper is not set}
+		c = '${CC}'
+		cpp = '${CXX}'
+		ar = '${XBPS_CROSS_TRIPLET}-gcc-ar'
+		nm = '${NM}'
+		ld = '${LD}'
+		strip = '${STRIP}'
+		readelf = '${READELF}'
+		objcopy = '${OBJCOPY}'
+		pkgconfig = '${PKG_CONFIG}'
+		rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROSS_BASE}/usr']
+		g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
+		g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
+		g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
+		llvm-config = '/usr/bin/llvm-config'
+		cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
+		
+		[properties]
+		needs_exe_wrapper = true
+		
+		[host_machine]
+		system = 'linux'
+		cpu_family = '${_MESON_CPU_FAMILY}'
+		cpu = '${_MESON_TARGET_CPU}'
+		endian = '${_MESON_TARGET_ENDIAN}'
+		EOF
+
+	unset _MESON_CPU_FAMILY _MESON_TARGET_CPU _MESON_TARGET_ENDIAN _MESON_EXE_WRAPPER
+fi
diff --git a/common/build-style/meson.sh b/common/build-style/meson.sh
index e983c5f42c2f7..5ea2eeda40097 100644
--- a/common/build-style/meson.sh
+++ b/common/build-style/meson.sh
@@ -1,94 +1,11 @@
 #
 # This helper is for templates using meson.
 #
-do_patch() {
-	: ${meson_crossfile:=xbps_meson.cross}
-
-	if [ "$CROSS_BUILD" ]; then
-		_MESON_TARGET_ENDIAN=little
-		# drop the -musl suffix to the target cpu, meson doesn't recognize it
-		_MESON_TARGET_CPU=${XBPS_TARGET_MACHINE/-musl/}
-		case "$XBPS_TARGET_MACHINE" in
-			mips|mips-musl|mipshf-musl)
-				_MESON_TARGET_ENDIAN=big
-				_MESON_CPU_FAMILY=mips
-				;;
-			armv*)
-				_MESON_CPU_FAMILY=arm
-				;;
-			i686*)
-				_MESON_CPU_FAMILY=x86
-				;;
-			ppc64le*)
-				_MESON_CPU_FAMILY=ppc64
-				;;
-			ppc64*)
-				_MESON_TARGET_ENDIAN=big
-				_MESON_CPU_FAMILY=ppc64
-				;;
-			ppcle*)
-				_MESON_CPU_FAMILY=ppc
-				;;
-			ppc*)
-				_MESON_TARGET_ENDIAN=big
-				_MESON_CPU_FAMILY=ppc
-				;;
-			*)
-				# if we reached here that means that the cpu and cpu_family
-				# are the same like 'x86_64' and 'aarch64'
-				_MESON_CPU_FAMILY=${_MESON_TARGET_CPU}
-				;;
-		esac
-
-		# Record cross-compiling information in cross file.
-		# CFLAGS and LDFLAGS must be set as c_args and c_link_args.
-		cat > ${meson_crossfile} <<EOF
-[binaries]
-c = '${CC}'
-cpp = '${CXX}'
-ar = '${XBPS_CROSS_TRIPLET}-gcc-ar'
-nm = '${NM}'
-ld = '${LD}'
-strip = '${STRIP}'
-readelf = '${READELF}'
-objcopy = '${OBJCOPY}'
-pkgconfig = '${PKG_CONFIG}'
-rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROSS_BASE}/usr']
-g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
-g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
-g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
-llvm-config = '/usr/bin/llvm-config'
-cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
-
-[properties]
-needs_exe_wrapper = true
-
-[built-in options]
-c_args = ['$(echo ${CFLAGS} | sed -r "s/\s+/','/g")']
-c_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
-
-cpp_args = ['$(echo ${CXXFLAGS} | sed -r "s/\s+/','/g")']
-cpp_link_args = ['$(echo ${LDFLAGS} | sed -r "s/\s+/','/g")']
-
-[host_machine]
-system = 'linux'
-cpu_family = '${_MESON_CPU_FAMILY}'
-cpu = '${_MESON_TARGET_CPU}'
-endian = '${_MESON_TARGET_ENDIAN}'
-EOF
-		if [[ $build_helper = *"qemu"* ]]; then
-			sed -e "/\[binaries\]/ a exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static'" \
-				-i ${meson_crossfile}
-		fi
-
-		unset _MESON_CPU_FAMILY _MESON_TARGET_CPU _MESON_TARGET_ENDIAN
-	fi
-}
 
 do_configure() {
 	: ${meson_cmd:=meson}
 	: ${meson_builddir:=build}
-	: ${meson_crossfile:=xbps_meson.cross}
+	: ${meson_crossfile:="${XBPS_WRAPPERDIR}/meson/xbps_meson.cross"}
 
 	if [ "$CROSS_BUILD" ]; then
 		configure_args+=" --cross-file=${meson_crossfile}"
diff --git a/common/environment/build-style/meson.sh b/common/environment/build-style/meson.sh
index d5a3c4141f7d9..dbfe93700f691 100644
--- a/common/environment/build-style/meson.sh
+++ b/common/environment/build-style/meson.sh
@@ -1 +1,2 @@
 hostmakedepends+=" meson"
+build_helper+=" meson"

From f95bf469bf6518559c5b1e51a3e2124aade5ac2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 19:32:18 -0300
Subject: [PATCH 2/6] python3-pybind11: add standard symlinks

---
 .../13-pkg-config-clean-xbps-cross-base-ref.sh        |  3 ++-
 srcpkgs/python3-pybind11/template                     | 11 ++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh b/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh
index 5cdfb0e9bfd2b..88ad06c41983a 100644
--- a/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh
+++ b/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh
@@ -16,7 +16,8 @@ hook() {
 			# s,/usr/armv7l-linux-musleabihf/usr,/usr,g
 			# trailing /usr to avoid clashing with
 			# other $XBPS_CROSS_BASE and $XBPS_CROSS_TRIPLET.
-			sed -i -e "s,$XBPS_CROSS_BASE/usr,/usr,g" "$f"
+			sed -i --follow-symlinks \
+				-e "s,$XBPS_CROSS_BASE/usr,/usr,g" "$f"
 		fi
 	done
 }
diff --git a/srcpkgs/python3-pybind11/template b/srcpkgs/python3-pybind11/template
index 3b6ce5b98688f..de80678f261cb 100644
--- a/srcpkgs/python3-pybind11/template
+++ b/srcpkgs/python3-pybind11/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-pybind11'
 pkgname=python3-pybind11
 version=2.11.1
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="cmake python3-setuptools
  python3-pytest python3-sphinx_rtd_theme python3-breathe"
@@ -44,6 +44,15 @@ do_check() {
 post_install() {
 	vlicense LICENSE
 
+	# symlink headers, cmake and pkgconfig into /usr
+	vmkdir usr/include
+	vmkdir usr/lib/cmake
+	vmkdir usr/lib/pkgconfig
+	_pybind11=${DESTDIR}/${py3_sitelib}/pybind11
+	ln -rs $_pybind11/include/pybind11 ${DESTDIR}/usr/include/
+	ln -rs $_pybind11/share/cmake/pybind11 ${DESTDIR}/usr/lib/cmake/
+	ln -rs $_pybind11/share/pkgconfig/pybind11.pc ${DESTDIR}/usr/lib/pkgconfig/
+
 	# Copy the man page, but make it section 7
 	_manpage=docs/.build/man/pybind11.1
 	vsed -i ${_manpage} -e '/^\.TH/ s/"1"/"7"/'

From 4dbe5bc8d27490b7d4bc06fd57dff27fabb014cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 19:38:13 -0300
Subject: [PATCH 3/6] common/build-style/python3-pep517.sh: improve build_args

1. The options `--no-isolation --wheel` are always required for the way
   the build-style works; we separate them from the `make_build_args`
   variable so the latter can be changed more easily.

2. When using the meson build-helper in a cross build, we add the
   correct argument to pass the crossfile to meson.

3. Now `make_build_args` is free to use in the template without having
   to worry about repeating the standard arguments.

   For instance `--skip-dependency-check` is a useful one (cf: pylint)
---
 common/build-style/python3-pep517.sh | 9 +++++++--
 srcpkgs/pylint/template              | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 2d5ff7caf34eb..7ff4cbb49907d 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -4,8 +4,13 @@
 
 do_build() {
 	: ${make_build_target:=.}
-	: ${make_build_args:=--no-isolation  --wheel}
-	python3 -m build ${make_build_args} ${make_build_target}
+	local build_args="--no-isolation --wheel"
+	if [ $CROSS_BUILD ] && [[ " $build_helper " = *" meson "* ]]; then
+		build_args+="
+		 -Csetup-args=--cross-file=${XBPS_WRAPPERDIR}/meson/xbps_meson.cross"
+	fi
+	python3 -m build $build_args \
+		${make_build_args} ${make_build_target}
 }
 
 do_check() {
diff --git a/srcpkgs/pylint/template b/srcpkgs/pylint/template
index 6032da0fb413e..cb56f4bdad1ec 100644
--- a/srcpkgs/pylint/template
+++ b/srcpkgs/pylint/template
@@ -3,7 +3,7 @@ pkgname=pylint
 version=2.17.4
 revision=1
 build_style=python3-pep517
-make_build_args="--skip-dependency-check --no-isolation --wheel"
+make_build_args="--skip-dependency-check"
 make_check_args="--deselect=tests/benchmark/test_baseline_benchmarks.py"
 hostmakedepends="python3-wheel"
 depends="python3-astroid python3-isort python3-mccabe python3-tomlkit

From b9ff72466eb645e82c8a1a54fed9c134dfd037a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:47:30 -0300
Subject: [PATCH 4/6] python3-contourpy: update to 1.1.1.

---
 srcpkgs/python3-contourpy/template | 15 ++++++++++-----
 srcpkgs/python3-contourpy/update   |  1 +
 2 files changed, 11 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/python3-contourpy/update

diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index 70e3833c8b55a..69f741a9b0eff 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -1,9 +1,10 @@
 # Template file for 'python3-contourpy'
 pkgname=python3-contourpy
-version=1.0.5
-revision=2
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-pybind11"
+version=1.1.1
+revision=1
+build_style=python3-pep517
+build_helper=meson
+hostmakedepends="python3-meson-python python3-pybind11 pkg-config"
 makedepends="python3-pybind11"
 depends="python3"
 checkdepends="${depends} python3-pytest-xdist python3-numpy"
@@ -11,8 +12,12 @@ short_desc="Python library for calculating contours of 2D quadrilateral grids"
 maintainer="Alex Childs <misuchiru03+github@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/contourpy/contourpy"
+changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/changelog.rst"
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
-checksum=896631cd40222aef3697e4e51177d14c3709fda49d30983269d584f034acc8a4
+checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
+
+# This test needs `wurlitzer`, not packaged
+make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 
 # Pulling python3-matplotlib creates a build-time dependency
 if [ "$XBPS_CHECK_PKGS" = full ]; then
diff --git a/srcpkgs/python3-contourpy/update b/srcpkgs/python3-contourpy/update
new file mode 100644
index 0000000000000..e299d00ea67cd
--- /dev/null
+++ b/srcpkgs/python3-contourpy/update
@@ -0,0 +1 @@
+ignore="*rc*"

From 18ce4b006f53d2f648512df42ea30b1b0572f4bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:56:57 -0300
Subject: [PATCH 5/6] python3-kiwisolver: update to 1.4.5, adopt.

---
 srcpkgs/python3-kiwisolver/template | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 3e4e2d55823da..ecea82d14e06c 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -1,25 +1,19 @@
 # Template file for 'python3-kiwisolver'
 pkgname=python3-kiwisolver
-version=1.3.1
-revision=4
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-cppy"
+version=1.4.5
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools_scm python3-wheel python3-cppy"
 makedepends="python3-devel python3-cppy"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Fast implementation of the Cassowary constraint solver (Python3)"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://github.com/nucleic/kiwi"
+changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
-checksum=950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248
-
-post_patch() {
-	# When cross building, make sure target cppy headers are used
-	if [ -n "${XBPS_CROSS_BASE}" ]; then
-		vsed -i setup.py \
-			-e "s@cppy.get_include()@&.replace('/usr/', '${XBPS_CROSS_BASE}/usr/')@"
-	fi
-}
+checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
 post_install() {
 	vlicense LICENSE

From 58f982db0fb150839b0957b5115999a27b08eb7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 13:15:51 -0300
Subject: [PATCH 6/6] python3-matplotlib: update to 3.8.0.

---
 srcpkgs/python3-matplotlib/template | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-matplotlib/template b/srcpkgs/python3-matplotlib/template
index e8c3b07f9b9ca..90e899c2b2f52 100644
--- a/srcpkgs/python3-matplotlib/template
+++ b/srcpkgs/python3-matplotlib/template
@@ -1,11 +1,11 @@
 # Template file for 'python3-matplotlib'
 pkgname=python3-matplotlib
-version=3.7.2
+version=3.8.0
 revision=1
-build_style=python3-module
+build_style=python3-pep517
 build_helper="numpy"
 hostmakedepends="pkg-config python3-setuptools_scm python3-certifi
- python3-numpy python3-pybind11"
+ python3-numpy python3-pybind11 python3-wheel"
 makedepends="python3-devel freetype-devel libpng-devel libqhull-devel python3-pybind11"
 depends="python3-cycler fonttools python3-kiwisolver python3-numpy
  python3-packaging python3-Pillow python3-parsing python3-dateutil
@@ -14,8 +14,9 @@ short_desc="Python3 2D/3D plotting library"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="custom:matplotlib, BSD-3-Clause, MIT"
 homepage="https://matplotlib.org/"
+changelog="https://github.com/matplotlib/matplotlib/releases"
 distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz"
-checksum=a8cdb91dddb04436bd2f098b8fdf4b81352e68cf4d2c6756fcc414791076569b
+checksum=df8505e1c19d5c2c26aff3497a7cbd3ccfc2e97043d1e4db3e76afa399164b69
 replaces="python3-matplotlib-data>=0"
 # Comparison of images is too frail for validation
 make_check="no"
@@ -26,6 +27,7 @@ pre_build() {
 	system_freetype = true
 	system_qhull = true
 	EOF
+	vsed -e "s|'-flto'|'-flto=auto'|" -i setup.py
 }
 
 post_install() {

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (12 preceding siblings ...)
  2023-09-20 23:47 ` [PR PATCH] [Updated] " tornaria
@ 2023-09-20 23:49 ` tornaria
  2023-09-23 11:59 ` [PR PATCH] [Updated] " tornaria
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-20 23:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1728564863

Comment:
@ahesford: here's another try. The first commit is cherry-picked verbatim from #46117.

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

* Re: [PR PATCH] [Updated] python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (13 preceding siblings ...)
  2023-09-20 23:49 ` tornaria
@ 2023-09-23 11:59 ` tornaria
  2023-09-23 12:01 ` tornaria
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-23 11:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages matplotlib
https://github.com/void-linux/void-packages/pull/46109

python3-matplotlib: update to 3.8.0, also update deps
- python3-matplotlib: update to 3.8.0. (@ahesford)
- python3-kiwisolver: update to 1.4.5, adopt.
- python3-contourpy: update to 1.1.1. (@misuchiru03) 

#### Testing the changes
- I tested the changes in this PR: **briefly**

The update to matplotlib affects sagemath in a mild way (see https://github.com/sagemath/sage/pull/36279 which contains a fix).

I have not yet tested the updates to contourpy and kiwisolver with sagemath, will do.

I'm not sure it's necessary to patch sagemath now as the issue is very minor.

Btw, I'm thinking of packaging https://matplotlib.org/ipympl/ since it seems it will be a standard dependency of sagemath soon (https://github.com/sagemath/sage/pull/36129#issuecomment-1696062778)

Edit: in #46003 I added a patch to sagemath, to support matplotlib 3.8.0, so we don't need to rebuild sagemath twice.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
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/46109.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-matplotlib-46109.patch --]
[-- Type: text/x-diff, Size: 11055 bytes --]

From 58658976f9e08a8f6e45dd2fa24c5efadc2abc4b Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 21 Sep 2023 11:00:56 -0400
Subject: [PATCH 1/6] common/build-helper/numpy.sh: write meson cross file when
 needed

---
 Manual.md                    |  5 +++++
 common/build-helper/numpy.sh | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/Manual.md b/Manual.md
index b6a4ffa0a71ce..21162641e4708 100644
--- a/Manual.md
+++ b/Manual.md
@@ -1083,6 +1083,11 @@ meson for cross builds. This is particularly useful for building packages that w
 invocations (e.g., `python3-pep517` packages that use a meson backend) and is added by default
 for packages that use the `meson` build style.
 
+- `numpy` configures the environment for cross-compilation of python packages that provide
+compiled extensions linking to NumPy C libraries. If the `meson` build helper is also
+configured, a secondary cross file, `${XBPS_WRAPPERDIR}/meson/xbps_numpy.cross`, will be
+written to inform meson where common NumPy components may be found.
+
 - `python3` configures the cross-build environment to use Python libraries, header files, and
 interpreter configurations in the target root. The `python3` helper is added by default for
 packages that use the `python3-module` or `python3-pep517` build styles.
diff --git a/common/build-helper/numpy.sh b/common/build-helper/numpy.sh
index 74c6421165293..bf40390ad1cae 100644
--- a/common/build-helper/numpy.sh
+++ b/common/build-helper/numpy.sh
@@ -34,4 +34,14 @@ if [ "$CROSS_BUILD" ]; then
 		ln -sf "${_gfortran}" "${XBPS_WRAPPERDIR}/gfortran"
 	fi
 	unset _gfortran
+
+	# Write a secondary meson cross file for numpy configuration
+	if [[ "${build_helper}" = *meson* ]]; then
+		mkdir -p "${XBPS_WRAPPERDIR}/meson"
+		cat > "${XBPS_WRAPPERDIR}/meson/xbps_numpy.cross" <<-EOF
+			[properties]
+			numpy-include-dir = '${XBPS_CROSS_BASE}/${py3_sitelib}/numpy/core/include'
+			pythran-include-dir = '${XBPS_CROSS_BASE}/${py3_sitelib}/pythran'
+			EOF
+	fi
 fi

From 6806c2de034a5c39c6a6e69405820f049546b320 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 21 Sep 2023 11:01:24 -0400
Subject: [PATCH 2/6] common/build-style/python3-pep517.sh: use meson cross
 files by default

---
 common/build-style/python3-pep517.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 2d5ff7caf34eb..5ec20dd117f8a 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -4,8 +4,18 @@
 
 do_build() {
 	: ${make_build_target:=.}
-	: ${make_build_args:=--no-isolation  --wheel}
-	python3 -m build ${make_build_args} ${make_build_target}
+
+	if [ "${CROSS_BUILD}" ] && [[ "${build_helper}" = *meson* ]]; then
+		local mcross="-Csetup-args=--cross-file=${XBPS_WRAPPERDIR}/meson"
+		make_build_args+=" ${mcross}/xbps_meson.cross"
+
+		if [[ "${build_helper}" = *numpy* ]]; then
+			make_build_args+=" ${mcross}/xbps_numpy.cross"
+		fi
+	fi
+
+	python3 -m build --no-isolation --wheel \
+		${make_build_args} ${make_build_target}
 }
 
 do_check() {

From 0a2141b19ad36337710d625472dab8ba4b72a532 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 20 Sep 2023 19:32:18 -0300
Subject: [PATCH 3/6] python3-pybind11: add standard symlinks

---
 .../13-pkg-config-clean-xbps-cross-base-ref.sh        |  3 ++-
 srcpkgs/python3-pybind11/template                     | 11 ++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh b/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh
index 5cdfb0e9bfd2b..88ad06c41983a 100644
--- a/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh
+++ b/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh
@@ -16,7 +16,8 @@ hook() {
 			# s,/usr/armv7l-linux-musleabihf/usr,/usr,g
 			# trailing /usr to avoid clashing with
 			# other $XBPS_CROSS_BASE and $XBPS_CROSS_TRIPLET.
-			sed -i -e "s,$XBPS_CROSS_BASE/usr,/usr,g" "$f"
+			sed -i --follow-symlinks \
+				-e "s,$XBPS_CROSS_BASE/usr,/usr,g" "$f"
 		fi
 	done
 }
diff --git a/srcpkgs/python3-pybind11/template b/srcpkgs/python3-pybind11/template
index 3b6ce5b98688f..de80678f261cb 100644
--- a/srcpkgs/python3-pybind11/template
+++ b/srcpkgs/python3-pybind11/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-pybind11'
 pkgname=python3-pybind11
 version=2.11.1
-revision=1
+revision=2
 build_style=python3-module
 hostmakedepends="cmake python3-setuptools
  python3-pytest python3-sphinx_rtd_theme python3-breathe"
@@ -44,6 +44,15 @@ do_check() {
 post_install() {
 	vlicense LICENSE
 
+	# symlink headers, cmake and pkgconfig into /usr
+	vmkdir usr/include
+	vmkdir usr/lib/cmake
+	vmkdir usr/lib/pkgconfig
+	_pybind11=${DESTDIR}/${py3_sitelib}/pybind11
+	ln -rs $_pybind11/include/pybind11 ${DESTDIR}/usr/include/
+	ln -rs $_pybind11/share/cmake/pybind11 ${DESTDIR}/usr/lib/cmake/
+	ln -rs $_pybind11/share/pkgconfig/pybind11.pc ${DESTDIR}/usr/lib/pkgconfig/
+
 	# Copy the man page, but make it section 7
 	_manpage=docs/.build/man/pybind11.1
 	vsed -i ${_manpage} -e '/^\.TH/ s/"1"/"7"/'

From 5d549a61c093b8c6c86c0cd8325b915d23318d8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:47:30 -0300
Subject: [PATCH 4/6] python3-contourpy: update to 1.1.1.

---
 srcpkgs/python3-contourpy/template | 15 ++++++++++-----
 srcpkgs/python3-contourpy/update   |  1 +
 2 files changed, 11 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/python3-contourpy/update

diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index 70e3833c8b55a..69f741a9b0eff 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -1,9 +1,10 @@
 # Template file for 'python3-contourpy'
 pkgname=python3-contourpy
-version=1.0.5
-revision=2
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-pybind11"
+version=1.1.1
+revision=1
+build_style=python3-pep517
+build_helper=meson
+hostmakedepends="python3-meson-python python3-pybind11 pkg-config"
 makedepends="python3-pybind11"
 depends="python3"
 checkdepends="${depends} python3-pytest-xdist python3-numpy"
@@ -11,8 +12,12 @@ short_desc="Python library for calculating contours of 2D quadrilateral grids"
 maintainer="Alex Childs <misuchiru03+github@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/contourpy/contourpy"
+changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/changelog.rst"
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
-checksum=896631cd40222aef3697e4e51177d14c3709fda49d30983269d584f034acc8a4
+checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
+
+# This test needs `wurlitzer`, not packaged
+make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 
 # Pulling python3-matplotlib creates a build-time dependency
 if [ "$XBPS_CHECK_PKGS" = full ]; then
diff --git a/srcpkgs/python3-contourpy/update b/srcpkgs/python3-contourpy/update
new file mode 100644
index 0000000000000..e299d00ea67cd
--- /dev/null
+++ b/srcpkgs/python3-contourpy/update
@@ -0,0 +1 @@
+ignore="*rc*"

From e121794f8068098f8daaafc34245eed838f0f664 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:56:57 -0300
Subject: [PATCH 5/6] python3-kiwisolver: update to 1.4.5, adopt.

---
 srcpkgs/python3-kiwisolver/template | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 3e4e2d55823da..ecea82d14e06c 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -1,25 +1,19 @@
 # Template file for 'python3-kiwisolver'
 pkgname=python3-kiwisolver
-version=1.3.1
-revision=4
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-cppy"
+version=1.4.5
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools_scm python3-wheel python3-cppy"
 makedepends="python3-devel python3-cppy"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Fast implementation of the Cassowary constraint solver (Python3)"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://github.com/nucleic/kiwi"
+changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
-checksum=950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248
-
-post_patch() {
-	# When cross building, make sure target cppy headers are used
-	if [ -n "${XBPS_CROSS_BASE}" ]; then
-		vsed -i setup.py \
-			-e "s@cppy.get_include()@&.replace('/usr/', '${XBPS_CROSS_BASE}/usr/')@"
-	fi
-}
+checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
 post_install() {
 	vlicense LICENSE

From 9cfeb87d4a740d7f4d1ad7033d404847ac8ffe1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 13:15:51 -0300
Subject: [PATCH 6/6] python3-matplotlib: update to 3.8.0.

---
 srcpkgs/python3-matplotlib/template | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-matplotlib/template b/srcpkgs/python3-matplotlib/template
index e8c3b07f9b9ca..90e899c2b2f52 100644
--- a/srcpkgs/python3-matplotlib/template
+++ b/srcpkgs/python3-matplotlib/template
@@ -1,11 +1,11 @@
 # Template file for 'python3-matplotlib'
 pkgname=python3-matplotlib
-version=3.7.2
+version=3.8.0
 revision=1
-build_style=python3-module
+build_style=python3-pep517
 build_helper="numpy"
 hostmakedepends="pkg-config python3-setuptools_scm python3-certifi
- python3-numpy python3-pybind11"
+ python3-numpy python3-pybind11 python3-wheel"
 makedepends="python3-devel freetype-devel libpng-devel libqhull-devel python3-pybind11"
 depends="python3-cycler fonttools python3-kiwisolver python3-numpy
  python3-packaging python3-Pillow python3-parsing python3-dateutil
@@ -14,8 +14,9 @@ short_desc="Python3 2D/3D plotting library"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="custom:matplotlib, BSD-3-Clause, MIT"
 homepage="https://matplotlib.org/"
+changelog="https://github.com/matplotlib/matplotlib/releases"
 distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz"
-checksum=a8cdb91dddb04436bd2f098b8fdf4b81352e68cf4d2c6756fcc414791076569b
+checksum=df8505e1c19d5c2c26aff3497a7cbd3ccfc2e97043d1e4db3e76afa399164b69
 replaces="python3-matplotlib-data>=0"
 # Comparison of images is too frail for validation
 make_check="no"
@@ -26,6 +27,7 @@ pre_build() {
 	system_freetype = true
 	system_qhull = true
 	EOF
+	vsed -e "s|'-flto'|'-flto=auto'|" -i setup.py
 }
 
 post_install() {

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (14 preceding siblings ...)
  2023-09-23 11:59 ` [PR PATCH] [Updated] " tornaria
@ 2023-09-23 12:01 ` tornaria
  2023-09-23 17:00 ` ahesford
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-23 12:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732293526

Comment:
Rebased on top of (the first two commits of) #46186, to avoid a merge conflict.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (15 preceding siblings ...)
  2023-09-23 12:01 ` tornaria
@ 2023-09-23 17:00 ` ahesford
  2023-09-23 17:26 ` tornaria
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2023-09-23 17:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732364823

Comment:
Rebasing should allow you to drop everything outside of the original scope of this PR. Thanks for your participation in improving the build helpers to make mesonpy builds less painful.

Whereas your pybind11 change put cmake and pkg-config files in `/usr/lib`, I kept them in `/usr/share` simply because they are in `share/` in the python package hierarchy. Hopefully this doesn't cause any problems with contourpy. (Most packages favor `/usr/lib` over `/usr/share` for these files, but there are some that stick to `/usr/share`.) We can move them if it causes a problem.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (16 preceding siblings ...)
  2023-09-23 17:00 ` ahesford
@ 2023-09-23 17:26 ` tornaria
  2023-09-23 17:29 ` [PR PATCH] [Updated] " tornaria
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-23 17:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732370229

Comment:
> Rebasing should allow you to drop everything outside of the original scope of this PR. Thanks for your participation in improving the build helpers to make mesonpy builds less painful.
> 
> Whereas your pybind11 change put cmake and pkg-config files in `/usr/lib`, I kept them in `/usr/share` simply because they are in `share/` in the python package hierarchy. Hopefully this doesn't cause any problems with contourpy. (Most packages favor `/usr/lib` over `/usr/share` for these files, but there are some that stick to `/usr/share`.) We can move them if it causes a problem.

I think you missed the `--follow-symlinks` in `common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh`. Aren't you getting a non-symlink file at `/usr/share/pkgconfig/pybind11.pc`?

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

* Re: [PR PATCH] [Updated] python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (17 preceding siblings ...)
  2023-09-23 17:26 ` tornaria
@ 2023-09-23 17:29 ` tornaria
  2023-09-23 17:30 ` tornaria
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-23 17:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages matplotlib
https://github.com/void-linux/void-packages/pull/46109

python3-matplotlib: update to 3.8.0, also update deps
- python3-matplotlib: update to 3.8.0. (@ahesford)
- python3-kiwisolver: update to 1.4.5, adopt.
- python3-contourpy: update to 1.1.1. (@misuchiru03) 

#### Testing the changes
- I tested the changes in this PR: **briefly**

The update to matplotlib affects sagemath in a mild way (see https://github.com/sagemath/sage/pull/36279 which contains a fix).

I have not yet tested the updates to contourpy and kiwisolver with sagemath, will do.

I'm not sure it's necessary to patch sagemath now as the issue is very minor.

Btw, I'm thinking of packaging https://matplotlib.org/ipympl/ since it seems it will be a standard dependency of sagemath soon (https://github.com/sagemath/sage/pull/36129#issuecomment-1696062778)

Edit: in #46003 I added a patch to sagemath, to support matplotlib 3.8.0, so we don't need to rebuild sagemath twice.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
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/46109.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-matplotlib-46109.patch --]
[-- Type: text/x-diff, Size: 5744 bytes --]

From 68862ea96c268755d8c30105f52ddec95f37b6b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:47:30 -0300
Subject: [PATCH 1/3] python3-contourpy: update to 1.1.1.

---
 srcpkgs/python3-contourpy/template | 15 ++++++++++-----
 srcpkgs/python3-contourpy/update   |  1 +
 2 files changed, 11 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/python3-contourpy/update

diff --git a/srcpkgs/python3-contourpy/template b/srcpkgs/python3-contourpy/template
index 70e3833c8b55a..69f741a9b0eff 100644
--- a/srcpkgs/python3-contourpy/template
+++ b/srcpkgs/python3-contourpy/template
@@ -1,9 +1,10 @@
 # Template file for 'python3-contourpy'
 pkgname=python3-contourpy
-version=1.0.5
-revision=2
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-pybind11"
+version=1.1.1
+revision=1
+build_style=python3-pep517
+build_helper=meson
+hostmakedepends="python3-meson-python python3-pybind11 pkg-config"
 makedepends="python3-pybind11"
 depends="python3"
 checkdepends="${depends} python3-pytest-xdist python3-numpy"
@@ -11,8 +12,12 @@ short_desc="Python library for calculating contours of 2D quadrilateral grids"
 maintainer="Alex Childs <misuchiru03+github@gmail.com>"
 license="BSD-3-Clause"
 homepage="https://github.com/contourpy/contourpy"
+changelog="https://raw.githubusercontent.com/contourpy/contourpy/main/docs/changelog.rst"
 distfiles="${PYPI_SITE}/c/contourpy/contourpy-${version}.tar.gz"
-checksum=896631cd40222aef3697e4e51177d14c3709fda49d30983269d584f034acc8a4
+checksum=96ba37c2e24b7212a77da85004c38e7c4d155d3e72a45eeaf22c1f03f607e8ab
+
+# This test needs `wurlitzer`, not packaged
+make_check_args="--deselect=tests/test_internal.py::test_write_cache"
 
 # Pulling python3-matplotlib creates a build-time dependency
 if [ "$XBPS_CHECK_PKGS" = full ]; then
diff --git a/srcpkgs/python3-contourpy/update b/srcpkgs/python3-contourpy/update
new file mode 100644
index 0000000000000..e299d00ea67cd
--- /dev/null
+++ b/srcpkgs/python3-contourpy/update
@@ -0,0 +1 @@
+ignore="*rc*"

From 3efb3a9256bb3bb263e744e46c8016b6eab17f85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 7 May 2023 21:56:57 -0300
Subject: [PATCH 2/3] python3-kiwisolver: update to 1.4.5, adopt.

---
 srcpkgs/python3-kiwisolver/template | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/srcpkgs/python3-kiwisolver/template b/srcpkgs/python3-kiwisolver/template
index 3e4e2d55823da..ecea82d14e06c 100644
--- a/srcpkgs/python3-kiwisolver/template
+++ b/srcpkgs/python3-kiwisolver/template
@@ -1,25 +1,19 @@
 # Template file for 'python3-kiwisolver'
 pkgname=python3-kiwisolver
-version=1.3.1
-revision=4
-build_style=python3-module
-hostmakedepends="python3-setuptools python3-cppy"
+version=1.4.5
+revision=1
+build_style=python3-pep517
+hostmakedepends="python3-setuptools_scm python3-wheel python3-cppy"
 makedepends="python3-devel python3-cppy"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Fast implementation of the Cassowary constraint solver (Python3)"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://github.com/nucleic/kiwi"
+changelog="https://github.com/nucleic/kiwi/raw/main/releasenotes.rst"
 distfiles="${PYPI_SITE}/k/kiwisolver/kiwisolver-${version}.tar.gz"
-checksum=950a199911a8d94683a6b10321f9345d5a3a8433ec58b217ace979e18f16e248
-
-post_patch() {
-	# When cross building, make sure target cppy headers are used
-	if [ -n "${XBPS_CROSS_BASE}" ]; then
-		vsed -i setup.py \
-			-e "s@cppy.get_include()@&.replace('/usr/', '${XBPS_CROSS_BASE}/usr/')@"
-	fi
-}
+checksum=e57e563a57fb22a142da34f38acc2fc1a5c864bc29ca1517a88abc963e60d6ec
 
 post_install() {
 	vlicense LICENSE

From 737de41c03a6c393848c06c3efedd8822a99296e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 13:15:51 -0300
Subject: [PATCH 3/3] python3-matplotlib: update to 3.8.0.

---
 srcpkgs/python3-matplotlib/template | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-matplotlib/template b/srcpkgs/python3-matplotlib/template
index e8c3b07f9b9ca..90e899c2b2f52 100644
--- a/srcpkgs/python3-matplotlib/template
+++ b/srcpkgs/python3-matplotlib/template
@@ -1,11 +1,11 @@
 # Template file for 'python3-matplotlib'
 pkgname=python3-matplotlib
-version=3.7.2
+version=3.8.0
 revision=1
-build_style=python3-module
+build_style=python3-pep517
 build_helper="numpy"
 hostmakedepends="pkg-config python3-setuptools_scm python3-certifi
- python3-numpy python3-pybind11"
+ python3-numpy python3-pybind11 python3-wheel"
 makedepends="python3-devel freetype-devel libpng-devel libqhull-devel python3-pybind11"
 depends="python3-cycler fonttools python3-kiwisolver python3-numpy
  python3-packaging python3-Pillow python3-parsing python3-dateutil
@@ -14,8 +14,9 @@ short_desc="Python3 2D/3D plotting library"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="custom:matplotlib, BSD-3-Clause, MIT"
 homepage="https://matplotlib.org/"
+changelog="https://github.com/matplotlib/matplotlib/releases"
 distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz"
-checksum=a8cdb91dddb04436bd2f098b8fdf4b81352e68cf4d2c6756fcc414791076569b
+checksum=df8505e1c19d5c2c26aff3497a7cbd3ccfc2e97043d1e4db3e76afa399164b69
 replaces="python3-matplotlib-data>=0"
 # Comparison of images is too frail for validation
 make_check="no"
@@ -26,6 +27,7 @@ pre_build() {
 	system_freetype = true
 	system_qhull = true
 	EOF
+	vsed -e "s|'-flto'|'-flto=auto'|" -i setup.py
 }
 
 post_install() {

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (18 preceding siblings ...)
  2023-09-23 17:29 ` [PR PATCH] [Updated] " tornaria
@ 2023-09-23 17:30 ` tornaria
  2023-09-23 17:32 ` tornaria
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-23 17:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732370930

Comment:
Rebased so it can be merged as is. For the record, sagemath has already been patched to support matplotlib 3.8.0.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (19 preceding siblings ...)
  2023-09-23 17:30 ` tornaria
@ 2023-09-23 17:32 ` tornaria
  2023-09-23 17:33 ` ahesford
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-23 17:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1771 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732371437

Comment:
> > Rebasing should allow you to drop everything outside of the original scope of this PR. Thanks for your participation in improving the build helpers to make mesonpy builds less painful.
> > Whereas your pybind11 change put cmake and pkg-config files in `/usr/lib`, I kept them in `/usr/share` simply because they are in `share/` in the python package hierarchy. Hopefully this doesn't cause any problems with contourpy. (Most packages favor `/usr/lib` over `/usr/share` for these files, but there are some that stick to `/usr/share`.) We can move them if it causes a problem.
> 
> I think you missed the `--follow-symlinks` in `common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh`. Aren't you getting a non-symlink file at `/usr/share/pkgconfig/pybind11.pc`?

In case it's useful, this is what I mean:
```diff
--- a/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh
+++ b/common/hooks/post-install/13-pkg-config-clean-xbps-cross-base-ref.sh
@@ -16,7 +16,8 @@ hook() {
                        # s,/usr/armv7l-linux-musleabihf/usr,/usr,g
                        # trailing /usr to avoid clashing with
                        # other $XBPS_CROSS_BASE and $XBPS_CROSS_TRIPLET.
-                       sed -i -e "s,$XBPS_CROSS_BASE/usr,/usr,g" "$f"
+                       sed -i --follow-symlinks \
+                               -e "s,$XBPS_CROSS_BASE/usr,/usr,g" "$f"
                fi
        done
 }
```

I don't think the `/usr/share` vs `/usr/lib` causes any issue. I went with `/usr/lib` since it seemed more common, but it's reasonable to follow upstream choice.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (20 preceding siblings ...)
  2023-09-23 17:32 ` tornaria
@ 2023-09-23 17:33 ` ahesford
  2023-09-23 17:37 ` tornaria
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2023-09-23 17:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732371537

Comment:
No, the symlink doesn't seem to be replaced:

```
% XBPS_TARGET_ARCH=x86_64-musl xbps-query -R --repo=https://repo-default.voidlinux.org/current/musl -M -f python3-pybind11
[...]
/usr/share/pkgconfig/pybind11.pc -> /usr/lib/python3.11/site-packages/pybind11/share/pkgconfig/pybind11.pc
```

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (21 preceding siblings ...)
  2023-09-23 17:33 ` ahesford
@ 2023-09-23 17:37 ` tornaria
  2023-09-23 17:47 ` ahesford
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-23 17:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732372464

Comment:
> No, the symlink doesn't seem to be replaced:
> 
> ```
> % XBPS_TARGET_ARCH=x86_64-musl xbps-query -R --repo=https://repo-default.voidlinux.org/current/musl -M -f python3-pybind11
> [...]
> /usr/share/pkgconfig/pybind11.pc -> /usr/lib/python3.11/site-packages/pybind11/share/pkgconfig/pybind11.pc
> ```

I think it only affects cross builds, as the hook responsible of this runs only on cross.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (22 preceding siblings ...)
  2023-09-23 17:37 ` tornaria
@ 2023-09-23 17:47 ` ahesford
  2023-09-23 17:54 ` tornaria
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2023-09-23 17:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732374360

Comment:
You're right... I saw that change but didn't see it having any effect on native builds, but forgot to look at the output of any cross builds.

In practice, this probably won't have any effect on pybind11 except to make an exact copy of the pkg-config file. I wonder if there are other concerns about `--folow-symlinks`. I'll open a new PR for comment from others.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (23 preceding siblings ...)
  2023-09-23 17:47 ` ahesford
@ 2023-09-23 17:54 ` tornaria
  2023-09-23 17:54 ` ahesford
  2023-09-23 17:55 ` [PR PATCH] [Merged]: " ahesford
  26 siblings, 0 replies; 28+ messages in thread
From: tornaria @ 2023-09-23 17:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732375723

Comment:
> In practice, this probably won't have any effect on pybind11 except to make an exact copy of the pkg-config file. I wonder if there are other concerns about `--folow-symlinks`. I'll open a new PR for comment from others.

True in this case since the `sed` line doesn't do anything; the "danger" would be in case a replacement is really necessary, that it changes only one version of the file.

In any case doesn't seem very important so I dropped it here.

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

* Re: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (24 preceding siblings ...)
  2023-09-23 17:54 ` tornaria
@ 2023-09-23 17:54 ` ahesford
  2023-09-23 17:55 ` [PR PATCH] [Merged]: " ahesford
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2023-09-23 17:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/46109#issuecomment-1732375833

Comment:
Taken up in https://github.com/void-linux/void-packages/pull/46201.

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

* Re: [PR PATCH] [Merged]: python3-matplotlib: update to 3.8.0, also update deps
  2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
                   ` (25 preceding siblings ...)
  2023-09-23 17:54 ` ahesford
@ 2023-09-23 17:55 ` ahesford
  26 siblings, 0 replies; 28+ messages in thread
From: ahesford @ 2023-09-23 17:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]

There's a merged pull request on the void-packages repository

python3-matplotlib: update to 3.8.0, also update deps
https://github.com/void-linux/void-packages/pull/46109

Description:
- python3-matplotlib: update to 3.8.0. (@ahesford)
- python3-kiwisolver: update to 1.4.5, adopt.
- python3-contourpy: update to 1.1.1. (@misuchiru03) 

#### Testing the changes
- I tested the changes in this PR: **briefly**

The update to matplotlib affects sagemath in a mild way (see https://github.com/sagemath/sage/pull/36279 which contains a fix).

I have not yet tested the updates to contourpy and kiwisolver with sagemath, will do.

I'm not sure it's necessary to patch sagemath now as the issue is very minor.

Btw, I'm thinking of packaging https://matplotlib.org/ipympl/ since it seems it will be a standard dependency of sagemath soon (https://github.com/sagemath/sage/pull/36129#issuecomment-1696062778)

Edit: in #46003 I added a patch to sagemath, to support matplotlib 3.8.0, so we don't need to rebuild sagemath twice.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
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] 28+ messages in thread

end of thread, other threads:[~2023-09-23 17:55 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-17 23:39 [PR PATCH] python3-matplotlib: update to 3.8.0, also update deps tornaria
2023-09-17 23:41 ` tornaria
2023-09-17 23:43 ` tornaria
2023-09-18  0:09 ` tornaria
2023-09-20  3:03 ` [PR PATCH] [Updated] " tornaria
2023-09-20  3:09 ` tornaria
2023-09-20  3:11 ` tornaria
2023-09-20  3:34 ` [PR PATCH] [Updated] " tornaria
2023-09-20  4:22 ` tornaria
2023-09-20  4:40 ` [PR PATCH] [Updated] " tornaria
2023-09-20  4:42 ` tornaria
2023-09-20 15:07 ` ahesford
2023-09-20 15:14 ` ahesford
2023-09-20 23:47 ` [PR PATCH] [Updated] " tornaria
2023-09-20 23:49 ` tornaria
2023-09-23 11:59 ` [PR PATCH] [Updated] " tornaria
2023-09-23 12:01 ` tornaria
2023-09-23 17:00 ` ahesford
2023-09-23 17:26 ` tornaria
2023-09-23 17:29 ` [PR PATCH] [Updated] " tornaria
2023-09-23 17:30 ` tornaria
2023-09-23 17:32 ` tornaria
2023-09-23 17:33 ` ahesford
2023-09-23 17:37 ` tornaria
2023-09-23 17:47 ` ahesford
2023-09-23 17:54 ` tornaria
2023-09-23 17:54 ` ahesford
2023-09-23 17:55 ` [PR PATCH] [Merged]: " ahesford

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).