Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

swaynotificationcenter: backport PR 296

+56
+50
pkgs/applications/misc/swaynotificationcenter/001-backport-pr296.patch
···
··· 1 + diff --git a/src/functions.vala b/src/functions.vala 2 + index cf7fefc..9b4d82a 100644 3 + --- a/src/functions.vala 4 + +++ b/src/functions.vala 5 + @@ -102,10 +102,7 @@ namespace SwayNotificationCenter { 6 + 7 + public static string get_style_path (owned string ? custom_path, 8 + bool only_system = false) { 9 + - string[] paths = { 10 + - // Fallback location. Specified in postinstall.py 11 + - "/usr/local/etc/xdg/swaync/style.css" 12 + - }; 13 + + string[] paths = {}; 14 + if (custom_path != null && custom_path.length > 0) { 15 + // Replaces the home directory relative path with a absolute path 16 + if (custom_path.get (0) == '~') { 17 + @@ -123,7 +120,9 @@ namespace SwayNotificationCenter { 18 + paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), 19 + path, "swaync/style.css"); 20 + } 21 + - 22 + + // Fallback location. Specified in postinstall.py. Mostly for Debian 23 + + paths += "/usr/local/etc/xdg/swaync/style.css"; 24 + + 25 + string path = ""; 26 + foreach (string try_path in paths) { 27 + if (File.new_for_path (try_path).query_exists ()) { 28 + @@ -140,10 +139,7 @@ namespace SwayNotificationCenter { 29 + } 30 + 31 + public static string get_config_path (owned string ? custom_path) { 32 + - string[] paths = { 33 + - // Fallback location. Specified in postinstall.py 34 + - "/usr/local/etc/xdg/swaync/config.json" 35 + - }; 36 + + string[] paths = {}; 37 + if (custom_path != null && custom_path.length > 0) { 38 + // Replaces the home directory relative path with a absolute path 39 + if (custom_path.get (0) == '~') { 40 + @@ -158,7 +154,9 @@ namespace SwayNotificationCenter { 41 + paths += Path.build_path (Path.DIR_SEPARATOR.to_string (), 42 + path, "swaync/config.json"); 43 + } 44 + - 45 + + // Fallback location. Specified in postinstall.py. Mostly for Debian 46 + + paths += "/usr/local/etc/xdg/swaync/config.json"; 47 + + 48 + string path = ""; 49 + foreach (string try_path in paths) { 50 + if (File.new_for_path (try_path).query_exists ()) {
+6
pkgs/applications/misc/swaynotificationcenter/default.nix
··· 37 hash = "sha256-mwwSTs4d9jUXUy33nSYJCRFlpH6naCmbRUSpfVacMBE="; 38 }; 39 40 nativeBuildInputs = [ 41 bash-completion 42 # cmake # currently conflicts with meson ··· 70 postPatch = '' 71 chmod +x build-aux/meson/postinstall.py 72 patchShebangs build-aux/meson/postinstall.py 73 ''; 74 75 passthru.tests.version = testers.testVersion {
··· 37 hash = "sha256-mwwSTs4d9jUXUy33nSYJCRFlpH6naCmbRUSpfVacMBE="; 38 }; 39 40 + patches = [ 41 + ./001-backport-pr296.patch 42 + ]; 43 + 44 nativeBuildInputs = [ 45 bash-completion 46 # cmake # currently conflicts with meson ··· 74 postPatch = '' 75 chmod +x build-aux/meson/postinstall.py 76 patchShebangs build-aux/meson/postinstall.py 77 + 78 + substituteInPlace src/functions.vala --replace /usr/local/etc $out/etc 79 ''; 80 81 passthru.tests.version = testers.testVersion {