diff mbox series

[bug#59434] gnu: Add hyprland.

Message ID ac9bcef4-d8db-e9b6-80a3-79c7bbae65a5@disroot.org
State New
Headers show
Series [bug#59434] gnu: Add hyprland. | expand

Checks

Context Check Description
cbaines/applying patch fail
cbaines/issue success View issue
cbaines/applying patch fail
cbaines/issue success View issue
cbaines/applying patch fail
cbaines/issue success View issue
cbaines/applying patch fail
cbaines/issue success View issue

Commit Message

Adam Faiz Nov. 21, 2022, 5:53 a.m. UTC
From a8f78a0b951cce3ab4c03b3f1e61b1b95d93c723 Mon Sep 17 00:00:00 2001
From: AwesomeAdam54321 <adam.faiz@disroot.org>
Date: Mon, 21 Nov 2022 13:29:16 +0800
Subject: [PATCH] gnu: Add hyprland.

* gnu/packages/wm.scm (hyprland): New variable.
---
  gnu/packages/wm.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 44 insertions(+)

Comments

Ricardo Wurmus Dec. 27, 2022, 6:19 p.m. UTC | #1
Hi Adam,

thank you for the patch.  Unfortunately, this package does not build:

--8<---------------cut here---------------start------------->8---
/gnu/store/shhxkiy9qr695h8k64g9m6a03msaw2yk-gcc-12.2.0/bin/c++ -DGIT_BRANCH=\"\" -DGIT_COMMIT_HASH=\"\" -DGIT_COMMIT_MESSAGE=\"\" -DGIT_DIRTY=\"dirty\" -isystem /gnu/store/6gq2n65ixpn6drd5wai2h7g5wjm6bp2b-cairo-1.16.0/include/cairo -isystem /gnu/store/c1nvl9hcgl09nysmy1qqsz5ljiarxdjs-libdrm-2.4.107/include/libdrm -isystem /gnu/store/vk23fcm4livzrnb3kzhxs6yjds8f355c-pango-1.48.10/include/pango-1.0 -isystem /gnu/store/j8x167zaka2h6pxk7wiq5zkg67hzf8a2-pixman-0.40.0/include/pixman-1 -isystem /gnu/store/p7iq81hxxyk9zy7a9dngbf16zm8d4klx-libpng-1.6.37/include/libpng16 -isystem /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/include/glib-2.0 -isystem /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/glib-2.0/include -isystem /gnu/store/ak70pk2hjks17cx7zjdmdmzpcpiy9gpi-freetype-2.10.4/include/freetype2 -isystem /gnu/store/f6ibajh7x233cvr30c2p314l2absk36h-harfbuzz-2.8.2/include/harfbuzz -isystem /gnu/store/v5x6f3dml69pmn4pfkl51j6y03v6rlsg-fribidi-1.0.9/include/fribidi -isystem /gnu/store/5583c2za2jsn9g6az79rnksgvigwnsk7-util-linux-2.37.2-lib/include/libmount -isystem /gnu/store/5583c2za2jsn9g6az79rnksgvigwnsk7-util-linux-2.37.2-lib/include/blkid -isystem /gnu/store/v3hqc5i1jqi0s04zxvi465bihrgb1sq1-elogind-246.10/include/elogind -O2 -g -DNDEBUG -O3 -std=c++23 -DWLR_USE_UNSTABLE -Wall -Wextra -Wno-unused-parameter -Wno-unused-value -Wno-missing-field-initializers -Wno-narrowing -pthread -MD -MT CMakeFiles/Hyprland.dir/src/debug/HyprCtl.cpp.o -MF CMakeFiles/Hyprland.dir/src/debug/HyprCtl.cpp.o.d -o CMakeFiles/Hyprland.dir/src/debug/HyprCtl.cpp.o -c /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/debug/HyprCtl.cpp
In file included from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/defines.hpp:1,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/Window.hpp:3,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/Window.cpp:1:
/tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/includes.hpp:40:10: fatal error: wlr/render/allocator.h: No such file or directory
   40 | #include <wlr/render/allocator.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/Hyprland.dir/build.make:93: CMakeFiles/Hyprland.dir/src/Window.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/defines.hpp:1,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/Compositor.hpp:7,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/Compositor.cpp:1:
/tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/includes.hpp:40:10: fatal error: wlr/render/allocator.h: No such file or directory
   40 | #include <wlr/render/allocator.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/Hyprland.dir/build.make:79: CMakeFiles/Hyprland.dir/src/Compositor.cpp.o] Error 1
In file included from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/config/../defines.hpp:1,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/config/ConfigManager.hpp:8,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/config/ConfigManager.cpp:1:
/tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/config/../includes.hpp:40:10: fatal error: wlr/render/allocator.h: No such file or directory
   40 | #include <wlr/render/allocator.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/Hyprland.dir/build.make:107: CMakeFiles/Hyprland.dir/src/config/ConfigManager.cpp.o] Error 1
In file included from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/debug/../defines.hpp:1,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/debug/../Compositor.hpp:7,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/debug/HyprCtl.hpp:3,
                 from /tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/debug/HyprCtl.cpp:1:
/tmp/guix-build-hyprland-0.18.0beta.drv-0/source/src/debug/../includes.hpp:40:10: fatal error: wlr/render/allocator.h: No such file or directory
   40 | #include <wlr/render/allocator.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/Hyprland.dir/build.make:121: CMakeFiles/Hyprland.dir/src/debug/HyprCtl.cpp.o] Error 1
make[2]: Leaving directory '/tmp/guix-build-hyprland-0.18.0beta.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:86: CMakeFiles/Hyprland.dir/all] Error 2
make[1]: Leaving directory '/tmp/guix-build-hyprland-0.18.0beta.drv-0/build'
make: *** [Makefile:114: all] Error 2
--8<---------------cut here---------------end--------------->8---

wlroots does not provide this file.
Léonard Jan. 6, 2023, 4:01 p.m. UTC | #2
This is because wlroots has migrated to gitlab and the github repo has been archived. The guix wlroots package still uses the github repo as you can see on line 1546 of ./gnu/packages/wm.scm.

Since hyprland is made to be built with the latest wlroots version it fails to build with the old github version. Possible solutions would be to use the bundled wlroots or update the wlroots package in wm.scm to the new source.

I would send a patch if I could but I'm not familiar enough with guix and guile to do so.

- Léonard Gomez
diff mbox series

Patch

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index c87a616ed9..c2b567bd62 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -107,6 +107,7 @@  (define-module (gnu packages wm)
    #:use-module (gnu packages freedesktop)
    #:use-module (gnu packages fribidi)
    #:use-module (gnu packages gawk)
+  #:use-module (gnu packages gcc)
    #:use-module (gnu packages gl)
    #:use-module (gnu packages glib)
    #:use-module (gnu packages gperf)
@@ -2723,6 +2724,49 @@  (define-public hikari
  capabilities.  It is heavily inspired by the Calm Window manager(cwm).")
      (license license:bsd-2)))

+(define-public hyprland
+  (package
+    (name "hyprland")
+    (version "0.18.0beta")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/hyprwm/Hyprland")
+             (commit (string-append "v"version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1sbf12mqvgqpjfw4bni4p2gk2djnh49fwzki4dnsyq4ykcp7x6hb"))
+       (modules '((guix build utils)))
+       (snippet
+        #~(begin
+            ;; Unbundle dependencies and add it to the dependency list
+            (delete-file-recursively "subprojects")
+            (substitute* "CMakeLists.txt"
+              ((".*subprojects/wlroots/.*") "")
+              (("libinput)") "libinput wlroots)"))))))
+    (build-system cmake-build-system)
+    (native-inputs
+     (list pkg-config gcc-12))
+    (inputs
+     (list wayland
+           wayland-protocols
+           cairo
+           pango
+           libdrm
+           egl-wayland
+           libxkbcommon
+           libinput
+           wlroots))
+    (home-page "https://www.hyprland.org/")
+    (synopsis "Dynamic tiling Wayland compositor based on wlroots")
+    (description
+     "Hyprland is a dynamic tiling Wayland compositor based on wlroots
+that doesn't sacrifice on its looks. It supports multiple layouts,
+fancy effects, has a very flexible IPC model allowing for a lot of
+customization, and more. ")
+    (license license:bsd-3)))
+
  (define-public devour
    (package
      (name "devour")