2021-01-25 09:26:54 +01:00
|
|
|
{ lib, python3, fetchFromGitHub, wrapQtAppsHook, buildEnv, aspellDicts
|
2019-03-16 20:14:52 +01: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-09 16:28:24 +01:00
|
|
|
pythonEnv = python3.withPackages (ps: with ps; [
|
2019-03-16 20:14:52 +01:00
|
|
|
pyqt5 docutils pyenchant Markups markdown pygments chardet
|
|
|
|
]);
|
2021-02-09 16:28:24 +01:00
|
|
|
in python3.pkgs.buildPythonApplication {
|
2019-03-16 20:14:52 +01:00
|
|
|
inherit version;
|
|
|
|
pname = "retext";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "retext-project";
|
|
|
|
repo = "retext";
|
2019-09-09 01:38:31 +02:00
|
|
|
rev = version;
|
2019-03-16 20:14:52 +01:00
|
|
|
sha256 = "1zcapywspc9v5zf5cxqkcy019np9n41gmryqixj66zsvd544c6si";
|
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2019-11-17 08:50:07 +01:00
|
|
|
nativeBuildInputs = [ wrapQtAppsHook ];
|
2019-03-23 08:39:01 +01:00
|
|
|
propagatedBuildInputs = [ pythonEnv ];
|
2019-03-16 20:14:52 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-10-08 00:47:20 +02:00
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
|
|
|
makeWrapperArgs+=(
|
|
|
|
"--set" "ASPELL_CONF" "dict-dir ${buildEnv {
|
2019-03-16 20:14:52 +01:00
|
|
|
name = "aspell-all-dicts";
|
|
|
|
paths = map (path: "${path}/lib/aspell") enchantAspellDicts;
|
|
|
|
}}"
|
2020-10-08 00:47:20 +02:00
|
|
|
)
|
2021-02-09 16:33:33 +01: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"
|
2019-03-16 20:14:52 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/retext-project/retext/";
|
2019-03-16 20:14:52 +01:00
|
|
|
description = "Simple but powerful editor for Markdown and reStructuredText";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ klntsky ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|