about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/phonon
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/phonon
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
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.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/default.nix79
4 files changed, 202 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..67f343d60380
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
@@ -0,0 +1,68 @@
+{ stdenv, lib, fetchurl, cmake, gst_all_1, phonon, pkgconfig
+, extra-cmake-modules, qtbase ? null, qtx11extras ? null, qt4 ? null
+, withQt5 ? false
+, debug ? false
+}:
+
+with lib;
+
+let
+  v = "4.9.0";
+  pname = "phonon-backend-gstreamer";
+in
+
+assert withQt5 -> qtbase != null;
+assert withQt5 -> qtx11extras != null;
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${if withQt5 then "qt5" else "qt4"}-${v}";
+
+  meta = with stdenv.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}/${v}/${pname}-${v}.tar.xz";
+    sha256 = "1wc5p1rqglf0n1avp55s50k7fjdzdrhg0gind15k8796w7nfbhyf";
+  };
+
+  # 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 [
+      # This flag should be picked up through pkgconfig, 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 ]
+    ++ (if withQt5 then [ qtbase qtx11extras ] else [ qt4 ]);
+
+  # cleanup: the build system creates (empty) $out/$out/share/icons (double prefix)
+  # if DESTDIR is unset
+  DESTDIR="/";
+
+  nativeBuildInputs = [ cmake pkgconfig ] ++ optional withQt5 extra-cmake-modules;
+
+  cmakeFlags =
+    [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
+    ++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON";
+}
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..773478f4dc03
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchurl, cmake, phonon, pkgconfig, vlc
+, extra-cmake-modules, qtbase ? null, qtx11extras ? null, qt4 ? null
+, withQt4 ? false
+, debug ? false
+}:
+
+with lib;
+
+let
+  v = "0.10.1";
+  pname = "phonon-backend-vlc";
+in
+
+assert withQt4 -> qt4 != null;
+assert !withQt4 -> qtbase != null;
+assert !withQt4 -> qtx11extras != null;
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${if withQt4 then "qt4" else "qt5"}-${v}";
+
+  meta = with stdenv.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}/${v}/${pname}-${v}.tar.xz";
+    sha256 = "0b87mzkw9fdkrwgnh1kw5i5wnrd05rl42hynlykb7cfymsk6v5h9";
+  };
+
+  buildInputs =
+    [ phonon vlc ]
+    ++ (if withQt4 then [ qt4 ] else [ qtbase qtx11extras ]);
+
+  nativeBuildInputs = [ cmake pkgconfig ] ++ optional (!withQt4) extra-cmake-modules;
+
+  cmakeFlags =
+    [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
+    ++ optional (!withQt4) "-DPHONON_BUILD_PHONON4QT5=ON";
+}
diff --git a/nixpkgs/pkgs/development/libraries/phonon/default.nix b/nixpkgs/pkgs/development/libraries/phonon/default.nix
new file mode 100644
index 000000000000..82574864ec43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/default.nix
@@ -0,0 +1,79 @@
+{ stdenv, lib, fetchurl, cmake, libGLU_combined, pkgconfig, libpulseaudio
+, qt4 ? null, extra-cmake-modules ? null, qtbase ? null, qttools ? null
+, withQt5 ? false
+, debug ? false }:
+
+with lib;
+
+let
+  v = "4.10.1";
+
+  soname = if withQt5 then "phonon4qt5" else "phonon";
+  buildsystemdir = "share/cmake/${soname}";
+in
+
+assert withQt5 -> qtbase != null;
+assert withQt5 -> qttools != null;
+
+stdenv.mkDerivation rec {
+  name = "phonon-${if withQt5 then "qt5" else "qt4"}-${v}";
+
+  meta = {
+    homepage = https://phonon.kde.org/;
+    description = "Multimedia API for Qt";
+    license = stdenv.lib.licenses.lgpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ ttuegel ];
+  };
+
+  src = fetchurl {
+    url = "mirror://kde/stable/phonon/${v}/phonon-${v}.tar.xz";
+    sha256 = "1dwdw0hm6685psrp7v9frhkhqvsxrbdnm3gw794j5z7g3brqvag5";
+  };
+
+  buildInputs =
+    [ libGLU_combined libpulseaudio ]
+    ++ (if withQt5 then [ qtbase qttools ] else [ qt4 ]);
+
+  nativeBuildInputs =
+    [ cmake pkgconfig ]
+    ++ optional withQt5 extra-cmake-modules;
+
+  outputs = [ "out" "dev" ];
+
+  NIX_CFLAGS_COMPILE = "-fPIC";
+
+  cmakeFlags =
+    [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
+    ++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON";
+
+  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\")"
+
+    ${optionalString withQt5 ''
+    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"
+  '';
+}