ulauncher: 4.4.0.r1 -> 5.6.1

+104 -13
+55
pkgs/applications/misc/ulauncher/0001-Adjust-get_data_path-for-NixOS.patch
···
··· 1 + From 86cc27022015697a61d1ec1b13e52f9dbe7f6c57 Mon Sep 17 00:00:00 2001 2 + From: worldofpeace <worldofpeace@protonmail.ch> 3 + Date: Mon, 23 Mar 2020 18:34:00 -0400 4 + Subject: [PATCH] Adjust get_data_path for NixOS 5 + 6 + We construct the ulauncher data path from xdg_data_dirs 7 + and prevent it from being a nix store path or being xdg_data_home. 8 + We do this to prevent /nix/store paths being hardcoded to shortcuts.json. 9 + On NixOS this path will either be /run/current-system/sw/share/ulauncher 10 + or $HOME/.nix-profile/share/ulauncher if the user used nix-env. 11 + --- 12 + ulauncher/config.py | 27 ++++++++++++++++++--------- 13 + 1 file changed, 18 insertions(+), 9 deletions(-) 14 + 15 + diff --git a/ulauncher/config.py b/ulauncher/config.py 16 + index f21014e..cc636e1 100644 17 + --- a/ulauncher/config.py 18 + +++ b/ulauncher/config.py 19 + @@ -50,15 +50,24 @@ def get_data_path(): 20 + is specified at installation time. 21 + """ 22 + 23 + - # Get pathname absolute or relative. 24 + - path = os.path.join( 25 + - os.path.dirname(__file__), __ulauncher_data_directory__) 26 + - 27 + - abs_data_path = os.path.abspath(path) 28 + - if not os.path.exists(abs_data_path): 29 + - raise ProjectPathNotFoundError(abs_data_path) 30 + - 31 + - return abs_data_path 32 + + paths = list( 33 + + filter( 34 + + os.path.exists, 35 + + [ 36 + + os.path.join(dir, "ulauncher") 37 + + for dir in xdg_data_dirs 38 + + # Get path that isn't in the /nix/store so they don't get hardcoded into configs 39 + + if not dir.startswith("/nix/store/") 40 + + # Exclude .local/share/ulauncher which isn't what we want 41 + + if not dir.startswith(xdg_data_home) 42 + + ], 43 + + ) 44 + + ) 45 + + 46 + + try: 47 + + return paths[0] 48 + + except: 49 + + raise ProjectPathNotFoundError() 50 + 51 + 52 + def is_wayland(): 53 + -- 54 + 2.25.1 55 +
+24 -13
pkgs/applications/misc/ulauncher/default.nix
··· 1 { stdenv 2 , fetchurl 3 - , python27Packages 4 , gnome3 5 , gobject-introspection 6 , wrapGAppsHook 7 , webkitgtk 8 , libnotify ··· 11 , intltool 12 , wmctrl 13 , xvfb_run 14 }: 15 16 - python27Packages.buildPythonApplication rec { 17 pname = "ulauncher"; 18 - version = "4.4.0.r1"; 19 20 - # Python 3 support is currently in development 21 - # on the dev branch and 5.x.x releases 22 - disabled = ! python27Packages.isPy27; 23 24 src = fetchurl { 25 url = "https://github.com/Ulauncher/Ulauncher/releases/download/${version}/ulauncher_${version}.tar.gz"; 26 - sha256 = "12v7qpjhf0842ivsfflsl2zlvhiaw25f9ffv7vhnkvrhrmksim9f"; 27 }; 28 29 - nativeBuildInputs = with python27Packages; [ 30 distutils_extra 31 intltool 32 wrapGAppsHook 33 ]; 34 35 buildInputs = [ 36 gnome3.adwaita-icon-theme 37 gobject-introspection 38 keybinder3 39 libappindicator 40 libnotify 41 webkitgtk 42 wmctrl 43 ]; 44 45 - propagatedBuildInputs = with python27Packages; [ 46 dbus-python 47 - notify 48 pygobject3 49 pyinotify 50 - pysqlite 51 python-Levenshtein 52 pyxdg 53 websocket_client 54 ]; 55 56 - checkInputs = with python27Packages; [ 57 mock 58 pytest 59 pytest-mock ··· 63 64 patches = [ 65 ./fix-path.patch 66 ]; 67 68 postPatch = '' ··· 73 doCheck = false; 74 75 preCheck = '' 76 - export PYTHONPATH=$PYTHONPATH:$out/${python27Packages.python.sitePackages} 77 ''; 78 79 # Simple translation of
··· 1 { stdenv 2 , fetchurl 3 + , python3Packages 4 + , gdk-pixbuf 5 + , glib 6 , gnome3 7 , gobject-introspection 8 + , gtk3 9 , wrapGAppsHook 10 , webkitgtk 11 , libnotify ··· 14 , intltool 15 , wmctrl 16 , xvfb_run 17 + , librsvg 18 }: 19 20 + python3Packages.buildPythonApplication rec { 21 pname = "ulauncher"; 22 + version = "5.6.1"; 23 24 + disabled = python3Packages.isPy27; 25 26 src = fetchurl { 27 url = "https://github.com/Ulauncher/Ulauncher/releases/download/${version}/ulauncher_${version}.tar.gz"; 28 + sha256 = "14k68lp58wldldhaq4cf0ffkhi81czv4ps9xa86iw1j5b1gd2vbl"; 29 }; 30 31 + nativeBuildInputs = with python3Packages; [ 32 distutils_extra 33 intltool 34 wrapGAppsHook 35 ]; 36 37 buildInputs = [ 38 + gdk-pixbuf 39 + glib 40 gnome3.adwaita-icon-theme 41 gobject-introspection 42 + gtk3 43 keybinder3 44 libappindicator 45 libnotify 46 + librsvg 47 webkitgtk 48 wmctrl 49 ]; 50 51 + propagatedBuildInputs = with python3Packages; [ 52 + mock 53 + mypy 54 + mypy-extensions 55 dbus-python 56 pygobject3 57 pyinotify 58 python-Levenshtein 59 pyxdg 60 + requests 61 websocket_client 62 ]; 63 64 + checkInputs = with python3Packages; [ 65 mock 66 pytest 67 pytest-mock ··· 71 72 patches = [ 73 ./fix-path.patch 74 + ./fix-permissions.patch # ulauncher PR #523 75 + ./0001-Adjust-get_data_path-for-NixOS.patch 76 + ./fix-extensions.patch 77 ]; 78 79 postPatch = '' ··· 84 doCheck = false; 85 86 preCheck = '' 87 + export PYTHONPATH=$PYTHONPATH:$out/${python3Packages.python.sitePackages} 88 ''; 89 90 # Simple translation of
+13
pkgs/applications/misc/ulauncher/fix-extensions.patch
···
··· 1 + diff --git a/ulauncher/api/server/ExtensionRunner.py b/ulauncher/api/server/ExtensionRunner.py 2 + index 22042bf..f7b31c8 100644 3 + --- a/ulauncher/api/server/ExtensionRunner.py 4 + +++ b/ulauncher/api/server/ExtensionRunner.py 5 + @@ -79,7 +79,7 @@ class ExtensionRunner: 6 + cmd = [sys.executable, os.path.join(self.extensions_dir, extension_id, 'main.py')] 7 + env = os.environ.copy() 8 + env['ULAUNCHER_WS_API'] = self.extension_server.generate_ws_url(extension_id) 9 + - env['PYTHONPATH'] = ':'.join(filter(bool, [ULAUNCHER_APP_DIR, os.getenv('PYTHONPATH')])) 10 + + env['PYTHONPATH'] = ':'.join([ULAUNCHER_APP_DIR] + sys.path) 11 + 12 + if self.verbose: 13 + env['VERBOSE'] = '1'
+12
pkgs/applications/misc/ulauncher/fix-permissions.patch
···
··· 1 + diff --git a/ulauncher/utils/Theme.py b/ulauncher/utils/Theme.py 2 + index 9cde624..4e36c4f 100644 3 + --- a/ulauncher/utils/Theme.py 4 + +++ b/ulauncher/utils/Theme.py 5 + @@ -138,6 +138,9 @@ class Theme: 6 + rmtree(new_theme_dir) 7 + copytree(self.path, new_theme_dir) 8 + 9 + + # change file permissions (because Nix store is read-only) 10 + + os.chmod(new_theme_dir, 0o755) 11 + + 12 + return os.path.join(new_theme_dir, 'generated.css')