From b1123db790131f0c581401967942c55cba01d2e9 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Mon, 17 Nov 2014 19:30:46 -0600 Subject: [PATCH] phonon-backend-gstreamer: add Qt 5 support --- .../phonon-backend-gstreamer/default.nix | 29 +++++++++++++------ pkgs/top-level/all-packages.nix | 8 ++++- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/phonon-backend-gstreamer/default.nix b/pkgs/development/libraries/phonon-backend-gstreamer/default.nix index 844c2e580093..5067a3bd2c25 100644 --- a/pkgs/development/libraries/phonon-backend-gstreamer/default.nix +++ b/pkgs/development/libraries/phonon-backend-gstreamer/default.nix @@ -1,28 +1,39 @@ -{ stdenv, fetchurl, cmake, automoc4, qt4, pkgconfig, phonon, gstreamer -, gst_plugins_base }: +{ stdenv, fetchurl, cmake, automoc4, pkgconfig, gst_all_1 +, phonon, qt4 ? null, qt5 ? null, withQt5 ? false }: + +with stdenv.lib; + +assert (withQt5 -> qt5 != null); assert (!withQt5 -> qt4 != null); let - version = "4.7.2"; + version = "4.8.0"; pname = "phonon-backend-gstreamer"; + qt = if withQt5 then qt5 else qt4; + # Force same Qt version in phonon + phonon_ = phonon.override { inherit qt4 qt5 withQt5; }; in stdenv.mkDerivation rec { name = "${pname}-${version}"; src = fetchurl { - url = "mirror://kde/stable/phonon/${pname}/${version}/src/${name}.tar.xz"; - sha256 = "1cfjk450aajr8hfhnfq7zbmryprxiwr9ha5x585dsh7mja82mdw0"; + url = "mirror://kde/stable/phonon/${pname}/${version}/${name}.tar.xz"; + sha256 = "0zjqf1gpj6h9hj27225vihg5gj0fjgvh4n9nkrbij7kf57bcn6gq"; }; - buildInputs = [ phonon qt4 gstreamer gst_plugins_base ]; + buildInputs = with gst_all_1; [ phonon_ qt gstreamer gst-plugins-base ]; nativeBuildInputs = [ cmake automoc4 pkgconfig ]; - cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" ]; + cmakeFlags = + [ "-DCMAKE_INSTALL_LIBDIR=lib" + ] ++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON"; meta = { homepage = http://phonon.kde.org/; description = "GStreamer backend for Phonon"; - platforms = stdenv.lib.platforms.linux; - }; + platforms = platforms.linux; + maintainers = with maintainers; [ ttuegel ]; + license = licenses.lgpl21Plus; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3b919b3d8cb4..f3b9331ce980 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6522,7 +6522,13 @@ let qt4 = null; }; - phonon_backend_gstreamer = callPackage ../development/libraries/phonon-backend-gstreamer { }; + phonon_backend_gstreamer = callPackage ../development/libraries/phonon-backend-gstreamer { inherit qt4; }; + + phonon_qt5_backend_gstreamer = phonon_backend_gstreamer.override { + withQt5 = true; + inherit qt5; + qt4 = null; + }; phonon_backend_vlc = callPackage ../development/libraries/phonon-backend-vlc { };