From 5dc3bb5e1426885f7589ec765eac31f473c2456c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 14 May 2023 19:42:35 +0200 Subject: [PATCH 1/3] gst_all_1.gst-plugins-bad: add option to build without gui libraries --- pkgs/development/libraries/gstreamer/bad/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index 63c5b92e07ca5..7861a49b565b2 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -38,7 +38,6 @@ , bluez , chromaprint , curl -, directfb , fdk_aac , flite , gsm @@ -104,6 +103,7 @@ , microdnsSupport ? false # Checks meson.is_cross_build(), so even canExecute isn't enough. , enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, guiSupport ? true, directfb }: stdenv.mkDerivation rec { @@ -185,7 +185,6 @@ stdenv.mkDerivation rec { gnutls libGL libGLU - gtk3 game-music-emu openssl libxml2 @@ -220,7 +219,6 @@ stdenv.mkDerivation rec { mjpegtools chromaprint - directfb flite libdrm libgudev @@ -237,6 +235,10 @@ stdenv.mkDerivation rec { serd sord sratom + ] ++ lib.optionals guiSupport [ + gtk3 + ] ++ lib.optionals (stdenv.isLinux && guiSupport) [ + directfb ] ++ lib.optionals stdenv.isDarwin [ # For unknown reasons the order is important, e.g. if # VideoToolbox is last, we get: @@ -297,10 +299,11 @@ stdenv.mkDerivation rec { "-Ddoc=disabled" # needs gstcuda to be enabled which is Linux-only "-Dnvcodec=disabled" # Linux-only "-Dva=disabled" # see comment on `libva` in `buildInputs` + ] ++ lib.optionals (!stdenv.isLinux || !guiSupport) [ + "-Ddirectfb=disabled" ] ++ lib.optionals stdenv.isDarwin [ "-Dchromaprint=disabled" - "-Ddirectfb=disabled" "-Dflite=disabled" "-Dkms=disabled" # renders to libdrm output "-Dlv2=disabled" From 94baf8bfd9110656f9fc022f12ec42ec8b1550fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 14 May 2023 19:43:25 +0200 Subject: [PATCH 2/3] nixos/no-x-libs: add gst-plugins-bad --- 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 dac09bdf468a9..0dce3b918458a 100644 --- a/nixos/modules/config/no-x-libs.nix +++ b/nixos/modules/config/no-x-libs.nix @@ -38,6 +38,7 @@ with lib; gpsd = super.gpsd.override { guiSupport = false; }; 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 { enableX11 = false; }; }; imagemagick = super.imagemagick.override { libX11Support = false; libXtSupport = false; }; From 34cdc0a9f9c042e2b23d9fba5fb0780b090d6fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 24 May 2023 00:57:46 +0200 Subject: [PATCH 3/3] gst_all_1.gst-plugins-rs: fix build if gst-plugins-base is build without gl --- pkgs/development/libraries/gstreamer/rs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/rs/default.nix b/pkgs/development/libraries/gstreamer/rs/default.nix index b50d7d45180f8..084433c4045ec 100644 --- a/pkgs/development/libraries/gstreamer/rs/default.nix +++ b/pkgs/development/libraries/gstreamer/rs/default.nix @@ -101,7 +101,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 (stdenv.isDarwin && !stdenv.isAarch64) [ + ] ++ lib.optionals (!gst-plugins-base.glEnabled) [ # these require gstreamer-gl which requires darwin sdk bump "gtk4" "livesync" @@ -205,7 +205,7 @@ stdenv.mkDerivation rec { export CSOUND_LIB_DIR=${lib.getLib csound}/lib '' + lib.optionalString (lib.mutuallyExclusive [ "webrtc" "webrtchttp" ] selectedPlugins) '' sed -i "/\['gstreamer-webrtc-1\.0', 'gst-plugins-bad', 'gstwebrtc_dep', 'gstwebrtc'\]/d" meson.build - '' + lib.optionalString (stdenv.isDarwin && !stdenv.isAarch64) '' + '' + lib.optionalString (!gst-plugins-base.glEnabled) '' sed -i "/\['gstreamer-gl-1\.0', 'gst-plugins-base', 'gst_gl_dep', 'gstgl'\]/d" meson.build '';