patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH nixpkgs 0/2] spectrumPackages.spectrum-vm: switch compositor from Wayfire to tinywl
@ 2021-07-01 15:54 Alyssa Ross
  2021-07-01 15:54 ` [PATCH nixpkgs 1/2] tinywl: init at 0.11.0 Alyssa Ross
  2021-07-01 15:54 ` [PATCH nixpkgs 2/2] spectrumPackages.sys-vms.comp: switch to tinywl Alyssa Ross
  0 siblings, 2 replies; 3+ messages in thread
From: Alyssa Ross @ 2021-07-01 15:54 UTC (permalink / raw)
  To: devel

This is another change I want to get in before updating Spectrum's
Nixpkgs, because once we do that the current approach will no longer
work.

As explained in patch 2's commit message, this change only affects
this demo, not the eventual Spectrum system.

Alyssa Ross (2):
  tinywl: init at 0.11.0
  spectrumPackages.sys-vms.comp: switch to tinywl

 .../window-managers/tinywl/default.nix        | 30 ++++++++++++++++++
 .../linux/spectrum/vm/comp/default.nix        | 31 ++++++-------------
 pkgs/top-level/all-packages.nix               |  2 ++
 3 files changed, 41 insertions(+), 22 deletions(-)
 create mode 100644 pkgs/applications/window-managers/tinywl/default.nix


base-commit: 129d329e3bcdcc972454ce284e17da16b28bd401
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH nixpkgs 1/2] tinywl: init at 0.11.0
  2021-07-01 15:54 [PATCH nixpkgs 0/2] spectrumPackages.spectrum-vm: switch compositor from Wayfire to tinywl Alyssa Ross
@ 2021-07-01 15:54 ` Alyssa Ross
  2021-07-01 15:54 ` [PATCH nixpkgs 2/2] spectrumPackages.sys-vms.comp: switch to tinywl Alyssa Ross
  1 sibling, 0 replies; 3+ messages in thread
From: Alyssa Ross @ 2021-07-01 15:54 UTC (permalink / raw)
  To: devel

tinywl is the wlroots reference compositor.  It's very useful when
debugging Wayland/wlroots problems as it helps with determining
whether an issue is the fault of a compositor or of wlroots.

(cherry picked from commit d59a508701fca5b6cf090f19abfe35d4b41e03bb)
---
 .../window-managers/tinywl/default.nix        | 30 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  2 ++
 2 files changed, 32 insertions(+)
 create mode 100644 pkgs/applications/window-managers/tinywl/default.nix

diff --git a/pkgs/applications/window-managers/tinywl/default.nix b/pkgs/applications/window-managers/tinywl/default.nix
new file mode 100644
index 00000000000..4dc50fb8ed4
--- /dev/null
+++ b/pkgs/applications/window-managers/tinywl/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, wlroots, pkg-config
+, libGL, libxkbcommon, pixman, udev, wayland, wayland-protocols
+}:
+
+stdenv.mkDerivation {
+  pname = "tinywl";
+  inherit (wlroots) version src;
+
+  sourceRoot = "source/tinywl";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    libGL libxkbcommon pixman udev wayland wayland-protocols wlroots
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    cp tinywl $out/bin
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/swaywm/wlroots/tree/master/tinywl";
+    description = ''"minimum viable product" Wayland compositor based on wlroots.'';
+    maintainers = with maintainers; [ qyliss ];
+    license = licenses.cc0;
+    inherit (wlroots.meta) platforms;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6ba0505cb8a..d9f6adac419 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -23268,6 +23268,8 @@ in
 
   trayer = callPackage ../applications/window-managers/trayer { };
 
+  tinywl = callPackage ../applications/window-managers/tinywl { };
+
   tinywm = callPackage ../applications/window-managers/tinywm { };
 
   tree-from-tags = callPackage ../applications/audio/tree-from-tags { };
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH nixpkgs 2/2] spectrumPackages.sys-vms.comp: switch to tinywl
  2021-07-01 15:54 [PATCH nixpkgs 0/2] spectrumPackages.spectrum-vm: switch compositor from Wayfire to tinywl Alyssa Ross
  2021-07-01 15:54 ` [PATCH nixpkgs 1/2] tinywl: init at 0.11.0 Alyssa Ross
@ 2021-07-01 15:54 ` Alyssa Ross
  1 sibling, 0 replies; 3+ messages in thread
From: Alyssa Ross @ 2021-07-01 15:54 UTC (permalink / raw)
  To: devel

Recent versions of wlroots (not yet in Spectrum's Nixpkgs) make it
impossible to use Wayfire as a Wayland client over Virtio Wayland,
because of an architectural change in wlroots that means dma-bufs are
now required to use the GLES2 renderer, which is the only one Wayfire
supports, with the Wayland backend.  Sommelier as a compositor does
not (and cannot) support the zwp_linux_dmabuf_v1 Wayland protocol this
requires, because to do so it would have to be able to send dma-bufs
allocated by the guest client over Virtio Wayland.  (This isn't
possible because of general difficulties with guest->host memory
sharing.)

The "comp" VM as it stands is designed to be used with spectrum-vm, as
a demo that people can run on their non-Spectrum systems, and see a
Wayland compositor appear as a Wayland window in their host
compositor.  Since it's no longer possible to use Wayfire for this use
case, let's use tinywl here instead, since we have no requirements
that it doesn't fulfill as a minimum-viable compositor.

This doesn't change anything regarding non-demo uses of Spectrum.
Running a Wayland compositor itself as a Wayland client is not an
activity that really makes sense in an actual Spectrum system.
Realistic use cases for Wayland compositors in Spectrum (on a host
system, or in a VM with a GPU passed through, or possibly in a VM with
virtio-gpu) are not affected by this limitation, since in all cases
the compositor would render directly to a GPU, not to a Wayland window
to be displayed by another compositor.
---
 .../linux/spectrum/vm/comp/default.nix        | 31 ++++++-------------
 1 file changed, 9 insertions(+), 22 deletions(-)

diff --git a/pkgs/os-specific/linux/spectrum/vm/comp/default.nix b/pkgs/os-specific/linux/spectrum/vm/comp/default.nix
index 988fad5fba6..9b1490e33cb 100644
--- a/pkgs/os-specific/linux/spectrum/vm/comp/default.nix
+++ b/pkgs/os-specific/linux/spectrum/vm/comp/default.nix
@@ -1,13 +1,13 @@
 { lib, makeRootfs, runCommand, writeScript, writeText
 , busybox, emacs26-nox, execline, gcc, linux_vm, s6, sommelier, source-code-pro
-, wayfire, westonLite, zsh
+, tinywl, westonLite, zsh
 }:
 
 runCommand "vm-comp" rec {
   linux = linux_vm;
 
   path = [
-    busybox emacs26-nox execline gcc s6 sommelier wayfire westonLite zsh
+    busybox emacs26-nox execline gcc s6 sommelier tinywl westonLite zsh
   ];
 
   login = writeScript "login" ''
@@ -16,20 +16,6 @@ runCommand "vm-comp" rec {
     ${busybox}/bin/login -p -f root $@
   '';
 
-  # This can't be /etc/wayfire/defaults.ini because autostart entries
-  # from that file aren't applied.
-  wayfireConfig = writeText "wayfire-config" ''
-    [core]
-    xwayland = false
-
-    [input]
-    xkb_layout = us
-    xkb_variant = dvorak
-
-    [autostart]
-    terminal = weston-terminal --shell $(command -v zsh)
-  '';
-
   rootfs = makeRootfs {
     services.getty.run = writeScript "getty-run" ''
       #! ${execline}/bin/execlineb -P
@@ -41,15 +27,15 @@ runCommand "vm-comp" rec {
         bundle
       '';
       contents = writeText "ok-all-contents" ''
-        wayfire
+        compositor
       '';
     };
 
-    rcServices.wayfire = {
-      type = writeText "wayfire-type" ''
+    rcServices.compositor = {
+      type = writeText "compositor-type" ''
         longrun
       '';
-      run = writeScript "wayfire-run" ''
+      run = writeScript "compositor-run" ''
         #! ${execline}/bin/execlineb -S0
 
         s6-applyuidgid -u 1000 -g 1000
@@ -57,11 +43,12 @@ runCommand "vm-comp" rec {
         export HOME /
         export PATH ${lib.makeBinPath path}
         export XDG_RUNTIME_DIR /run/user/1000
+        export XKB_DEFAULT_LAYOUT dvorak
 
         ${sommelier}/bin/sommelier
-        wayfire -c ${wayfireConfig}
+        ${tinywl}/bin/tinywl -s "weston-terminal --shell $(command -v zsh)"
       '';
-      dependencies = writeText "wayfire-dependencies" ''
+      dependencies = writeText "compositor-dependencies" ''
         wl0
       '';
     };
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-01 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 15:54 [PATCH nixpkgs 0/2] spectrumPackages.spectrum-vm: switch compositor from Wayfire to tinywl Alyssa Ross
2021-07-01 15:54 ` [PATCH nixpkgs 1/2] tinywl: init at 0.11.0 Alyssa Ross
2021-07-01 15:54 ` [PATCH nixpkgs 2/2] spectrumPackages.sys-vms.comp: switch to tinywl Alyssa Ross

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).