base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / tu / tuifimanager / package.nix
blob7d2a68badb691e13501c5db124168693da20a815
1 { stdenv
2 , lib
3 , python3
4 , fetchFromGitHub
5 , kdePackages
6 , gnome-themes-extra
7 , qt6
8 , makeWrapper
9 , x11Support ? stdenv.hostPlatform.isLinux
10 # pypinput is marked as broken for darwin
11 , pynputSupport ? stdenv.hostPlatform.isLinux
12 # Experimental Drag & Drop support requires x11 & pyinput suport
13 , hasDndSupport ? x11Support && pynputSupport
14 , enableDragAndDrop ? false
17 lib.throwIf (enableDragAndDrop && !hasDndSupport)
18   "Drag and drop support is only available for linux with xorg."
20 python3.pkgs.buildPythonApplication rec {
21   pname = "tuifimanager";
22   version = "5.0.0";
23   format = "pyproject";
25   src = fetchFromGitHub {
26     owner = "GiorgosXou";
27     repo = "TUIFIManager";
28     rev = "v.${version}";
29     hash = "sha256-2yYD1YFGoN0uj3HzcYxEs3zbwfUIDLLzvfTcZILx5h4=";
30   };
32   nativeBuildInputs = [
33     python3.pkgs.setuptools
34     python3.pkgs.setuptools-scm
35   ] ++ (lib.optionals enableDragAndDrop [
36     qt6.wrapQtAppsHook
37     makeWrapper
38   ]);
40   propagatedBuildInputs = [
41     python3.pkgs.send2trash
42     python3.pkgs.unicurses
43   ] ++ (lib.optionals enableDragAndDrop [
44     python3.pkgs.pynput
45     python3.pkgs.pyside6
46     python3.pkgs.requests
47     python3.pkgs.xlib
48     kdePackages.qtbase
49     kdePackages.qt6gtk2
50   ]);
52   postFixup = let
53     # fix missing 'adwaita' warning missing with ncurses tui
54     # see: https://github.com/NixOS/nixpkgs/issues/60918
55     theme = gnome-themes-extra;
56   in
57     lib.optionalString enableDragAndDrop ''
58       wrapProgram $out/bin/tuifi \
59         --prefix GTK_PATH : "${theme}/lib/gtk-2.0" \
60         --set tuifi_synth_dnd True
61     '';
63   pythonImportsCheck = [ "TUIFIManager" ];
65   meta = {
66     description = "Cross-platform terminal-based termux-oriented file manager";
67     longDescription = ''
68       A cross-platform terminal-based termux-oriented file manager (and component),
69       meant to be used with a Uni-Curses project or as is. This project is mainly an
70       attempt to get more attention to the Uni-Curses project.
71     '';
72     homepage = "https://github.com/GiorgosXou/TUIFIManager";
73     license = lib.licenses.gpl3Only;
74     maintainers = with lib.maintainers; [ michaelBelsanti sigmanificient ];
75     mainProgram = "tuifi";
76   };