nixpkgs/pkgs/applications/misc/ulauncher/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

128 lines
2.6 KiB
Nix
Raw Normal View History

{ lib
, fetchurl
, nix-update-script
2020-03-27 20:47:10 +00:00
, python3Packages
, gdk-pixbuf
, glib
, gnome
, gobject-introspection
2020-03-27 20:47:10 +00:00
, gtk3
, wrapGAppsHook
, webkitgtk
, libnotify
, keybinder3
, libappindicator
, intltool
, wmctrl
2021-05-08 13:45:03 +00:00
, xvfb-run
2020-03-27 20:47:10 +00:00
, librsvg
2022-10-17 11:57:10 +00:00
, libX11
}:
2020-04-13 21:46:38 +00:00
python3Packages.buildPythonApplication rec {
pname = "ulauncher";
2022-10-17 11:57:10 +00:00
version = "5.15.0";
src = fetchurl {
url = "https://github.com/Ulauncher/Ulauncher/releases/download/${version}/ulauncher_${version}.tar.gz";
2022-10-17 11:57:10 +00:00
sha256 = "sha256-1Qo6ffMtVRtZDPCHvHEl7T0dPdDUxP4TP2hkSVSdQpo";
};
2020-04-13 21:46:38 +00:00
nativeBuildInputs = with python3Packages; [
distutils_extra
gobject-introspection
intltool
wrapGAppsHook
2021-09-26 09:05:22 +00:00
gdk-pixbuf
];
buildInputs = [
2020-03-27 20:47:10 +00:00
glib
gnome.adwaita-icon-theme
2020-03-27 20:47:10 +00:00
gtk3
keybinder3
libappindicator
libnotify
2020-03-27 20:47:10 +00:00
librsvg
webkitgtk
wmctrl
];
2020-03-27 20:47:10 +00:00
propagatedBuildInputs = with python3Packages; [
mock
mypy
mypy-extensions
dbus-python
pygobject3
pyinotify
levenshtein
pyxdg
2021-09-26 09:05:22 +00:00
pycairo
2020-03-27 20:47:10 +00:00
requests
websocket-client
];
nativeCheckInputs = with python3Packages; [
mock
2019-07-13 09:27:00 +00:00
pytest
pytest-mock
2021-05-08 13:45:03 +00:00
xvfb-run
];
patches = [
./fix-path.patch
2020-03-27 20:47:10 +00:00
./fix-extensions.patch
];
postPatch = ''
substituteInPlace setup.py --subst-var out
patchShebangs bin/ulauncher-toggle
substituteInPlace bin/ulauncher-toggle \
--replace wmctrl ${wmctrl}/bin/wmctrl
'';
# https://github.com/Ulauncher/Ulauncher/issues/390
doCheck = false;
preCheck = ''
2020-03-27 20:47:10 +00:00
export PYTHONPATH=$PYTHONPATH:$out/${python3Packages.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' tests
runHook postCheck
'';
# do not double wrap
dontWrapGApps = true;
preFixup = ''
2021-09-26 09:05:22 +00:00
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
--prefix PATH : "${lib.makeBinPath [ wmctrl ]}"
2022-10-17 11:57:10 +00:00
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libX11 ]}"
--prefix WEBKIT_DISABLE_COMPOSITING_MODE : "1"
2021-09-26 09:05:22 +00:00
)
'';
passthru = {
updateScript = nix-update-script { };
};
meta = with 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 ];
};
}