Merge pull request #73876 from jtojnar/phonon-backends

Fix Plasma NixOS tests
This commit is contained in:
worldofpeace 2019-11-22 19:44:19 +00:00 committed by GitHub
commit 9995881b79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 75 additions and 95 deletions

View File

@ -13,9 +13,7 @@
<para>
It sets <xref linkend="opt-services.xserver.enable"/>,
<xref linkend="opt-services.xserver.displayManager.sddm.enable"/>,
<xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/> (
<link linkend="opt-services.xserver.desktopManager.plasma5.enableQt4Support">
without Qt4 Support</link>), and
<xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/>, and
<xref linkend="opt-services.xserver.libinput.enable"/> to true. It also
includes glxinfo and firefox in the system packages list.
</para>

View File

@ -171,6 +171,11 @@
setting <literal>serviceConfig.PrivateTmp</literal> to <literal>false</literal> for each phpfpm unit.
</para>
</listitem>
<listitem>
<para>
KDEs old multimedia framework Phonon no longer supports Qt 4. For that reason, Plasma desktop also does not have <option>enableQt4Support</option> option any more.
</para>
</listitem>
</itemizedlist>
</section>

View File

@ -11,7 +11,6 @@ with lib;
services.xserver = {
desktopManager.plasma5 = {
enable = true;
enableQt4Support = false;
};
# Automatically login as nixos.

View File

@ -9,7 +9,6 @@
displayManager.sddm.enable = true;
desktopManager.plasma5 = {
enable = true;
enableQt4Support = false;
};
libinput.enable = true; # for touchpad support on many laptops
};

View File

@ -27,20 +27,13 @@ in
example = "vlc";
description = "Phonon audio backend to install.";
};
enableQt4Support = mkOption {
type = types.bool;
default = true;
description = ''
Enable support for Qt 4-based applications. Particularly, install a
default backend for Phonon.
'';
};
};
};
imports = [
(mkRemovedOptionModule [ "services" "xserver" "desktopManager" "plasma5" "enableQt4Support" ] "Phonon no longer supports Qt 4.")
];
config = mkMerge [
(mkIf cfg.enable {
@ -173,9 +166,7 @@ in
# Phonon audio backend
++ lib.optional (cfg.phononBackend == "gstreamer") libsForQt5.phonon-backend-gstreamer
++ lib.optional (cfg.phononBackend == "gstreamer" && cfg.enableQt4Support) pkgs.phonon-backend-gstreamer
++ lib.optional (cfg.phononBackend == "vlc") libsForQt5.phonon-backend-vlc
++ lib.optional (cfg.phononBackend == "vlc" && cfg.enableQt4Support) pkgs.phonon-backend-vlc
# Optional hardware support features
++ lib.optionals config.hardware.bluetooth.enable [ bluedevil bluez-qt ]

View File

@ -1,21 +1,13 @@
{ stdenv, lib, fetchurl, cmake, gst_all_1, phonon, pkgconfig
, extra-cmake-modules, qtbase ? null, qtx11extras ? null, qt4 ? null
, withQt5 ? false
, extra-cmake-modules, qttools, qtbase, qtx11extras
, debug ? false
}:
with lib;
let
v = "4.9.0";
stdenv.mkDerivation rec {
pname = "phonon-backend-gstreamer";
in
assert withQt5 -> qtbase != null;
assert withQt5 -> qtx11extras != null;
stdenv.mkDerivation {
name = "${pname}-${if withQt5 then "qt5" else "qt4"}-${v}";
version = "4.10.0";
meta = with stdenv.lib; {
homepage = https://phonon.kde.org/;
@ -26,8 +18,8 @@ stdenv.mkDerivation {
};
src = fetchurl {
url = "mirror://kde/stable/phonon/${pname}/${v}/${pname}-${v}.tar.xz";
sha256 = "1wc5p1rqglf0n1avp55s50k7fjdzdrhg0gind15k8796w7nfbhyf";
url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
sha256 = "1wk1ip2w7fkh65zk6rilj314dna0hgsv2xhjmpr5w08xa8sii1y5";
};
# Hardcode paths to useful plugins so the backend doesn't depend
@ -52,17 +44,26 @@ stdenv.mkDerivation {
''-DGST_PLUGIN_PATH_1_0="${gstPluginPaths}"''
];
buildInputs = with gst_all_1;
[ gstreamer gst-plugins-base phonon ]
++ (if withQt5 then [ qtbase qtx11extras ] else [ qt4 ]);
buildInputs = with gst_all_1; [
gstreamer
gst-plugins-base
phonon
qtbase
qtx11extras
];
# 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;
nativeBuildInputs = [
cmake
pkgconfig
extra-cmake-modules
qttools
];
cmakeFlags =
[ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON";
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
];
}

View File

@ -1,22 +1,13 @@
{ stdenv, lib, fetchurl, cmake, phonon, pkgconfig, vlc
, extra-cmake-modules, qtbase ? null, qtx11extras ? null, qt4 ? null
, withQt4 ? false
, extra-cmake-modules, qttools, qtbase, qtx11extras
, debug ? false
}:
with lib;
let
v = "0.10.2";
stdenv.mkDerivation rec {
pname = "phonon-backend-vlc";
in
assert withQt4 -> qt4 != null;
assert !withQt4 -> qtbase != null;
assert !withQt4 -> qtx11extras != null;
stdenv.mkDerivation {
name = "${pname}-${if withQt4 then "qt4" else "qt5"}-${v}";
version = "0.11.1";
meta = with stdenv.lib; {
homepage = https://phonon.kde.org/;
@ -26,17 +17,25 @@ stdenv.mkDerivation {
};
src = fetchurl {
url = "mirror://kde/stable/phonon/${pname}/${v}/${pname}-${v}.tar.xz";
sha256 = "163jqq5p9n0yfw2fqk0cqn3c6mqycxsvc4956zhkw5345g81a2a9";
url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
sha256 = "1vp52i5996khpxs233an7mlrzdji50gcs58ig8nrwfwlgyb1xnfc";
};
buildInputs =
[ phonon vlc ]
++ (if withQt4 then [ qt4 ] else [ qtbase qtx11extras ]);
buildInputs = [
phonon
vlc
qtbase
qtx11extras
];
nativeBuildInputs = [ cmake pkgconfig ] ++ optional (!withQt4) extra-cmake-modules;
nativeBuildInputs = [
cmake
pkgconfig
qttools
extra-cmake-modules
];
cmakeFlags =
[ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
++ optional (!withQt4) "-DPHONON_BUILD_PHONON4QT5=ON";
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
];
}

View File

@ -1,22 +1,17 @@
{ stdenv, lib, fetchurl, cmake, libGLU_combined, pkgconfig, libpulseaudio
, qt4 ? null, extra-cmake-modules ? null, qtbase ? null, qttools ? null
, withQt5 ? false
, extra-cmake-modules, qtbase, qttools
, debug ? false }:
with lib;
let
v = "4.11.1";
soname = if withQt5 then "phonon4qt5" else "phonon";
soname = "phonon4qt5";
buildsystemdir = "share/cmake/${soname}";
in
assert withQt5 -> qtbase != null;
assert withQt5 -> qttools != null;
stdenv.mkDerivation {
name = "phonon-${if withQt5 then "qt5" else "qt4"}-${v}";
stdenv.mkDerivation rec {
pname = "phonon";
version = "4.11.1";
meta = {
homepage = https://phonon.kde.org/;
@ -27,25 +22,30 @@ stdenv.mkDerivation {
};
src = fetchurl {
url = "mirror://kde/stable/phonon/${v}/phonon-${v}.tar.xz";
url = "mirror://kde/stable/phonon/${version}/phonon-${version}.tar.xz";
sha256 = "0bfy8iqmjhlg3ma3iqd3kxjc2zkzpjgashbpf5x17y0dc2i1whxl";
};
buildInputs =
[ libGLU_combined libpulseaudio ]
++ (if withQt5 then [ qtbase qttools ] else [ qt4 ]);
buildInputs = [
libGLU_combined
libpulseaudio
qtbase
qttools
];
nativeBuildInputs =
[ cmake pkgconfig ]
++ optional withQt5 extra-cmake-modules;
nativeBuildInputs = [
cmake
pkgconfig
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";
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
];
preConfigure = ''
cmakeFlags+=" -DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs"
@ -63,10 +63,8 @@ stdenv.mkDerivation {
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}\")"

View File

@ -309,6 +309,9 @@ mapAliases ({
procps-ng = procps; # added 2018-06-08
pyo3-pack = maturin;
pulseaudioLight = pulseaudio; # added 2018-04-25
phonon-backend-gstreamer = throw "Please use libsForQt5.phonon-backend-gstreamer, as Qt4 support in this package has been removed."; # added 2019-11-22
phonon-backend-vlc = throw "Please use libsForQt5.phonon-backend-vlc, as Qt4 support in this package has been removed."; # added 2019-11-22
phonon = throw "Please use libsForQt5.phonon, as Qt4 support in this package has been removed."; # added 2019-11-22
qca-qt5 = libsForQt5.qca-qt5; # added 2015-12-19
quake3game = ioquake3; # added 2016-01-14
qwt6 = libsForQt5.qwt; # added 2015-12-19

View File

@ -13412,15 +13412,6 @@ in
pdf2xml = callPackage ../development/libraries/pdf2xml {} ;
phonon = callPackage ../development/libraries/phonon {};
phonon-backend-gstreamer = callPackage ../development/libraries/phonon/backends/gstreamer.nix {};
# TODO(@Ma27) get rid of that as soon as QT4 can be dropped
phonon-backend-vlc = callPackage ../development/libraries/phonon/backends/vlc.nix {
withQt4 = true;
};
inherit (callPackage ../development/libraries/physfs { })
physfs_2
physfs;
@ -13705,13 +13696,9 @@ in
openbr = callPackage ../development/libraries/openbr { };
phonon = callPackage ../development/libraries/phonon {
withQt5 = true;
};
phonon = callPackage ../development/libraries/phonon { };
phonon-backend-gstreamer = callPackage ../development/libraries/phonon/backends/gstreamer.nix {
withQt5 = true;
};
phonon-backend-gstreamer = callPackage ../development/libraries/phonon/backends/gstreamer.nix { };
phonon-backend-vlc = callPackage ../development/libraries/phonon/backends/vlc.nix { };