;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Craven ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages wayland) #:use-module (gnu packages freedesktop) ; xwayland #:use-module (gnu packages gl) ; cairo-xcb #:use-module (gnu packages glib) #:use-module (gnu packages gtk) ; cairo-xcb #:use-module (gnu packages libunwind) #:use-module (gnu packages linux) #:use-module (gnu packages pkg-config) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) ; xwayland #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils)) (define-public cairo-xcb (package (inherit cairo) (name "cairo-xcb") (inputs `(("mesa" ,mesa) ,@(package-inputs cairo))) (arguments `(#:tests? #f #:configure-flags '("--enable-xlib-xcb" "--enable-gl" "--enable-egl"))))) (define-public xwayland (package (inherit xorg-server) (name "xwayland") (inputs `(("libepoxy" ,libepoxy) ("wayland" ,wayland) ,@(package-inputs xorg-server))) (arguments (substitute-keyword-arguments (package-arguments xorg-server) ((#:configure-flags flags) `(cons* "--enable-xwayland" "--disable-xorg" "--disable-docs" "--disable-devel-docs" "--disable-xvfb" "--disable-xnest" "--disable-xquartz" "--disable-xwin" ,flags)))))) (define-public weston (package (name "weston") (version "1.11.0") (source (origin (method url-fetch) (uri (string-append "https://wayland.freedesktop.org/releases/" "weston-" version ".tar.xz")) (sha256 (base32 "09biddxw3ar797kxf9mywjkb2iwky6my39gpp51ni846y7lqdq05")))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config) ("xorg-server" ,xorg-server))) (inputs `(("cairo" ,cairo-xcb) ("dbus" ,dbus) ("elogind" ,elogind) ("libinput" ,libinput-minimal) ("libunwind" ,libunwind) ("libxcursor" ,libxcursor) ("libxkbcommon" ,libxkbcommon) ("mesa" ,mesa) ("mtdev" ,mtdev) ("linux-pam" ,linux-pam) ("wayland" ,wayland) ("wayland-protocols" ,wayland-protocols) ("xwayland" ,xwayland))) (arguments `(#:configure-flags (list "--disable-setuid-install" "--enable-systemd-login" (string-append "--with-xserver-path=" (assoc-ref %build-inputs "xwayland") "/bin/Xwayland")) #:phases (modify-phases %standard-phases (add-before 'configure 'use-elogind (lambda _ ;; Use elogind instead of systemd (substitute* "configure" (("libsystemd-login >= 198") "libelogind")) (substitute* '("src/launcher-logind.c" "src/weston-launch.c") (("#include ") "#include ")))) (add-after 'configure 'patch-confdefs.h (lambda _ (system "echo \"#define HAVE_SYSTEMD_LOGIN_209 1\" >> confdefs.h"))) (add-before 'check 'setup (lambda _ (setenv "HOME" (getcwd)) (setenv "XDG_RUNTIME_DIR" (getcwd)) #t)) (add-before 'check 'start-xorg-server (lambda* (#:key inputs #:allow-other-keys) ;; The test suite requires a running X server. (system (string-append (assoc-ref inputs "xorg-server") "/bin/Xvfb :1 &")) (setenv "DISPLAY" ":1") #t))))) (home-page "https://wayland.freedesktop.org") (synopsis "Reference implementation of a Wayland compositor") (description "Weston is the reference implementation of a Wayland compositor, and a useful compositor in its own right.") (license license:expat)))