Skip to content
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

Merged
merged 4 commits into from Mar 10, 2017

Conversation

ttuegel
Copy link
Member

@ttuegel ttuegel commented Mar 4, 2017

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

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@ttuegel, thanks for your PR! By analyzing the history of the files in this pull request, we identified @abbradar, @ixmatus and @fadenb to be potential reviewers.

Copy link
Contributor

@ixmatus ixmatus left a 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
Copy link
Contributor

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.

Copy link
Member Author

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...

Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Member Author

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!

@ttuegel
Copy link
Member Author

ttuegel commented Mar 10, 2017

I split the difference by using the pre-processor and NIX_CFLAGS_COMPILE. I am averse to inlining patches because it makes maintenance more difficult: eventually someone will need to update this patch, and that's a bit of a pain if it's inline.

@ttuegel ttuegel merged commit 290c096 into NixOS:master Mar 10, 2017
@ttuegel ttuegel deleted the phonon-gstreamer branch March 10, 2017 14:02
@ixmatus
Copy link
Contributor

ixmatus commented Mar 10, 2017

I like your latest way of doing it better and I agree with you. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants