[bug#75337,0/2] Add hyprland-qtutils; use it Hyprland

Message ID cover.1735967250.git.john.kehayias@protonmail.com
Headers
Series Add hyprland-qtutils; use it Hyprland |

Message

John Kehayias Jan. 4, 2025, 5:23 a.m. UTC
  Hi all,

As pointed out in <https://issues.guix.gnu.org/75036#2>, Hyprland now wants binaries from the hyprland-qtutils package, which this patch series adds. I checked that it builds and I can run the utlities. One is to send a message if Hyprland is updated, which isn't relevant for our package, but I didn't look into any easy way to disable that from the source if that's what we want to do.

One thing to point out is that I manually wrapped the binaries with needed QT environment variables to get them to work. Using qt-buid-system or calling qt-wrap-program (or qt-wrap-all-programs) did not do much: it just added the plugin path for qtbase-5 (not an input here). I didn't try to investigate further but maybe the qt-team could chime in.

On the Hyprland end, it just checks for these utlities somewhere on the PATH (or something like that) so I just used propagated-inputs. The package/build does not otherwise depend or try to find these at build time. Using propagated-inputs seems to me the easiest and most straight forward method here (the source does not just hardcode something like "/usr/bin/hyprland-dialog" to patch with a store path).

I have not actually tried running the latest Hyprland which will warn (but otherwise should work) about these.

Thanks all!
John

John Kehayias (2):
  gnu: Add hyprland-qtutils.
  gnu: hyprland: Add hyprland-qtutils to propagated-inputs.

 gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
 gnu/packages/wm.scm |  2 ++
 2 files changed, 57 insertions(+)


base-commit: a707ebe5d3875a49523bc17de2d36af6f1c18f7e
prerequisite-patch-id: 3efc585c869da704ca71214328a78b6e6bbad919
prerequisite-patch-id: 82bcb22fe1f5bd69d26626e575b7629f6f223ae3
prerequisite-patch-id: b12f224a58be29cf89415a53dc245e4057139e22
prerequisite-patch-id: 9fa5469aa4528c28962598256414bf4a4f517dce
--
2.47.1
  

Comments

Hilton Chain Jan. 4, 2025, 2:58 p.m. UTC | #1
On Sat, 04 Jan 2025 13:23:05 +0800,
John Kehayias wrote:
>
> Hi all,
>
> As pointed out in <https://issues.guix.gnu.org/75036#2>, Hyprland now wants
> binaries from the hyprland-qtutils package, which this patch series adds. I
> checked that it builds and I can run the utlities. One is to send a message if
> Hyprland is updated, which isn't relevant for our package, but I didn't look
> into any easy way to disable that from the source if that's what we want to
> do.
>
> One thing to point out is that I manually wrapped the binaries with needed QT
> environment variables to get them to work. Using qt-buid-system or calling
> qt-wrap-program (or qt-wrap-all-programs) did not do much: it just added the
> plugin path for qtbase-5 (not an input here). I didn't try to investigate
> further but maybe the qt-team could chime in.

qt-build-system has a #:qtbase argument, you can set it to qtbase.

> On the Hyprland end, it just checks for these utlities somewhere on the PATH
> (or something like that) so I just used propagated-inputs. The package/build
> does not otherwise depend or try to find these at build time. Using
> propagated-inputs seems to me the easiest and most straight forward method
> here (the source does not just hardcode something like
> "/usr/bin/hyprland-dialog" to patch with a store path).

Found a pattern to bypass the check :)
--8<---------------cut here---------------start------------->8---
(substitute* ...
  (("!executableExistsInPath.*\".") "false")
  (("hyprland-update-screen" cmd)
   (search-input-file inputs (in-vicinity "bin" cmd))))
--8<---------------cut here---------------end--------------->8---

> I have not actually tried running the latest Hyprland which will warn (but
> otherwise should work) about these.
>
> Thanks all!
> John
>
> John Kehayias (2):
>   gnu: Add hyprland-qtutils.
>   gnu: hyprland: Add hyprland-qtutils to propagated-inputs.
>
>  gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
>  gnu/packages/wm.scm |  2 ++
>  2 files changed, 57 insertions(+)
>
>
> base-commit: a707ebe5d3875a49523bc17de2d36af6f1c18f7e
> prerequisite-patch-id: 3efc585c869da704ca71214328a78b6e6bbad919
> prerequisite-patch-id: 82bcb22fe1f5bd69d26626e575b7629f6f223ae3
> prerequisite-patch-id: b12f224a58be29cf89415a53dc245e4057139e22
> prerequisite-patch-id: 9fa5469aa4528c28962598256414bf4a4f517dce
> --
> 2.47.1
>
>
  
John Kehayias Jan. 6, 2025, 7:37 p.m. UTC | #2
Hi,

On Sat, Jan 04, 2025 at 10:58 PM, Hilton Chain wrote:

> On Sat, 04 Jan 2025 13:23:05 +0800,
> John Kehayias wrote:
>> One thing to point out is that I manually wrapped the binaries with needed QT
>> environment variables to get them to work. Using qt-buid-system or calling
>> qt-wrap-program (or qt-wrap-all-programs) did not do much: it just added the
>> plugin path for qtbase-5 (not an input here). I didn't try to investigate
>> further but maybe the qt-team could chime in.
>
> qt-build-system has a #:qtbase argument, you can set it to qtbase.
>

Right, and I swear I tried that but I guess that's what happens when
you do a bunch of things at the same time late at night :) Or maybe it
was when I was just using the wrap-qt-program phase and didn't quite
do it correctly. Anyway, that does indeed work and is much cleaner
now.

>> On the Hyprland end, it just checks for these utlities somewhere on the PATH
>> (or something like that) so I just used propagated-inputs. The package/build
>> does not otherwise depend or try to find these at build time. Using
>> propagated-inputs seems to me the easiest and most straight forward method
>> here (the source does not just hardcode something like
>> "/usr/bin/hyprland-dialog" to patch with a store path).
>
> Found a pattern to bypass the check :)
> --8<---------------cut here---------------start------------->8---
> (substitute* ...
>   (("!executableExistsInPath.*\".") "false")
>   (("hyprland-update-screen" cmd)
>    (search-input-file inputs (in-vicinity "bin" cmd))))
> --8<---------------cut here---------------end--------------->8---
>

Ah nice, thanks! I used that and made hyprland-qtutils just a regular
input (after checking the substitutions were correct in both files and
searching Hyprland to make sure that there were no other instances). I
added you as co-author to that patch.

Pushed both, as 8f261686ec0e5a988935e76e5495898e036f9fa7 and
0b4b22b6d363d0dd0bdaee65e47bda5cac72475c

Thanks for the help!
John