From 70ec3a3c0f248f24da9ad42c4c7ec5e90107c284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 May 2024 01:22:37 +0200 Subject: [PATCH 1/4] gst_all_1.gst-plugins-rs: add withGtkPlugins option --- pkgs/development/libraries/gstreamer/rs/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gstreamer/rs/default.nix b/pkgs/development/libraries/gstreamer/rs/default.nix index d1f1259635fa..d4afb8ce7618 100644 --- a/pkgs/development/libraries/gstreamer/rs/default.nix +++ b/pkgs/development/libraries/gstreamer/rs/default.nix @@ -29,6 +29,7 @@ , nix-update-script # specifies a limited subset of plugins to build (the default `null` means all plugins supported on the stdenv platform) , plugins ? null +, withGtkPlugins ? true # Checks meson.is_cross_build(), so even canExecute isn't enough. , enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform && plugins == null , hotdoc @@ -114,7 +115,7 @@ let "reqwest" # tests hang on darwin "threadshare" # tests cannot bind to localhost on darwin "webp" # not supported on darwin (upstream crate issue) - ] ++ lib.optionals (!gst-plugins-base.glEnabled) [ + ] ++ lib.optionals (!gst-plugins-base.glEnabled || !withGtkPlugins) [ # these require gstreamer-gl "gtk4" "livesync" From cb58275dc676d0ef90671feb260957098de8e47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 May 2024 01:22:51 +0200 Subject: [PATCH 2/4] nixos/no-x-libs: build gst-plugins-rs without gtk --- nixos/modules/config/no-x-libs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/config/no-x-libs.nix b/nixos/modules/config/no-x-libs.nix index 1d7976cef36a..c94a40ca9435 100644 --- a/nixos/modules/config/no-x-libs.nix +++ b/nixos/modules/config/no-x-libs.nix @@ -48,6 +48,7 @@ with lib; gst-plugins-bad = super.gst_all_1.gst-plugins-bad.override { guiSupport = false; }; gst-plugins-base = super.gst_all_1.gst-plugins-base.override { enableWayland = false; enableX11 = false; }; gst-plugins-good = super.gst_all_1.gst-plugins-good.override { enableWayland = false; enableX11 = false; gtkSupport = false; qt5Support = false; qt6Support = false; }; + gst-plugins-rs = super.gst_all_1.gst-plugins-rs.override { withGtkPlugins = false; }; }; imagemagick = super.imagemagick.override { libX11Support = false; libXtSupport = false; }; imagemagickBig = super.imagemagickBig.override { libX11Support = false; libXtSupport = false; }; From db66127c5ba6dd50513e8dd6decff996bd352a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 May 2024 01:23:02 +0200 Subject: [PATCH 3/4] nixos/no-x-libs: make sure gst-plugins-base has enableGl disabled --- nixos/modules/config/no-x-libs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/config/no-x-libs.nix b/nixos/modules/config/no-x-libs.nix index c94a40ca9435..f413c8dcc094 100644 --- a/nixos/modules/config/no-x-libs.nix +++ b/nixos/modules/config/no-x-libs.nix @@ -46,7 +46,7 @@ with lib; graphviz = super.graphviz-nox; gst_all_1 = super.gst_all_1 // { gst-plugins-bad = super.gst_all_1.gst-plugins-bad.override { guiSupport = false; }; - gst-plugins-base = super.gst_all_1.gst-plugins-base.override { enableWayland = false; enableX11 = false; }; + gst-plugins-base = super.gst_all_1.gst-plugins-base.override { enableGl = false; enableWayland = false; enableX11 = false; }; gst-plugins-good = super.gst_all_1.gst-plugins-good.override { enableWayland = false; enableX11 = false; gtkSupport = false; qt5Support = false; qt6Support = false; }; gst-plugins-rs = super.gst_all_1.gst-plugins-rs.override { withGtkPlugins = false; }; }; From 7e492aff4b23e27915771b4a979527020bbd59d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 May 2024 01:38:00 +0200 Subject: [PATCH 4/4] gst_all_1.gst-plugins-bad: remove wayland packages if gst-plugins-base has wayland disabled --- pkgs/development/libraries/gstreamer/bad/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index b94769af76f4..8cc7bdc71a64 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -140,7 +140,7 @@ stdenv.mkDerivation rec { gobject-introspection ] ++ lib.optionals enableDocumentation [ hotdoc - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.isLinux) [ wayland # for wayland-scanner ]; @@ -211,7 +211,7 @@ stdenv.mkDerivation rec { bluez ] ++ lib.optionals microdnsSupport [ libmicrodns - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.isLinux) [ libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs wayland wayland-protocols @@ -305,6 +305,7 @@ stdenv.mkDerivation rec { ++ lib.optionals (!stdenv.isLinux) [ "-Ddoc=disabled" # needs gstcuda to be enabled which is Linux-only "-Dnvcodec=disabled" # Linux-only + ] ++ lib.optionals (!stdenv.isLinux || !gst-plugins-base.waylandEnabled) [ "-Dva=disabled" # see comment on `libva` in `buildInputs` ] ++ lib.optionals (!stdenv.isLinux || !guiSupport) [ "-Ddirectfb=disabled" @@ -322,8 +323,8 @@ stdenv.mkDerivation rec { "-Duvch264=disabled" # requires gudev "-Dv4l2codecs=disabled" # requires gudev "-Dladspa=disabled" # requires lrdf - ] ++ lib.optionals (!stdenv.isLinux || !stdenv.isx86_64) [ - "-Dqsv=disabled" # Linux (and Windows) x86 only + ] ++ lib.optionals (!stdenv.isLinux || !stdenv.isx86_64 || !gst-plugins-base.waylandEnabled) [ + "-Dqsv=disabled" # Linux (and Windows) x86 only, makes va required ] ++ lib.optionals (!gst-plugins-base.glEnabled) [ "-Dgl=disabled" ] ++ lib.optionals (!gst-plugins-base.waylandEnabled || !guiSupport) [