commit:     795c3499deec6a6fe92ec93257b9a063a0bf6405
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 13 21:58:43 2024 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Fri Dec 13 22:10:14 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=795c3499

dev-python/pyqtgraph: bdepend on sys-apps/gawk

It turns out that `nawk` does not like the awk expressions
used in this ebuild.

Since it's not as portable as I'd hoped, longer term we
may want to replace the substitutions with a python
script or rework the `awk` script to be more POSIX-y.

Tidied up some `liborder` logic that still supported
the (never implemented) pyside6 USE.

Also stop explicitly excluding pyside2 tests as we rewrite
the test logic to only run tests for USE-enabled frontends.

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild 
b/dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild
index a8489dd42e82..da88a6aa8310 100644
--- a/dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild
+++ b/dev-python/pyqtgraph/pyqtgraph-0.13.7-r2.ebuild
@@ -41,6 +41,7 @@ BDEPEND="
                dev-python/pytest-xvfb[${PYTHON_USEDEP}]
                dev-vcs/git
        )
+       sys-apps/gawk
 "
 
 EPYTEST_XDIST=1
@@ -83,7 +84,7 @@ python_prepare_all() {
                fi
        done
 
-       awk -v qt_string="$(printf "%s\n" "${gentoo_qt[@]}")" -i inplace '
+       gawk -v qt_string="$(printf "%s\n" "${gentoo_qt[@]}")" -i inplace '
        BEGIN {
                i = 0
                split(qt_string, qt_array, "\n")
@@ -109,15 +110,11 @@ python_prepare_all() {
        # The order is important (we want to prefer the newest at runtime)
        for qt in qt6 qt5; do
                if use ${qt}; then
-                       if [[ "${qt}" == qt* ]]; then
-                               liborder+=( "PY${qt^^}" )
-                       else
-                               liborder+=( "${qt^^}" )
-                       fi
+                       liborder+=( "PY${qt^^}" )
                fi
        done
 
-       awk -v libOrder="$(printf "%s, " "${liborder[@]}")" -i inplace '
+       gawk -v libOrder="$(printf "%s, " "${liborder[@]}")" -i inplace '
        BEGIN {
                libOrder = "[" substr(libOrder, 1, length(libOrder) - 2) "]"
        }
@@ -135,7 +132,7 @@ python_prepare_all() {
                                frontends+=( "Qt.PY${qt^^}: False," )
                        fi
                done
-               awk -v frontends="$(printf "%s\n" "${frontends[@]}")" -i 
inplace '
+               gawk -v frontends="$(printf "%s\n" "${frontends[@]}")" -i 
inplace '
                BEGIN {
                        i = 0
                        split(frontends, frontend_array, "\n")
@@ -167,13 +164,6 @@ python_test() {
                # TODO
                tests/exporters/test_svg.py::test_plotscene
                tests/graphicsItems/test_ROI.py::test_PolyLineROI
-
-               # pyside2 is normally skipped if not installed but these two
-               # fail if it is installed
-               # TODO: this could be due to USE flags, revisit when pyside2
-               # gains py3.9
-               'pyqtgraph/examples/test_examples.py::testExamples[ 
DateAxisItem_QtDesigner.py - PySide2 ]'
-               'pyqtgraph/examples/test_examples.py::testExamples[ 
designerExample.py - PySide2 ]'
        )
 
        local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1

Reply via email to