From a07fc25d564f455b8a506520082cd5e602d740a2 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 22 Mar 2021 13:05:37 +0200 Subject: [PATCH] gnomeExtensions.sound-output-device-chooser: 32 -> 35 Refresh paths patch. --- .../sound-output-device-chooser/default.nix | 7 ++++--- .../sound-output-device-chooser/fix-paths.patch | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pkgs/desktops/gnome-3/extensions/sound-output-device-chooser/default.nix b/pkgs/desktops/gnome-3/extensions/sound-output-device-chooser/default.nix index a6444025ebbc..e58d8ce6e42f 100644 --- a/pkgs/desktops/gnome-3/extensions/sound-output-device-chooser/default.nix +++ b/pkgs/desktops/gnome-3/extensions/sound-output-device-chooser/default.nix @@ -7,16 +7,17 @@ stdenv.mkDerivation rec { pname = "gnome-shell-extension-sound-output-device-chooser"; - version = "32"; + version = "35"; src = fetchFromGitHub { owner = "kgshank"; repo = "gse-sound-output-device-chooser"; rev = version; - sha256 = "1s83scr80qv5xmlfsy6dnsj96lwg2rr4pbsw9inld3ylblgvi35l"; + sha256 = "sha256-Yl5ut6kJAkAAdCBiNFpwDgshXCLMmFH3/zhnFGpyKqs="; }; patches = [ + # Fix paths to libpulse and python (substituteAll { src = ./fix-paths.patch; libpulse = "${libpulseaudio}/lib/libpulse.so"; @@ -36,7 +37,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "GNOME Shell extension adding audio device chooser to panel"; - license = licenses.gpl3; + license = licenses.gpl3Plus; maintainers = with maintainers; [ jtojnar ]; homepage = "https://github.com/kgshank/gse-sound-output-device-chooser"; }; diff --git a/pkgs/desktops/gnome-3/extensions/sound-output-device-chooser/fix-paths.patch b/pkgs/desktops/gnome-3/extensions/sound-output-device-chooser/fix-paths.patch index 5957cb956f7a..1971bf1e5e74 100644 --- a/pkgs/desktops/gnome-3/extensions/sound-output-device-chooser/fix-paths.patch +++ b/pkgs/desktops/gnome-3/extensions/sound-output-device-chooser/fix-paths.patch @@ -2,20 +2,20 @@ diff --git a/sound-output-device-chooser@kgshank.net/convenience.js b/sound-outp index 54ad06f..0860531 100644 --- a/sound-output-device-chooser@kgshank.net/convenience.js +++ b/sound-output-device-chooser@kgshank.net/convenience.js -@@ -129,7 +129,7 @@ function refreshCards() { - if(_settings.get_boolean(Prefs.NEW_PROFILE_ID)) { +@@ -142,7 +142,7 @@ function refreshCards() { + if (newProfLogic) { _log("New logic"); - let pyLocation = Me.dir.get_child('utils/pa_helper.py').get_path(); -- let pythonExec = 'python'; + let pyLocation = Me.dir.get_child("utils/pa_helper.py").get_path(); +- let pythonExec = ["python", "python3", "python2"].find(cmd => isCmdFound(cmd)); + let pythonExec = '@python@'; - let pyVer = 3; - while(!isCmdFound(pythonExec) && pyVer >=2){ - _log(pythonExec + " is not found. Try next"); + if (!pythonExec) { + _log("ERROR: Python not found. fallback to default mode"); + _settings.set_boolean(Prefs.NEW_PROFILE_ID, false); diff --git a/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py b/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py index c4d2484..262608d 100644 --- a/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py +++ b/sound-output-device-chooser@kgshank.net/utils/libpulse_introspect.py -@@ -86,7 +86,7 @@ else: +@@ -82,7 +82,7 @@ else: _libraries = {}