python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / applications / misc / ulauncher / default.nix
blob5890ec59acfc75ec4707ba6e8184f3bd95d053ad
1 { lib
2 , fetchurl
3 , nix-update-script
4 , python3Packages
5 , gdk-pixbuf
6 , glib
7 , gnome
8 , gobject-introspection
9 , gtk3
10 , wrapGAppsHook
11 , webkitgtk
12 , libnotify
13 , keybinder3
14 , libappindicator
15 , intltool
16 , wmctrl
17 , xvfb-run
18 , librsvg
21 python3Packages.buildPythonApplication rec {
22   pname = "ulauncher";
23   version = "5.12.1";
25   src = fetchurl {
26     url = "https://github.com/Ulauncher/Ulauncher/releases/download/${version}/ulauncher_${version}.tar.gz";
27     sha256 = "sha256-Fd3IOCEeXGV8zGd/8SzrWRsSsZRVePnsDaX8WrBrCOQ=";
28   };
30   nativeBuildInputs = with python3Packages; [
31     distutils_extra
32     gobject-introspection
33     intltool
34     wrapGAppsHook
35     gdk-pixbuf
36   ];
38   buildInputs = [
39     gdk-pixbuf
40     glib
41     gnome.adwaita-icon-theme
42     gtk3
43     keybinder3
44     libappindicator
45     libnotify
46     librsvg
47     webkitgtk
48     wmctrl
49   ];
51   propagatedBuildInputs = with python3Packages; [
52     mock
53     mypy
54     mypy-extensions
55     dbus-python
56     pygobject3
57     pyinotify
58     python-Levenshtein
59     pyxdg
60     pycairo
61     requests
62     websocket-client
63   ];
65   checkInputs = with python3Packages; [
66     mock
67     pytest
68     pytest-mock
69     xvfb-run
70   ];
72   patches = [
73     ./fix-path.patch
74     ./0001-Adjust-get_data_path-for-NixOS.patch
75     ./fix-extensions.patch
76   ];
78   postPatch = ''
79     substituteInPlace setup.py --subst-var out
80     patchShebangs bin/ulauncher-toggle
81     substituteInPlace bin/ulauncher-toggle \
82       --replace wmctrl ${wmctrl}/bin/wmctrl
83   '';
85   # https://github.com/Ulauncher/Ulauncher/issues/390
86   doCheck = false;
88   preCheck = ''
89     export PYTHONPATH=$PYTHONPATH:$out/${python3Packages.python.sitePackages}
90   '';
92   # Simple translation of
93   # - https://github.com/Ulauncher/Ulauncher/blob/f5a601bdca75198a6a31b9d84433496b63530e74/test
94   checkPhase = ''
95     runHook preCheck
97     # skip tests in invocation that handle paths that
98     # aren't nix friendly (i think)
99     xvfb-run -s '-screen 0 1024x768x16' \
100       pytest -k 'not TestPath and not test_handle_key_press_event' tests
102     runHook postCheck
103   '';
105   # do not double wrap
106   dontWrapGApps = true;
107   preFixup = ''
108     makeWrapperArgs+=(
109      "''${gappsWrapperArgs[@]}"
110      --prefix PATH : "${lib.makeBinPath [ wmctrl ]}"
111     )
112   '';
114   passthru = {
115     updateScript = nix-update-script {
116       attrPath = pname;
117     };
118   };
121   meta = with lib; {
122     description = "A fast application launcher for Linux, written in Python, using GTK";
123     homepage = "https://ulauncher.io/";
124     license = licenses.gpl3;
125     platforms = platforms.linux;
126     maintainers = with maintainers; [ aaronjanse ];
127   };