guixchannel/packages/hyprland.scm

206 lines
6.1 KiB
Scheme
Raw Normal View History

2023-11-27 23:00:56 +00:00
(define-module
2023-11-27 23:04:45 +00:00
(packages hyprland)
2023-11-27 23:00:56 +00:00
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix build-system meson)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix git-download)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages build-tools)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gcc)
#:use-module (gnu packages gl)
#:use-module (gnu packages gtk)
#:use-module (gnu packages ninja)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages python)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages version-control)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages rust)
#:use-module (gnu packages web)
#:use-module (gnu packages wm)
#:use-module (gnu packages xorg))
(define-public hyprland-protocols
(package
(name "hyprland-protocols")
(version "0.2")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/hyprwm/hyprland-protocols")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "1drjznj7fn6m5m6skhzh0p031cb5x0bb4i56jxnxwpwaa71g1z20"))))
(build-system meson-build-system)
(home-page "https://www.hyprland.org") (synopsis "Dynamic tiling
Wayland compositor based on wlroots") (description "Hyprland.")
(license license:bsd-3)
))
(define-public udis86
(package
(name "udis86")
(version "unstable-2022-10-13")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/canihavesomecoffee/udis86")
(commit "5336633af70f3917760a6d441ff02d93477b0c86")))
(sha256
(base32 "0y5z1169wff578jylpafsww4px4y6gickhcs885a9c660d8xs9qy"))))
(build-system gnu-build-system)
(native-inputs
(list autoconf
automake
libtool
python-wrapper))
(inputs
(list python-wrapper))
(home-page "blah")
(synopsis "blub")
(description "Disassembler")
(license license:bsd-2)))
(define-public hyprland
(package
(name "hyprland")
(version "0.32.3")
(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 "17h8gy7wvsxg1ypq70b0cldz6h599xi7fibawlm2g6cvxkmzdwzh"))
(modules '((guix build utils)))
2023-11-27 23:03:50 +00:00
(patches (plain-file "diff --git a/meson.build b/meson.build
index 1d2c7f9f..c5ef4e67 100644
--- a/meson.build
+++ b/meson.build
@@ -33,20 +33,7 @@ if cpp_compiler.check_header('execinfo.h')
add_project_arguments('-DHAS_EXECINFO', language: 'cpp')
endif
-wlroots = subproject('wlroots', default_options: ['examples=false', 'renderers=gles2'])
-have_xwlr = wlroots.get_variable('features').get('xwayland')
-xcb_dep = dependency('xcb', required: get_option('xwayland'))
-
-cmake = import('cmake')
-udis = cmake.subproject('udis86')
-udis86 = udis.dependency('libudis86')
-
-if get_option('xwayland').enabled() and not have_xwlr
- error('Cannot enable Xwayland in Hyprland: wlroots has been built without Xwayland support')
-endif
-have_xwayland = xcb_dep.found() and have_xwlr
-
-if not have_xwayland
+if get_option('xwayland').disabled()
add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
endif
@@ -69,8 +56,6 @@ if get_option('buildtype') == 'debug'
add_project_arguments('-DHYPRLAND_DEBUG', language: 'cpp')
endif
-version_h = run_command('sh', '-c', 'scripts/generateVersion.sh')
-
globber = run_command('find', 'src', '-name', '*.h*', check: true)
headers = globber.stdout().strip().split('\n')
foreach file : headers
diff --git a/src/meson.build b/src/meson.build
index 0af864b9..38723b8c 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -9,16 +9,16 @@ executable('Hyprland', src,
server_protos,
dependency('wayland-server'),
dependency('wayland-client'),
- wlroots.get_variable('wlroots'),
+ dependency('wlroots'),
dependency('cairo'),
dependency('libdrm'),
dependency('egl'),
dependency('xkbcommon'),
dependency('libinput'),
- xcb_dep,
+ dependency('xcb', required: get_option('xwayland')),
backtrace_dep,
systemd_dep,
- udis86,
+ dependency('udis86'),
dependency('pixman-1'),
dependency('gl', 'opengl'),
"))
2023-11-27 23:00:56 +00:00
(snippet
#~(begin
;;(delete-file-recursively "subprojects/wlroots")
;;(delete-file-recursively "subprojects/udis86")
(substitute* "CMakeLists.txt"
((".*subprojects/udis86.*") "\n")
;; ((".*subprojects/wlroots.*") "\n")
;; (("include.ExternalProject.*") "\n")
;; ((""))
;; ((".*\"subprojects/wlroots.*\"") "")
;; (("find_program.WaylandScanner.*")
;; (string-append "set(WaylandScanner '"
;; #$wayland
;; "/bin/wayland-scanner')\n"))
;; (("pixman-1)") "pixman-1 wlroots)"))
;; (substitute* "meson.build"
;; (("wlroots = .*") "wlroots = dependency('wlroots')\n")
;; (("have_xwlr = .*") "have_xwlr = true\n")
;; (("udis = .*") "\n")
;; (("udis86 = .*") "udis86 = dependency('udis86')\n")
;; (("xcb_dep = .*") "xcb_dep = dependency('xcb')\n")
;; ((".*subdirs:.*") "")
;; (("") ""))
(substitute* "src/render/OpenGL.cpp"
(("/usr") "$out")))))))
(build-system meson-build-system)
(arguments
'(#:configure-flags '("-DNO_SYSTEMD=true")))
(native-inputs
(list gcc-13
jq
git
ninja
mesa-headers
meson
pkg-config))
(inputs
(list cairo
egl-wayland
glu
glfw
hyprland-protocols
libglvnd
libinput
libxkbcommon
libdrm
mesa
wayland
wayland-protocols
pango
pciutils
udis86
wlroots
xcb-util))
(home-page "https://www.hyprland.org") (synopsis "Dynamic tiling
Wayland compositor based on wlroots") (description "Hyprland.")
(license license:bsd-3)))