Subject: Re: [bug#57398] [PATCH]: Add PySide 6.

From: Marius Bakke <[email-masked]>
Date: Wed, 07 Sep 2022 19:51:06 +0200

Hi Zhu,

Thanks for these patches, nice work!

I've applied them with a few minor tweaks, see inline.

Zhu Zihao <[email-masked]> skriver:

>>>From a4d31ffc721fa3b459e2f168cb4af65147b82248 Mon Sep 17 00:00:00 2001
> From: Zhu Zihao <[email-masked]>
> Date: Wed, 24 Aug 2022 19:25:26 +0800
> Subject: [PATCH 3/9] gnu: python-pyside-2: Use G-expressions.
>
> * gnu/packages/qt.scm (python-pyside-2)[native-inputs]: Use label-less input
> style.
> [arguments]: Use G-expressions.

[...]

>      (native-inputs
> -     `(("cmake" ,cmake-minimal)
> -       ("python" ,python-wrapper)
> -       ("qttools-5" ,qttools-5)
> -       ("which" ,which)))
> +     (list cmake-minimal python-wrapper qttools-5 which))

[...]

> +              ;; Add include directories for qt modules.
> +              (let ((dirs (map (lambda (name)
> +                                 (string-append (assoc-ref inputs name)
> +                                                "/include/qt5"))
> +                               '("qtdatavis3d"
> +                                 "qtdeclarative"
> +                                 "qtlocation"
> +                                 "qtmultimedia"
> +                                 "qtquickcontrols"
> +                                 "qtquickcontrols2"
> +                                 "qtscript"
> +                                 "qtscxml"
> +                                 "qtsensors"
> +                                 "qtspeech"
> +                                 "qtsvg"
> +                                 "qttools-5"

Here qttools-5 would no longer be found, so I changed it.

>>>From 801e4315b1ef24fc18cf61169b42443eb221e924 Mon Sep 17 00:00:00 2001
> From: Zhu Zihao <[email-masked]>
> Date: Wed, 24 Aug 2022 22:57:44 +0800
> Subject: [PATCH 5/9] gnu: python-pyside-2: Use "this-package-input" instead of
>  "assoc-ref".
>
> * gnu/packages/qt.scm (python-pyside-2)[arguments]<#:configure-flags>: Use
> "this-package-input"
> <#:phases>: In phase "fix-qt-module-detection", use "this-package-input".

I had to manually apply this patch because I changed the previous one.
While at it, I made one tweak:

> @@ -3880,7 +3880,7 @@ (define-public python-pyside-2
>        #:configure-flags
>        #~(list "-DBUILD_TESTS=FALSE"
>                (string-append "-DPYTHON_EXECUTABLE="
> -                             (assoc-ref %build-inputs "python")
> +                             #$(this-package-native-input "python-wrapper")
>                               "/bin/python"))

I changed this to use (search-input-file ...) instead of
#$(this-package-native-input ...).

And the same in subsequent patches.  The reason is that THIS-PACKAGE has
a runtime cost (meaning the "guix" commands get slower), but
SEARCH-INPUT-FILE is computed at build time.

In short, always use SEARCH-INPUT-FILE when feasible.  :-)

Applied all 9 with these changes!