Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 112 lines 2.6 kB view raw
1{ 2 lib, 3 mkDerivation, 4 python3, 5 fetchFromGitHub, 6 makeWrapper, 7 wrapQtAppsHook, 8 makeDesktopItem, 9}: 10 11mkDerivation rec { 12 pname = "leo-editor"; 13 version = "6.8.4"; 14 15 src = fetchFromGitHub { 16 owner = "leo-editor"; 17 repo = "leo-editor"; 18 rev = version; 19 sha256 = "sha256-CSugdfkAMy6VFdNdSGR+iCrK/XhwseoiMQ4mfgu4F/E="; 20 }; 21 22 dontBuild = true; 23 24 nativeBuildInputs = [ 25 wrapQtAppsHook 26 makeWrapper 27 python3 28 ]; 29 propagatedBuildInputs = with python3.pkgs; [ 30 pyqt6 31 docutils 32 ]; 33 34 desktopItem = makeDesktopItem { 35 name = "leo-editor"; 36 exec = "leo %U"; 37 icon = "leoapp32"; 38 type = "Application"; 39 comment = meta.description; 40 desktopName = "Leo"; 41 genericName = "Text Editor"; 42 categories = [ 43 "Application" 44 "Development" 45 "IDE" 46 ]; 47 startupNotify = false; 48 mimeTypes = [ 49 "text/plain" 50 "text/asp" 51 "text/x-c" 52 "text/x-script.elisp" 53 "text/x-fortran" 54 "text/html" 55 "application/inf" 56 "text/x-java-source" 57 "application/x-javascript" 58 "application/javascript" 59 "text/ecmascript" 60 "application/x-ksh" 61 "text/x-script.ksh" 62 "application/x-tex" 63 "text/x-script.rexx" 64 "text/x-pascal" 65 "text/x-script.perl" 66 "application/postscript" 67 "text/x-script.scheme" 68 "text/x-script.guile" 69 "text/sgml" 70 "text/x-sgml" 71 "application/x-bsh" 72 "application/x-sh" 73 "application/x-shar" 74 "text/x-script.sh" 75 "application/x-tcl" 76 "text/x-script.tcl" 77 "application/x-texinfo" 78 "application/xml" 79 "text/xml" 80 "text/x-asm" 81 ]; 82 }; 83 84 installPhase = '' 85 mkdir -p "$out/share/icons/hicolor/32x32/apps" 86 cp leo/Icons/leoapp32.png "$out/share/icons/hicolor/32x32/apps" 87 88 mkdir -p "$out/share/applications" 89 cp $desktopItem/share/applications/* $out/share/applications 90 91 mkdir -p $out/share/leo-editor 92 mv * $out/share/leo-editor 93 94 makeWrapper ${python3.interpreter} $out/bin/leo \ 95 --set PYTHONPATH "$PYTHONPATH:$out/share/leo-editor" \ 96 --add-flags "-O $out/share/leo-editor/launchLeo.py" 97 98 wrapQtApp $out/bin/leo 99 ''; 100 101 meta = with lib; { 102 homepage = "https://leo-editor.github.io/leo-editor/"; 103 description = "Powerful folding editor"; 104 longDescription = "Leo is a PIM, IDE and outliner that accelerates the work flow of programmers, authors and web designers."; 105 license = licenses.mit; 106 maintainers = with maintainers; [ 107 leonardoce 108 kashw2 109 ]; 110 mainProgram = "leo"; 111 }; 112}