From 49299adf4e95037c1692fca941d6370e453e2855 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Fri, 26 Mar 2021 13:07:18 +0100 Subject: [PATCH] wlroots_0_12: init at 0.12.0 Uses the old wlroots in places where the new one isn't yet compatible. Co-authored-by: Alyssa Ross Co-authored-by: Michael Weiss --- .../window-managers/wayfire/applications.nix | 33 +++++------ pkgs/development/libraries/wlroots/0.12.nix | 57 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 35 +++++++++--- 3 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 pkgs/development/libraries/wlroots/0.12.nix diff --git a/pkgs/applications/window-managers/wayfire/applications.nix b/pkgs/applications/window-managers/wayfire/applications.nix index 6c22227c0c5..a77d3f8bf5d 100644 --- a/pkgs/applications/window-managers/wayfire/applications.nix +++ b/pkgs/applications/window-managers/wayfire/applications.nix @@ -1,23 +1,20 @@ -{ newScope, wayfirePlugins }: +{ lib, newScope, wayfirePlugins }: -let - self = with self; { - inherit wayfirePlugins; +lib.makeExtensible (self: with self; { + inherit wayfirePlugins; - callPackage = newScope self; + callPackage = newScope self; - wayfire = callPackage ./. { }; + wayfire = callPackage ./. { }; - wcm = callPackage ./wcm.nix { - inherit (wayfirePlugins) wf-shell; - }; - - wrapWayfireApplication = callPackage ./wrapper.nix { }; - - withPlugins = selector: self // { - wayfire = wrapWayfireApplication wayfire selector; - wcm = wrapWayfireApplication wcm selector; - }; + wcm = callPackage ./wcm.nix { + inherit (wayfirePlugins) wf-shell; }; -in -self + + wrapWayfireApplication = callPackage ./wrapper.nix { }; + + withPlugins = selector: self // { + wayfire = wrapWayfireApplication wayfire selector; + wcm = wrapWayfireApplication wcm selector; + }; +}) diff --git a/pkgs/development/libraries/wlroots/0.12.nix b/pkgs/development/libraries/wlroots/0.12.nix new file mode 100644 index 00000000000..009aadd39e6 --- /dev/null +++ b/pkgs/development/libraries/wlroots/0.12.nix @@ -0,0 +1,57 @@ +{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, wayland +, libGL, wayland-protocols, libinput, libxkbcommon, pixman +, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa +, libpng, ffmpeg +}: + +# Fixed version derivation. +# nixpkgs-update: no auto update +stdenv.mkDerivation rec { + pname = "wlroots"; + version = "0.12.0"; + + src = fetchFromGitHub { + owner = "swaywm"; + repo = "wlroots"; + rev = version; + sha256 = "01j38lmgs2c6fq68v8b75pkilia2wsgzgp46ivfbi9hhx47kgcfn"; + }; + + # $out for the library and $examples for the example programs (in examples): + outputs = [ "out" "examples" ]; + + nativeBuildInputs = [ meson ninja pkg-config wayland ]; + + buildInputs = [ + libGL wayland wayland-protocols libinput libxkbcommon pixman + xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa + libpng ffmpeg + ]; + + mesonFlags = [ "-Dlogind-provider=systemd" "-Dlibseat=disabled" ]; + + postFixup = '' + # Install ALL example programs to $examples: + # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle + # screenshot output-layout multi-pointer rotation tablet touch pointer + # simple + mkdir -p $examples/bin + cd ./examples + for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do + cp "$binary" "$examples/bin/wlroots-$binary" + done + ''; + + meta = with lib; { + description = "A modular Wayland compositor library"; + longDescription = '' + Pluggable, composable, unopinionated modules for building a Wayland + compositor; or about 50,000 lines of code you were going to write anyway. + ''; + inherit (src.meta) homepage; + changelog = "https://github.com/swaywm/wlroots/releases/tag/${version}"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ primeos ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 30ed4770905..e084dd00be4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22038,7 +22038,9 @@ in caerbannog = callPackage ../applications/misc/caerbannog { }; - cage = callPackage ../applications/window-managers/cage { }; + cage = callPackage ../applications/window-managers/cage { + wlroots = wlroots_0_12; + }; calf = callPackage ../applications/audio/calf { inherit (gnome2) libglade; @@ -23479,6 +23481,8 @@ in wlroots = callPackage ../development/libraries/wlroots { }; + wlroots_0_12 = callPackage ../development/libraries/wlroots/0.12.nix {}; + sway-unwrapped = callPackage ../applications/window-managers/sway { }; sway = callPackage ../applications/window-managers/sway/wrapper.nix { }; swaybg = callPackage ../applications/window-managers/sway/bg.nix { }; @@ -23499,7 +23503,9 @@ in wbg = callPackage ../applications/misc/wbg { }; - hikari = callPackage ../applications/window-managers/hikari { }; + hikari = callPackage ../applications/window-managers/hikari { + wlroots = wlroots_0_12; + }; i3 = callPackage ../applications/window-managers/i3 { xcb-util-cursor = if stdenv.isDarwin then xcb-util-cursor-HEAD else xcb-util-cursor; @@ -23561,7 +23567,9 @@ in i3-wk-switch = callPackage ../applications/window-managers/i3/wk-switch.nix { }; - waybox = callPackage ../applications/window-managers/waybox { }; + waybox = callPackage ../applications/window-managers/waybox { + wlroots = wlroots_0_12; + }; windowchef = callPackage ../applications/window-managers/windowchef/default.nix { }; @@ -26432,10 +26440,15 @@ in wayfireApplications = wayfireApplications-unwrapped.withPlugins (plugins: [ plugins.wf-shell ]); inherit (wayfireApplications) wayfire wcm; - wayfireApplications-unwrapped = recurseIntoAttrs (callPackage ../applications/window-managers/wayfire/applications.nix { }); - wayfirePlugins = recurseIntoAttrs (callPackage ../applications/window-managers/wayfire/plugins.nix { - inherit (wayfireApplications-unwrapped) wayfire; - }); + wayfireApplications-unwrapped = recurseIntoAttrs ( + (callPackage ../applications/window-managers/wayfire/applications.nix { }). + extend (_: _: { wlroots = wlroots_0_12; }) + ); + wayfirePlugins = recurseIntoAttrs ( + callPackage ../applications/window-managers/wayfire/plugins.nix { + inherit (wayfireApplications-unwrapped) wayfire; + } + ); wf-config = callPackage ../applications/window-managers/wayfire/wf-config.nix { }; waypipe = callPackage ../applications/networking/remote/waypipe { }; @@ -26477,7 +26490,9 @@ in weston = callPackage ../applications/window-managers/weston { pipewire = pipewire_0_2; }; - wio = callPackage ../applications/window-managers/wio { }; + wio = callPackage ../applications/window-managers/wio { + wlroots = wlroots_0_12; + }; whitebox-tools = callPackage ../applications/gis/whitebox-tools { inherit (darwin.apple_sdk.frameworks) Security; @@ -30806,7 +30821,9 @@ in bottom = callPackage ../tools/system/bottom {}; - cagebreak = callPackage ../applications/window-managers/cagebreak/default.nix {}; + cagebreak = callPackage ../applications/window-managers/cagebreak/default.nix { + wlroots = wlroots_0_12; + }; psftools = callPackage ../os-specific/linux/psftools {};