From a9a03c707388ceedfe423b089bee04f06c165b46 Mon Sep 17 00:00:00 2001 From: Aaron Janse Date: Sat, 16 Mar 2019 11:17:03 -0700 Subject: [PATCH] ulauncher: init at 4.4.0.r1 Co-Authored-By: worldofpeace --- maintainers/maintainer-list.nix | 13 +++ pkgs/applications/misc/ulauncher/default.nix | 108 ++++++++++++++++++ .../misc/ulauncher/fix-path.patch | 13 +++ pkgs/top-level/all-packages.nix | 2 + 4 files changed, 136 insertions(+) create mode 100644 pkgs/applications/misc/ulauncher/default.nix create mode 100644 pkgs/applications/misc/ulauncher/fix-path.patch diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index bcb94ab5d60..917e7da5e29 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -62,6 +62,19 @@ github = "aanderse"; name = "Aaron Andersen"; }; + aaronjanse = { + email = "aaron@ajanse.me"; + github = "aaronjanse"; + name = "Aaron Janse"; + keys = [ + { longkeyid = "rsa2048/0x651BD4B37D75E234"; # Email only + fingerprint = "490F 5009 34E7 20BD 4C53 96C2 651B D4B3 7D75 E234"; + } + { longkeyid = "rsa4096/0xBE6C92145BFF4A34"; # Git, etc + fingerprint = "CED9 6DF4 63D7 B86A 1C4B 1322 BE6C 9214 5BFF 4A34"; + } + ]; + }; aaronschif = { email = "aaronschif@gmail.com"; github = "aaronschif"; diff --git a/pkgs/applications/misc/ulauncher/default.nix b/pkgs/applications/misc/ulauncher/default.nix new file mode 100644 index 00000000000..961df1a4c53 --- /dev/null +++ b/pkgs/applications/misc/ulauncher/default.nix @@ -0,0 +1,108 @@ +{ stdenv +, fetchFromGitHub +, fetchurl +, python27Packages +, substituteAll +, gnome3 +, gobject-introspection +, wrapGAppsHook +, gtk3 +, webkitgtk +, libnotify +, keybinder3 +, libappindicator +, intltool +, wmctrl +, hicolor-icon-theme +, xvfb_run +}: + +python27Packages.buildPythonApplication rec { + pname = "ulauncher"; + version = "4.4.0.r1"; + + # Python 3 support is currently in development + # on the dev branch and 5.x.x releases + disabled = ! python27Packages.isPy27; + + src = fetchurl { + url = "https://github.com/Ulauncher/Ulauncher/releases/download/${version}/ulauncher_${version}.tar.gz"; + sha256 = "12v7qpjhf0842ivsfflsl2zlvhiaw25f9ffv7vhnkvrhrmksim9f"; + }; + + nativeBuildInputs = with python27Packages; [ + distutils_extra + intltool + wrapGAppsHook + ]; + + buildInputs = [ + gnome3.adwaita-icon-theme + gobject-introspection + hicolor-icon-theme + keybinder3 + libappindicator + libnotify + webkitgtk + wmctrl + ]; + + propagatedBuildInputs = with python27Packages; [ + dbus-python + notify + pygobject3 + pyinotify + pysqlite + python-Levenshtein + pyxdg + websocket_client + ]; + + checkInputs = with python27Packages; [ + mock + pytest_3 + pytest-mock + pytestpep8 + xvfb_run + ]; + + patches = [ + ./fix-path.patch + ]; + + postPatch = '' + substituteInPlace setup.py --subst-var out + ''; + + # https://github.com/Ulauncher/Ulauncher/issues/390 + doCheck = false; + + preCheck = '' + export PYTHONPATH=$PYTHONPATH:$out/${python27Packages.python.sitePackages} + ''; + + # Simple translation of + # - https://github.com/Ulauncher/Ulauncher/blob/f5a601bdca75198a6a31b9d84433496b63530e74/test + checkPhase = '' + runHook preCheck + + # skip tests in invocation that handle paths that + # aren't nix friendly (i think) + xvfb-run -s '-screen 0 1024x768x16' \ + pytest -k 'not TestPath and not test_handle_key_press_event' --pep8 tests + + runHook postCheck + ''; + + preFixup = '' + gappsWrapperArgs+=(--prefix PATH : "${stdenv.lib.makeBinPath [ wmctrl ]}") + ''; + + meta = with stdenv.lib; { + description = "A fast application launcher for Linux, written in Python, using GTK"; + homepage = https://ulauncher.io/; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ aaronjanse worldofpeace ]; + }; +} diff --git a/pkgs/applications/misc/ulauncher/fix-path.patch b/pkgs/applications/misc/ulauncher/fix-path.patch new file mode 100644 index 00000000000..2936df65194 --- /dev/null +++ b/pkgs/applications/misc/ulauncher/fix-path.patch @@ -0,0 +1,13 @@ +diff --git a/setup.py b/setup.py +index 3616104..e9bbfda 100755 +--- a/setup.py ++++ b/setup.py +@@ -112,7 +112,7 @@ class InstallAndUpdateDataDirectory(DistUtilsExtra.auto.install_auto): + DistUtilsExtra.auto.install_auto.run(self) + + target_data = '/' + os.path.relpath(self.install_data, self.root) + '/' +- target_pkgdata = target_data + 'share/ulauncher/' ++ target_pkgdata = '@out@/share/ulauncher/' + target_scripts = '/' + os.path.relpath(self.install_scripts, + self.root) + '/' + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7fe8f295a48..70507f2110a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19829,6 +19829,8 @@ in testssl = callPackage ../applications/networking/testssl { }; + ulauncher = callPackage ../applications/misc/ulauncher { }; + umurmur = callPackage ../applications/networking/umurmur { }; udocker = pythonPackages.callPackage ../tools/virtualization/udocker { };