summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-05-25 11:11:36 +0000
committerAlyssa Ross <hi@alyssa.is>2023-05-27 13:21:15 +0000
commitdcc7704356d5622b0de8a1e41a537849cee6baf1 (patch)
treed6be0b4403e03dcef5b539ec9423cce0befe049c
parentf333927497274800b76f5c016a89bc51b33893f5 (diff)
downloadnixpkgs-dcc7704356d5622b0de8a1e41a537849cee6baf1.tar
nixpkgs-dcc7704356d5622b0de8a1e41a537849cee6baf1.tar.gz
nixpkgs-dcc7704356d5622b0de8a1e41a537849cee6baf1.tar.bz2
nixpkgs-dcc7704356d5622b0de8a1e41a537849cee6baf1.tar.lz
nixpkgs-dcc7704356d5622b0de8a1e41a537849cee6baf1.tar.xz
nixpkgs-dcc7704356d5622b0de8a1e41a537849cee6baf1.tar.zst
nixpkgs-dcc7704356d5622b0de8a1e41a537849cee6baf1.zip
weston: use proper option parameters
This will prevent mistakes like trying to enable features based on a
non-existent package, like the one I just fixed.
-rw-r--r--pkgs/applications/window-managers/weston/default.nix55
-rw-r--r--pkgs/top-level/all-packages.nix17
2 files changed, 39 insertions, 33 deletions
diff --git a/pkgs/applications/window-managers/weston/default.nix b/pkgs/applications/window-managers/weston/default.nix
index 84ef3b8d338..118fe626eee 100644
--- a/pkgs/applications/window-managers/weston/default.nix
+++ b/pkgs/applications/window-managers/weston/default.nix
@@ -1,12 +1,16 @@
 { lib, stdenv, fetchurl
 , meson, ninja, pkg-config, python3, wayland-scanner
-, cairo, dbus, lcms2, libdrm, libevdev, libinput, libjpeg, seatd, libxkbcommon
-, mesa, wayland, wayland-protocols
-, pipewire ? null, pango ? null, freerdp ? null
-, libXcursor ? null, libva ? null, libwebp ? null, xwayland ? null
-# beware of null defaults, as the parameters *are* supplied by callPackage by default
-, buildDemo ? true
-, buildRemoting ? true, gst_all_1
+, cairo, dbus, lcms2, libdrm, libevdev, libinput, libjpeg, libxkbcommon, mesa
+, seatd, wayland, wayland-protocols
+
+, demoSupport ? true
+, pangoSupport ? true, pango
+, pipewireSupport ? true, pipewire
+, rdpSupport ? true, freerdp
+, remotingSupport ? true, gst_all_1
+, vaapiSupport ? true, libva
+, webpSupport ? true, libwebp
+, xwaylandSupport ? true, libXcursor, xwayland
 }:
 
 stdenv.mkDerivation rec {
@@ -21,25 +25,28 @@ stdenv.mkDerivation rec {
   depsBuildBuild = [ pkg-config ];
   nativeBuildInputs = [ meson ninja pkg-config python3 wayland-scanner ];
   buildInputs = [
-    cairo dbus freerdp lcms2 libXcursor libdrm libevdev libinput libjpeg seatd
-    libva libwebp libxkbcommon mesa pango pipewire wayland wayland-protocols
-  ] ++ lib.optionals buildRemoting [
-    gst_all_1.gstreamer
-    gst_all_1.gst-plugins-base
-  ];
+    cairo dbus lcms2 libdrm libevdev libinput libjpeg libxkbcommon mesa seatd
+    wayland wayland-protocols
+  ] ++ lib.optional pangoSupport pango
+    ++ lib.optional pipewireSupport pipewire
+    ++ lib.optional rdpSupport freerdp
+    ++ lib.optionals remotingSupport [ gst_all_1.gstreamer gst_all_1.gst-plugins-base ]
+    ++ lib.optional vaapiSupport libva
+    ++ lib.optional webpSupport libwebp
+    ++ lib.optionals xwaylandSupport [ libXcursor xwayland ];
 
   mesonFlags= [
-    "-Dbackend-drm-screencast-vaapi=${lib.boolToString (libva != null)}"
-    "-Dbackend-rdp=${lib.boolToString (freerdp != null)}"
-    "-Dxwayland=${lib.boolToString (xwayland != null)}" # Default is true!
-    (lib.mesonBool "remoting" buildRemoting)
-    "-Dpipewire=${lib.boolToString (pipewire != null)}"
-    "-Dimage-webp=${lib.boolToString (libwebp != null)}"
-    (lib.mesonBool "demo-clients" buildDemo)
-    "-Dsimple-clients="
-    "-Dtest-junit-xml=false"
-  ] ++ lib.optionals (xwayland != null) [
-    "-Dxwayland-path=${xwayland.out}/bin/Xwayland"
+    (lib.mesonBool "backend-drm-screencast-vaapi" vaapiSupport)
+    (lib.mesonBool "backend-rdp" rdpSupport)
+    (lib.mesonBool "demo-clients" demoSupport)
+    (lib.mesonBool "image-webp" webpSupport)
+    (lib.mesonBool "pipewire" pipewireSupport)
+    (lib.mesonBool "remoting" remotingSupport)
+    (lib.mesonOption "simple-clients" "")
+    (lib.mesonBool "test-junit-xml" false)
+    (lib.mesonBool "xwayland" xwaylandSupport)
+  ] ++ lib.optionals xwaylandSupport [
+    (lib.mesonOption "xwayland-path" "${xwayland.out}/bin/Xwayland")
   ];
 
   passthru.providedSessions = [ "weston" ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index d694d05d42b..ac46b64496c 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -35210,15 +35210,14 @@ with pkgs;
   weechatScripts = recurseIntoAttrs (callPackage ../applications/networking/irc/weechat/scripts { });
 
   westonLite = weston.override {
-    pango = null;
-    freerdp = null;
-    libXcursor = null;
-    libva = null;
-    libwebp = null;
-    xwayland = null;
-    pipewire = null;
-    buildDemo = false;
-    buildRemoting = false;
+    demoSupport = false;
+    pangoSupport = false;
+    pipewireSupport = false;
+    rdpSupport = false;
+    remotingSupport = false;
+    vaapiSupport = false;
+    webpSupport = false;
+    xwaylandSupport = false;
   };
 
   chatterino2 = libsForQt5.callPackage ../applications/networking/instant-messengers/chatterino2 {