diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/phonon/backends')
3 files changed, 119 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch b/nixpkgs/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch new file mode 100644 index 000000000000..39c1b9c0d290 --- /dev/null +++ b/nixpkgs/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<char**>(args); + GError *err = 0; diff --git a/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix new file mode 100644 index 000000000000..249ce4e3629a --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix @@ -0,0 +1,65 @@ +{ stdenv, lib, fetchurl, cmake, gst_all_1, phonon, pkg-config +, extra-cmake-modules, qttools, qtbase, qtx11extras +, debug ? false +}: + +with lib; + +stdenv.mkDerivation rec { + pname = "phonon-backend-gstreamer"; + version = "4.10.0"; + + meta = with lib; { + homepage = "https://phonon.kde.org/"; + description = "GStreamer backend for Phonon"; + platforms = platforms.linux; + maintainers = with maintainers; [ ttuegel ]; + license = licenses.lgpl21; + }; + + src = fetchurl { + url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz"; + sha256 = "1wk1ip2w7fkh65zk6rilj314dna0hgsv2xhjmpr5w08xa8sii1y5"; + }; + + # 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 toString [ + # This flag should be picked up through pkg-config, 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 + qtbase + qtx11extras + ]; + + nativeBuildInputs = [ + cmake + pkg-config + extra-cmake-modules + qttools + ]; + + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" + ]; +} diff --git a/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix b/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix new file mode 100644 index 000000000000..07e6ccf1f346 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, fetchurl, cmake, phonon, pkg-config, libvlc +, extra-cmake-modules, qttools, qtbase, qtx11extras +, debug ? false +}: + +with lib; + +stdenv.mkDerivation rec { + pname = "phonon-backend-vlc"; + version = "0.11.1"; + + meta = with lib; { + homepage = "https://phonon.kde.org/"; + description = "GStreamer backend for Phonon"; + platforms = platforms.linux; + license = with licenses; [ bsd3 lgpl2Plus ]; + }; + + src = fetchurl { + url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz"; + sha256 = "1vp52i5996khpxs233an7mlrzdji50gcs58ig8nrwfwlgyb1xnfc"; + }; + + buildInputs = [ + phonon + libvlc + qtbase + qtx11extras + ]; + + nativeBuildInputs = [ + cmake + pkg-config + qttools + extra-cmake-modules + ]; + + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" + ]; +} |