2021-02-05 17:12:51 +00:00
|
|
|
{ lib, python3, fetchFromGitHub, wrapQtAppsHook, buildEnv, aspellDicts
|
2020-04-24 23:36:52 +00:00
|
|
|
# Use `lib.collect lib.isDerivation aspellDicts;` to make all dictionaries
|
|
|
|
# available.
|
|
|
|
, enchantAspellDicts ? with aspellDicts; [ en en-computers en-science ]
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
version = "7.0.4";
|
2021-02-13 14:23:35 +00:00
|
|
|
pythonEnv = python3.withPackages (ps: with ps; [
|
2020-04-24 23:36:52 +00:00
|
|
|
pyqt5 docutils pyenchant Markups markdown pygments chardet
|
|
|
|
]);
|
2021-02-13 14:23:35 +00:00
|
|
|
in python3.pkgs.buildPythonApplication {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version;
|
|
|
|
pname = "retext";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "retext-project";
|
|
|
|
repo = "retext";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1zcapywspc9v5zf5cxqkcy019np9n41gmryqixj66zsvd544c6si";
|
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ wrapQtAppsHook ];
|
|
|
|
propagatedBuildInputs = [ pythonEnv ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-10-11 12:50:04 +00:00
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
|
|
|
makeWrapperArgs+=(
|
|
|
|
"--set" "ASPELL_CONF" "dict-dir ${buildEnv {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "aspell-all-dicts";
|
|
|
|
paths = map (path: "${path}/lib/aspell") enchantAspellDicts;
|
|
|
|
}}"
|
2020-10-11 12:50:04 +00:00
|
|
|
)
|
2021-03-23 19:22:30 +00:00
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/me.mitya57.ReText.desktop \
|
|
|
|
--replace "Exec=ReText-${version}.data/scripts/retext %F" "Exec=$out/bin/retext %F" \
|
|
|
|
--replace "Icon=ReText-${version}.data/data/share/retext/icons/retext.svg" "Icon=$out/share/retext/icons/retext.svg"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/retext-project/retext/";
|
|
|
|
description = "Simple but powerful editor for Markdown and reStructuredText";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ klntsky ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|