From 4eebfa638afef1e407b9de294f247bbafd13329c Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Sun, 10 Dec 2023 01:00:14 +0100 Subject: [PATCH] libdrm --- zilti/packages/hyprland.scm | 150 +++++++++++++++++++++++++++++++++--- 1 file changed, 141 insertions(+), 9 deletions(-) diff --git a/zilti/packages/hyprland.scm b/zilti/packages/hyprland.scm index 4711c60..617d74d 100644 --- a/zilti/packages/hyprland.scm +++ b/zilti/packages/hyprland.scm @@ -111,6 +111,62 @@ rasterisation.") (home-page "http://www.pixman.org/") (license license:expat))) +(define-public libdrm-2.4.118 + (package + (name "libdrm") + (version "2.4.118") + (source (origin + (method url-fetch) + (uri (string-append + "https://dri.freedesktop.org/libdrm/libdrm-" + version ".tar.xz")) + (sha256 + (base32 + "0br4c4ikcbm1s4sg09ld406izq5s1yk7b2n0mmvql77bwdlqv252")))) + (build-system meson-build-system) + (arguments + (list #:configure-flags + (match (%current-system) + ((or "armhf-linux" "aarch64-linux") + #~(list "-Dexynos=enabled" + "-Domap=enabled" + "-Detnaviv=enabled" + "-Dtegra=enabled" + "-Dfreedreno-kgsl=true")) + (_ ''())) + #:phases + #~(modify-phases %standard-phases + ;; A typo in a previous upstream commit disabled building + ;; libdrm_intel by default on supported platforms. This was + ;; fixed by the following change in upstream commit + ;; 8a933c778a0eb36526bf3fc8a289e25add9ff8b0. + ;; TODO: Remove on next update of libdrm. + (add-after 'unpack 'build-intel-by-default + (lambda _ + (substitute* "meson.build" + (("system\\(\\)\\.startswith") + "cpu_family().startswith")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "meson" "test" "--timeout-multiplier" "5"))))))) + (propagated-inputs + (list libpciaccess)) + (native-inputs + (list pkg-config)) + (home-page "https://dri.freedesktop.org/wiki/") + (synopsis "Direct rendering userspace library") + (description "The Direct Rendering Infrastructure, also known as the DRI, +is a framework for allowing direct access to graphics hardware under the +X Window System in a safe and efficient manner. It includes changes to the +X server, to several client libraries, and to the kernel (DRM, Direct +Rendering Manager). The most important use for the DRI is to create fast +OpenGL implementations providing hardware acceleration for Mesa. +Several 3D accelerated drivers have been written to the DRI specification, +including drivers for chipsets produced by 3DFX, AMD (formerly ATI), Intel +and Matrox.") + (license license:x11))) + (define-public wlroots-0.17 (package (name "wlroots") @@ -127,14 +183,10 @@ rasterisation.") (build-system meson-build-system) (arguments `(#:configure-flags - '("-Dlibinput-backend=enabled" - "-Dauto_features=enabled") + '("-Dauto_features=enabled") #:phases (modify-phases %standard-phases - (add-before 'configure 'pre-configure - (lambda* (#:key outputs #:allow-other-keys) - (system "pkg-config --list-all"))) (add-before 'configure 'hardcode-paths (lambda* (#:key inputs #:allow-other-keys) (substitute* "xwayland/server.c" @@ -152,6 +204,7 @@ rasterisation.") (list ;; As required by wlroots.pc. eudev ffmpeg-4 + glslang libxkbcommon mesa pixman @@ -166,6 +219,7 @@ rasterisation.") wayland wayland-protocols xcb-util-errors + xcb-util-renderutil xcb-util-wm xorg-server-xwayland)) (inputs @@ -176,7 +230,7 @@ rasterisation.") cmake hwdata mesa-headers - vulkan-header + vulkan-headers pkg-config wayland (if (%current-target-system) @@ -187,7 +241,84 @@ rasterisation.") Wayland compositor") (description "wlroots is a set of pluggable, composable, unopinionated modules for building a Wayland compositor.") - (license license:expat))) ; MIT license + (license license:expat))) + +(define-public wlroots-master + (package + (name "wlroots") + (version "fe6f380f2653751e95be6f99922d10bea1327145") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.freedesktop.org/wlroots/wlroots") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "09g8vb9yq8b2nlvrgak197f98qcls5cdbvbva9mgr6spczgkjaxi")))) + (build-system meson-build-system) + (arguments + `(#:configure-flags + '("-Dauto_features=enabled") + #:phases + (modify-phases + %standard-phases + (add-before 'configure 'hardcode-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "xwayland/server.c" + (("Xwayland") (string-append (assoc-ref inputs + "xorg-server-xwayland") + "/bin/Xwayland"))) + #t)) + (add-before 'configure 'fix-meson-file + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (substitute* "backend/drm/meson.build" + (("/usr/share/hwdata/pnp.ids") + (string-append (assoc-ref (or native-inputs inputs) "hwdata") + "/share/hwdata/pnp.ids")))))))) + (propagated-inputs + (list ;; As required by wlroots.pc. + eudev + ffmpeg-4 + glslang + libxkbcommon + mesa + pixman + libcap + libdisplay-info + libinput + libpng + libseat + libxkbcommon + mesa + vulkan-loader + wayland + wayland-protocols + xcb-util-errors + xcb-util-renderutil + xcb-util-wm + xorg-server-xwayland)) + (inputs + (list libdrm)) + (native-inputs + (cons* + `(,hwdata "pnp") + cmake + hwdata + mesa-headers + vulkan-headers + pkg-config + wayland + (if (%current-target-system) + (list pkg-config-for-build) + '()))) + (home-page "https://gitlab.freedesktop.org/wlroots/wlroots/") + (synopsis "Pluggable, composable, unopinionated modules for building a +Wayland compositor") + (description "wlroots is a set of pluggable, composable, unopinionated +modules for building a Wayland compositor.") + (license license:expat))) ; MIT license (define-public hyprland-protocols (package @@ -271,7 +402,8 @@ Wayland compositor based on wlroots") (description "Hyprland.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1b4d6r68cqx09blf5xdr1c23hw7axr8sx21wsxjjygqrhkkabdx7")) + (base32 + "1b4d6r68cqx09blf5xdr1c23hw7axr8sx21wsxjjygqrhkkabdx7")) (modules '((guix build utils))) (snippet #~(begin @@ -315,7 +447,7 @@ Wayland compositor based on wlroots") (description "Hyprland.") pango pciutils udis86 - wlroots-0.17 + wlroots-master xcb-util)) (home-page "https://www.hyprland.org") (synopsis "Dynamic tiling