From cc7c3c6bb84f0f235bf8c136995074cdf4ae89b5 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 3 Mar 2017 17:34:27 -0600 Subject: [PATCH 1/3] nixos/plasma5: set GST_PLUGIN_SYSTEM_PATH_1_0 to list of paths --- .../services/x11/desktop-managers/plasma5.nix | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 24225308ffb..15ffd330e72 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -181,17 +181,17 @@ in }; environment.variables = { - # Enable GTK applications to load SVG icons GST_PLUGIN_SYSTEM_PATH_1_0 = - lib.makeSearchPath "/lib/gstreamer-1.0" - (builtins.map (pkg: pkg.out) (with pkgs.gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - gst-plugins-bad - gst-libav # for mp3 playback - ])); + builtins.map (pkg: getLib pkg + "/lib/gstreamer-1.0") + (with pkgs.gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gst-plugins-bad + gst-libav # for mp3 playback + ]); + # Enable GTK applications to load SVG icons GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; }; From 5a05f6f48316f04904eabc9fdb411b093d59dc1c Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 3 Mar 2017 19:21:23 -0600 Subject: [PATCH 2/3] phonon-backend-gstreamer: hardcode gstreamer plugin paths --- .../phonon/backends/gst-plugin-paths.patch | 13 +++++++++ .../libraries/phonon/backends/gstreamer.nix | 27 +++++++++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch diff --git a/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch b/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch new file mode 100644 index 00000000000..39c1b9c0d29 --- /dev/null +++ b/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch @@ -0,0 +1,13 @@ +Index: phonon-gstreamer-4.9.0/gstreamer/backend.cpp +=================================================================== +--- phonon-gstreamer-4.9.0.orig/gstreamer/backend.cpp ++++ phonon-gstreamer-4.9.0/gstreamer/backend.cpp +@@ -85,6 +85,8 @@ Backend::Backend(QObject *parent, const + "--gst-debug-no-color" + }; + ++ qputenv("GST_PLUGIN_PATH_1_0", GST_PLUGIN_PATH_1_0); ++ + int argc = sizeof(args) / sizeof(*args); + char **argv = const_cast(args); + GError *err = 0; diff --git a/pkgs/development/libraries/phonon/backends/gstreamer.nix b/pkgs/development/libraries/phonon/backends/gstreamer.nix index 56d40f81833..9fdcf65346c 100644 --- a/pkgs/development/libraries/phonon/backends/gstreamer.nix +++ b/pkgs/development/libraries/phonon/backends/gstreamer.nix @@ -29,15 +29,32 @@ stdenv.mkDerivation rec { sha256 = "1wc5p1rqglf0n1avp55s50k7fjdzdrhg0gind15k8796w7nfbhyf"; }; + # Hardcode paths to useful plugins so the backend doesn't depend + # on system paths being set. + patches = [ ./gst-plugin-paths.patch ]; + + NIX_CFLAGS_COMPILE = + let gstPluginPaths = + lib.makeSearchPathOutput "lib" "/lib/gstreamer-1.0" + (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gst-plugins-bad + gst-libav + ]); + in [ + # This flag should be picked up through pkgconfig, but it isn't. + "-I${gst_all_1.gstreamer.dev}/lib/gstreamer-1.0/include" + + ''-DGST_PLUGIN_PATH_1_0="${gstPluginPaths}"'' + ]; + buildInputs = with gst_all_1; [ gstreamer gst-plugins-base phonon ] ++ (if withQt5 then [ qtbase qtx11extras ] else [ qt4 ]); - NIX_CFLAGS_COMPILE = [ - # This flag should be picked up through pkgconfig, but it isn't. - "-I${gst_all_1.gstreamer.dev}/lib/gstreamer-1.0/include" - ]; - nativeBuildInputs = [ cmake pkgconfig ] ++ optional withQt5 extra-cmake-modules; cmakeFlags = From edd43351cfa861a5e641a4c25666bbd3bc181f67 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 3 Mar 2017 19:21:55 -0600 Subject: [PATCH 3/3] nixos/plasma5: no need to set gstreamer plugin path --- .../modules/services/x11/desktop-managers/plasma5.nix | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 15ffd330e72..4afd8a58d64 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -181,16 +181,6 @@ in }; environment.variables = { - GST_PLUGIN_SYSTEM_PATH_1_0 = - builtins.map (pkg: getLib pkg + "/lib/gstreamer-1.0") - (with pkgs.gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - gst-plugins-bad - gst-libav # for mp3 playback - ]); # Enable GTK applications to load SVG icons GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; };