lol

Merge pull request #150340 from justinas/freon-45

gnomeExtensions.freon: 44 -> 45, patch binary paths

authored by

piegames and committed by
GitHub
0dadd5fa b18b9831

+109 -3
+24 -3
pkgs/desktops/gnome/extensions/freon/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, glib }: 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , glib 5 + , substituteAll 6 + , hddtemp 7 + , liquidctl 8 + , lm_sensors 9 + , netcat-gnu 10 + , nvme-cli 11 + , procps 12 + , smartmontools 13 + }: 2 14 3 15 stdenv.mkDerivation rec { 4 16 pname = "gnome-shell-extension-freon"; 5 - version = "44"; 17 + version = "45"; 6 18 7 19 passthru = { 8 20 extensionUuid = "freon@UshakovVasilii_Github.yahoo.com"; ··· 13 25 owner = "UshakovVasilii"; 14 26 repo = "gnome-shell-extension-freon"; 15 27 rev = "EGO-${version}"; 16 - sha256 = "sha256-4DYAIC9N5id3vQe0WaOFP+MymsrPK18hbYqO4DjG+2U="; 28 + sha256 = "sha256-tPb7SzHSwvz7VV+kZTmcw1eAdtL1J7FJ3BOtg4Us8jc="; 17 29 }; 18 30 19 31 nativeBuildInputs = [ glib ]; 32 + 33 + patches = [ 34 + (substituteAll { 35 + src = ./fix_paths.patch; 36 + inherit hddtemp liquidctl lm_sensors procps smartmontools; 37 + netcat = netcat-gnu; 38 + nvmecli = nvme-cli; 39 + }) 40 + ]; 20 41 21 42 buildPhase = '' 22 43 runHook preBuild
+85
pkgs/desktops/gnome/extensions/freon/fix_paths.patch
··· 1 + diff --git a/freon@UshakovVasilii_Github.yahoo.com/hddtempUtil.js b/freon@UshakovVasilii_Github.yahoo.com/hddtempUtil.js 2 + index e5d1d6d..856654b 100644 3 + --- a/freon@UshakovVasilii_Github.yahoo.com/hddtempUtil.js 4 + +++ b/freon@UshakovVasilii_Github.yahoo.com/hddtempUtil.js 5 + @@ -7,7 +7,7 @@ var HddtempUtil = class extends CommandLineUtil.CommandLineUtil { 6 + 7 + constructor() { 8 + super(); 9 + - let hddtempArgv = GLib.find_program_in_path('hddtemp'); 10 + + let hddtempArgv = GLib.find_program_in_path('@hddtemp@/bin/hddtemp'); 11 + if(hddtempArgv) { 12 + // check if this user can run hddtemp directly. 13 + if(!GLib.spawn_command_line_sync(hddtempArgv)[3]){ 14 + @@ -19,8 +19,8 @@ var HddtempUtil = class extends CommandLineUtil.CommandLineUtil { 15 + // doesn't seem to be the case… is it running as a daemon? 16 + // Check first for systemd 17 + let systemctl = GLib.find_program_in_path('systemctl'); 18 + - let pidof = GLib.find_program_in_path('pidof'); 19 + - let nc = GLib.find_program_in_path('nc'); 20 + + let pidof = GLib.find_program_in_path('@procps@/bin/pidof'); 21 + + let nc = GLib.find_program_in_path('@netcat@/bin/nc'); 22 + let pid = undefined; 23 + 24 + if(systemctl) { 25 + @@ -35,7 +35,7 @@ var HddtempUtil = class extends CommandLineUtil.CommandLineUtil { 26 + 27 + // systemd isn't used on this system, try sysvinit instead 28 + if(!pid && pidof) { 29 + - let output = GLib.spawn_command_line_sync("pidof hddtemp")[1].toString().trim(); 30 + + let output = GLib.spawn_command_line_sync("@procps@/bin/pidof hddtemp")[1].toString().trim(); 31 + if(output.length) 32 + pid = Number(output.trim()); 33 + } 34 + diff --git a/freon@UshakovVasilii_Github.yahoo.com/liquidctlUtil.js b/freon@UshakovVasilii_Github.yahoo.com/liquidctlUtil.js 35 + index 766bf62..7cd4e94 100644 36 + --- a/freon@UshakovVasilii_Github.yahoo.com/liquidctlUtil.js 37 + +++ b/freon@UshakovVasilii_Github.yahoo.com/liquidctlUtil.js 38 + @@ -8,7 +8,7 @@ const commandLineUtil = Me.imports.commandLineUtil; 39 + var LiquidctlUtil = class extends commandLineUtil.CommandLineUtil { 40 + constructor() { 41 + super(); 42 + - const path = GLib.find_program_in_path('liquidctl'); 43 + + const path = GLib.find_program_in_path('@liquidctl@/bin/liquidctl'); 44 + this._argv = path ? [path, 'status', '--json'] : null; 45 + } 46 + 47 + diff --git a/freon@UshakovVasilii_Github.yahoo.com/nvmecliUtil.js b/freon@UshakovVasilii_Github.yahoo.com/nvmecliUtil.js 48 + index ae2ea93..2349b9e 100644 49 + --- a/freon@UshakovVasilii_Github.yahoo.com/nvmecliUtil.js 50 + +++ b/freon@UshakovVasilii_Github.yahoo.com/nvmecliUtil.js 51 + @@ -3,7 +3,7 @@ const GLib = imports.gi.GLib; 52 + const Me = imports.misc.extensionUtils.getCurrentExtension(); 53 + 54 + function getNvmeData (argv){ 55 + - const nvme = GLib.find_program_in_path('nvme') 56 + + const nvme = GLib.find_program_in_path('@nvmecli@/bin/nvme') 57 + return JSON.parse(GLib.spawn_command_line_sync(`${nvme} ${argv} -o json`)[1].toString()) 58 + } 59 + 60 + diff --git a/freon@UshakovVasilii_Github.yahoo.com/sensorsUtil.js b/freon@UshakovVasilii_Github.yahoo.com/sensorsUtil.js 61 + index 62fa580..c017748 100644 62 + --- a/freon@UshakovVasilii_Github.yahoo.com/sensorsUtil.js 63 + +++ b/freon@UshakovVasilii_Github.yahoo.com/sensorsUtil.js 64 + @@ -7,7 +7,7 @@ var SensorsUtil = class extends CommandLineUtil.CommandLineUtil { 65 + 66 + constructor() { 67 + super(); 68 + - let path = GLib.find_program_in_path('sensors'); 69 + + let path = GLib.find_program_in_path('@lm_sensors@/bin/sensors'); 70 + // -A: Do not show adapter -j: JSON output 71 + this._argv = path ? [path, '-A', '-j'] : null; 72 + } 73 + diff --git a/freon@UshakovVasilii_Github.yahoo.com/smartctlUtil.js b/freon@UshakovVasilii_Github.yahoo.com/smartctlUtil.js 74 + index 03d469b..6057a3b 100644 75 + --- a/freon@UshakovVasilii_Github.yahoo.com/smartctlUtil.js 76 + +++ b/freon@UshakovVasilii_Github.yahoo.com/smartctlUtil.js 77 + @@ -3,7 +3,7 @@ const GLib = imports.gi.GLib; 78 + const Me = imports.misc.extensionUtils.getCurrentExtension(); 79 + const ByteArray = imports.byteArray; 80 + function getSmartData (argv){ 81 + - const smartctl = GLib.find_program_in_path('smartctl') 82 + + const smartctl = GLib.find_program_in_path('@smartmontools@/bin/smartctl') 83 + return JSON.parse(ByteArray.toString( GLib.spawn_command_line_sync(`${smartctl} ${argv} -j`)[1] )) 84 + } 85 +