* gnu/packages/wayland.scm (weston): New file. * gnu/local.mk (GNU_PACKAGE_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/wayland.scm | 130 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 gnu/packages/wayland.scm
diff --git a/gnu/local.mk b/gnu/local.mk index 61287fd..898b2d7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -356,6 +356,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/vpn.scm \ %D%/packages/vtk.scm \ %D%/packages/w3m.scm \ + %D%/packages/wayland.scm \ %D%/packages/wdiff.scm \ %D%/packages/web.scm \ %D%/packages/webkit.scm \ diff --git a/gnu/packages/wayland.scm b/gnu/packages/wayland.scm new file mode 100644 index 0000000..0124d1b --- /dev/null +++ b/gnu/packages/wayland.scm @@ -0,0 +1,130 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 David Craven <da...@craven.ch> +;;; +;;; 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 <http://www.gnu.org/licenses/>. + +(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 <systemd/sd-login.h>") + "#include <elogind/sd-login.h>")))) + (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))) -- 2.9.0