New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phonon-gstreamer-backend: Hardcode GStreamer plugin paths #23504
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me. I had a question and a comment about simplifying some code but it's not critical.
gst-libav | ||
]); | ||
postPatch = '' | ||
substituteInPlace gstreamer/backend.cpp --subst-var gstPluginPaths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the patch file is so small and it relies on a generated value from Nix, why not inline it and template the gstPluginPaths
? That way you don't need the substituteInPlace
step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what that means...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is, you could also write it like this to eliminate the substitution (particularly so since the patch is a small one):
patches = [
(writeTextFile
{ name = "gst-plugins-paths.patch";
text = ''
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", "${gstPluginsPath}");
+
int argc = sizeof(args) / sizeof(*args);
char **argv = const_cast<char**>(args);
GError *err = 0;
'';
})
];
@@ -182,16 +182,6 @@ in | |||
|
|||
environment.variables = { | |||
# Enable GTK applications to load SVG icons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment still relevant (asking because I don't know) now that L185 - L194 is moved to the derivation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; that comment was supposed to be for GDK_PIXBUF_MODULE_FILE
below!
c43e83d
to
edd4335
Compare
I split the difference by using the pre-processor and |
I like your latest way of doing it better and I agree with you. 👍 |
Motivation
The existing GStreamer backend for Phonon requires extensive runtime configuration to find the requisite plugins. Phonon-based applications are not usable except in KDE on NixOS.
The plugin paths are now hardcoded into the backend. To fix Phonon-based applications outside KDE, we only need the package maintainers to include the backend and wrap their package with
makeQtWrapper
.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)