anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / editors / leo-editor / default.nix
blobd4f7a59fd60d5b5672c8faebe7ea62f9939bef95
1 { lib, mkDerivation, python3, fetchFromGitHub, makeWrapper, wrapQtAppsHook, makeDesktopItem }:
3 mkDerivation rec {
4   pname = "leo-editor";
5   version = "6.8.2";
7   src = fetchFromGitHub {
8     owner = "leo-editor";
9     repo = "leo-editor";
10     rev = version;
11     sha256 = "sha256-LfeqQjzrWzqJ/iTuMOWLnxEZ+SNPVcutNPI+T3WEKnM=";
12   };
14   dontBuild = true;
16   nativeBuildInputs = [ wrapQtAppsHook makeWrapper python3 ];
17   propagatedBuildInputs = with python3.pkgs; [ pyqt6 docutils ];
19   desktopItem = makeDesktopItem {
20     name = "leo-editor";
21     exec = "leo %U";
22     icon = "leoapp32";
23     type = "Application";
24     comment = meta.description;
25     desktopName = "Leo";
26     genericName = "Text Editor";
27     categories = [ "Application" "Development" "IDE" ];
28     startupNotify = false;
29     mimeTypes = [
30       "text/plain" "text/asp" "text/x-c" "text/x-script.elisp" "text/x-fortran"
31       "text/html" "application/inf" "text/x-java-source" "application/x-javascript"
32       "application/javascript" "text/ecmascript" "application/x-ksh" "text/x-script.ksh"
33       "application/x-tex" "text/x-script.rexx" "text/x-pascal" "text/x-script.perl"
34       "application/postscript" "text/x-script.scheme" "text/x-script.guile" "text/sgml"
35       "text/x-sgml" "application/x-bsh" "application/x-sh" "application/x-shar"
36       "text/x-script.sh" "application/x-tcl" "text/x-script.tcl" "application/x-texinfo"
37       "application/xml" "text/xml" "text/x-asm"
38     ];
39   };
41   installPhase = ''
42     mkdir -p "$out/share/icons/hicolor/32x32/apps"
43     cp leo/Icons/leoapp32.png "$out/share/icons/hicolor/32x32/apps"
45     mkdir -p "$out/share/applications"
46     cp $desktopItem/share/applications/* $out/share/applications
48     mkdir -p $out/share/leo-editor
49     mv * $out/share/leo-editor
51     makeWrapper ${python3.interpreter} $out/bin/leo \
52       --set PYTHONPATH "$PYTHONPATH:$out/share/leo-editor" \
53       --add-flags "-O $out/share/leo-editor/launchLeo.py"
55     wrapQtApp $out/bin/leo
56   '';
58   meta = with lib; {
59     homepage = "http://leoeditor.com";
60     description = "A powerful folding editor";
61     longDescription = "Leo is a PIM, IDE and outliner that accelerates the work flow of programmers, authors and web designers.";
62     license = licenses.mit;
63     maintainers = with maintainers; [ leonardoce kashw2 ];
64     mainProgram = "leo";
65   };