[PATCH 0/2] Add hyprland-qtutils; use it Hyprland

  • Done
  • quality assurance status badge
Details
2 participants
  • Hilton Chain
  • John Kehayias
Owner
unassigned
Submitted by
John Kehayias
Severity
normal

Debbugs page

J
J
John Kehayias wrote 7 days ago
(address . guix-patches@gnu.org)
cover.1735967250.git.john.kehayias@protonmail.com
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
J
J
John Kehayias wrote 7 days ago
[PATCH 1/2] gnu: Add hyprland-qtutils.
(address . 75337@debbugs.gnu.org)
44509052eae6c1694b2094d23fd0984b956394c0.1735967250.git.john.kehayias@protonmail.com
* gnu/packages/qt.scm (hyprland-qtutils): New variable.

Change-Id: I11d1460e29e456c3f69ea3bf018ef9f19969e342
---
gnu/packages/qt.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)

Toggle diff (73 lines)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index e51962e0a7..44b61e2e7b 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -33,6 +33,7 @@
;;; Copyright © 2023 Simon South <simon@simonsouth.net>
;;; Copyright © 2024 Foundation Devices, Inc. <hello@foundation.xyz>
;;; Copyright © 2024 Josep Bigorra <jjbigorra@gmail.com>
+;;; Copyright © 2025 John Kehayias <john.kehayias@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -5396,6 +5397,60 @@ (define-public soqt
of the InventorXt GUI component toolkit.")
(license license:bsd-3)))

+(define-public hyprland-qtutils
+ (package
+ (name "hyprland-qtutils")
+ (version "0.1.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/hyprwm/hyprland-qtutils")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "02ymf8xypnxhknb3d0bxbp96hargwrg9syb9xs3va3rmx909r7b6"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f ;There are no tests.
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'wrap-programs
+ (lambda _
+ (for-each
+ (lambda (prog)
+ (wrap-program (string-append #$output "/bin/" prog)
+ `("QML_IMPORT_PATH" ":" prefix
+ #$(map (lambda (i)
+ (file-append (this-package-input i) "/lib/qt6/qml"))
+ '("kirigami"
+ "qqc2-desktop-style"
+ "qtdeclarative"
+ "qtwayland")))
+ `("QT_PLUGIN_PATH" ":" prefix
+ #$(map (lambda (i)
+ (file-append (this-package-input i) "/lib/qt6/plugins"))
+ '("qqc2-desktop-style" "qtwayland")))))
+ '("hyprland-dialog" "hyprland-update-screen")))))))
+ (native-inputs (list gcc-14 pkg-config))
+ (inputs
+ (list bash-minimal
+ hyprutils
+ kirigami
+ libxkbcommon
+ qqc2-desktop-style
+ qtbase
+ qtdeclarative
+ qtwayland
+ wayland))
+ (home-page "https://github.com/hyprwm/hyprland-qtutils")
+ (synopsis "Hyprland QT/QML utility apps")
+ (description
+ "This package provides some QT/QML utilities that might be used by
+various hypr* apps.")
+ (license license:bsd-3)))
+
+
(define-public libdbusmenu-qt
(package
(name "libdbusmenu-qt")
--
2.47.1
J
J
John Kehayias wrote 7 days ago
[PATCH 2/2] gnu: hyprland: Add hyprland-qtutils to propagated-inputs.
(address . 75337@debbugs.gnu.org)
1c131cce476629bbff9794bc69ac186316c52fa5.1735967250.git.john.kehayias@protonmail.com
Hyprland will warn and suggest on running that it expects to find binaries
from hyprland-qtutils.

* gnu/packages/wm.scm (hyprland)[propagated-inputs]: New field.

Change-Id: I54a2331181636b7aad9abdf7dfef9e1ac9c9fc3c
---
gnu/packages/wm.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index e7a6cb6afc..4d53861ceb 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -169,6 +169,7 @@ (define-module (gnu packages wm)
#:use-module (gnu packages python-build)
#:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages qt)
#:use-module (gnu packages readline)
#:use-module (gnu packages regex)
#:use-module (gnu packages serialization)
@@ -423,6 +424,7 @@ (define-public hyprland
xcb-util-errors
xcb-util-wm
xorg-server-xwayland))
+ (propagated-inputs (list hyprland-qtutils))
(home-page "https://hyprland.org/")
(synopsis "Dynamic tiling Wayland compositor")
(description
--
2.47.1
H
H
Hilton Chain wrote 6 days ago
Re: [PATCH 0/2] Add hyprland-qtutils; use it Hyprland
(name . John Kehayias)(address . john.kehayias@protonmail.com)
87o70mmxr9.wl-hako@ultrarare.space
On Sat, 04 Jan 2025 13:23:05 +0800,
John Kehayias wrote:
Toggle quote (16 lines)
>
> 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.

Toggle quote (7 lines)
> 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 :)
Toggle snippet (6 lines)
(substitute* ...
(("!executableExistsInPath.*\".") "false")
(("hyprland-update-screen" cmd)
(search-input-file inputs (in-vicinity "bin" cmd))))

Toggle quote (24 lines)
> 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
>
>
J
J
John Kehayias wrote 4 days ago
(name . Hilton Chain)(address . hako@ultrarare.space)
87o70jka3i.fsf@protonmail.com
Hi,

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

Toggle quote (11 lines)
> 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.

Toggle quote (16 lines)
>> 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
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75337@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75337
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch