biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / editors / retext / default.nix
blob10e6a04498ab5ef8a492e432e986e471295fbba0
1 { lib
2 , python3
3 , fetchzip
4 , fetchFromGitHub
5 , wrapQtAppsHook
6 , qtbase
7 , qttools
8 , qtsvg
9 , buildEnv
10 , aspellDicts
11   # Use `lib.collect lib.isDerivation aspellDicts;` to make all dictionaries
12   # available.
13 , enchantAspellDicts ? with aspellDicts; [ en en-computers ]
16 python3.pkgs.buildPythonApplication rec {
17   pname = "retext";
18   version = "8.0.2";
19   format = "setuptools";
21   src = fetchFromGitHub {
22     owner = "retext-project";
23     repo = pname;
24     rev = "refs/tags/${version}";
25     hash = "sha256-BToW9rPFEbgAErvJ5gtUpNadCLtlRihE7eKKFgO5N68=";
26   };
28   toolbarIcons = fetchzip {
29     url = "https://github.com/retext-project/retext/archive/icons.zip";
30     hash = "sha256-LQtSFCGWcKvXis9pFDmPqAMd1m6QieHQiz2yykeTdnI=";
31   };
33   nativeBuildInputs = [
34     wrapQtAppsHook
35     qttools.dev
36   ];
38   buildInputs = [
39     qtbase
40     qtsvg
41   ];
43   propagatedBuildInputs = with python3.pkgs; [
44     chardet
45     docutils
46     markdown
47     markups
48     pyenchant
49     pygments
50     pyqt6
51     pyqt6-webengine
52   ];
54   patches = [ ./remove-wheel-check.patch ];
56   preConfigure = ''
57     lrelease ReText/locale/*.ts
58   '';
60   # prevent double wrapping
61   dontWrapQtApps = true;
63   postInstall = ''
64     makeWrapperArgs+=("''${qtWrapperArgs[@]}")
65     makeWrapperArgs+=(
66       "--set" "ASPELL_CONF" "dict-dir ${buildEnv {
67         name = "aspell-all-dicts";
68         paths = map (path: "${path}/lib/aspell") enchantAspellDicts;
69       }}"
70     )
72     cp ${toolbarIcons}/* $out/${python3.pkgs.python.sitePackages}/ReText/icons
74     substituteInPlace $out/share/applications/me.mitya57.ReText.desktop \
75       --replace "Exec=ReText-${version}.data/scripts/retext %F" "Exec=$out/bin/retext %F" \
76       --replace "Icon=ReText/icons/retext.svg" "Icon=retext"
77   '';
79   doCheck = false;
81   pythonImportsCheck = [
82     "ReText"
83   ];
85   meta = with lib; {
86     description = "Editor for Markdown and reStructuredText";
87     homepage = "https://github.com/retext-project/retext/";
88     license = licenses.gpl3Plus;
89     maintainers = with maintainers; [ klntsky ];
90     platforms = platforms.unix;
91     mainProgram = "retext";
92   };