about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/phonon
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/phonon')
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/default.nix90
4 files changed, 211 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..3e21415b4c77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
@@ -0,0 +1,67 @@
+{ 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 ];
+
+  dontWrapQtApps = true;
+
+  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..8ff0f3bb4917
--- /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
+}:
+
+stdenv.mkDerivation rec {
+  pname = "phonon-backend-vlc";
+  version = "0.11.2";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-xsM7/GjRN/DlegKeS3mMu5D1Svb3Ma9JZ3hXeRzNU6U=";
+  };
+
+  buildInputs = [
+    phonon
+    libvlc
+    qtbase
+    qtx11extras
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    qttools
+    extra-cmake-modules
+  ];
+
+  dontWrapQtApps = true;
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
+  ];
+
+  meta = with lib; {
+    homepage = "https://phonon.kde.org/";
+    description = "GStreamer backend for Phonon";
+    platforms = platforms.linux;
+    license = with licenses; [ bsd3 lgpl2Plus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/phonon/default.nix b/nixpkgs/pkgs/development/libraries/phonon/default.nix
new file mode 100644
index 000000000000..877bf973194a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/default.nix
@@ -0,0 +1,90 @@
+{ stdenv
+, lib
+, fetchurl
+, cmake
+, libGLU
+, libGL
+, pkg-config
+, libpulseaudio
+, extra-cmake-modules
+, qtbase
+, qttools
+, debug ? false
+}:
+
+with lib;
+
+let
+  soname = "phonon4qt5";
+  buildsystemdir = "share/cmake/${soname}";
+in
+
+stdenv.mkDerivation rec {
+  pname = "phonon";
+  version = "4.11.1";
+
+  meta = {
+    homepage = "https://community.kde.org/Phonon";
+    description = "Multimedia API for Qt";
+    license = lib.licenses.lgpl2;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ ttuegel ];
+  };
+
+  src = fetchurl {
+    url = "mirror://kde/stable/phonon/${version}/phonon-${version}.tar.xz";
+    sha256 = "0bfy8iqmjhlg3ma3iqd3kxjc2zkzpjgashbpf5x17y0dc2i1whxl";
+  };
+
+  buildInputs = [
+    libGLU
+    libGL
+    libpulseaudio
+    qtbase
+    qttools
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    extra-cmake-modules
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  NIX_CFLAGS_COMPILE = "-fPIC";
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
+  ];
+
+  dontWrapQtApps = true;
+
+  preConfigure = ''
+    cmakeFlags+=" -DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs"
+    cmakeFlags+=" -DPHONON_QT_IMPORTS_INSTALL_DIR=''${!outputBin}/$qtQmlPrefix"
+    cmakeFlags+=" -DPHONON_QT_PLUGIN_INSTALL_DIR=''${!outputBin}/$qtPluginPrefix/designer"
+  '';
+
+  postPatch = ''
+    sed -i PhononConfig.cmake.in \
+        -e "/get_filename_component(rootDir/ s/^.*$//" \
+        -e "/^set(PHONON_INCLUDE_DIR/ s|\''${rootDir}/||" \
+        -e "/^set(PHONON_LIBRARY_DIR/ s|\''${rootDir}/||" \
+        -e "/^set(PHONON_BUILDSYSTEM_DIR/ s|\''${rootDir}|''${!outputDev}|"
+
+    sed -i cmake/FindPhononInternal.cmake \
+        -e "/set(INCLUDE_INSTALL_DIR/ c set(INCLUDE_INSTALL_DIR \"''${!outputDev}/include\")"
+
+    sed -i cmake/FindPhononInternal.cmake \
+        -e "/set(PLUGIN_INSTALL_DIR/ c set(PLUGIN_INSTALL_DIR \"$qtPluginPrefix/..\")"
+
+    sed -i CMakeLists.txt \
+        -e "/set(BUILDSYSTEM_INSTALL_DIR/ c set(BUILDSYSTEM_INSTALL_DIR \"''${!outputDev}/${buildsystemdir}\")"
+  '';
+
+  postFixup = ''
+    sed -i "''${!outputDev}/lib/pkgconfig/${soname}.pc" \
+        -e "/^exec_prefix=/ c exec_prefix=''${!outputBin}/bin"
+  '';
+}