2022-02-14 17:40:48 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, buildEnv
|
|
|
|
, aspellDicts
|
|
|
|
# Use `lib.collect lib.isDerivation aspellDicts;` to make all dictionaries
|
|
|
|
# available.
|
2019-03-16 19:14:52 +00:00
|
|
|
, enchantAspellDicts ? with aspellDicts; [ en en-computers en-science ]
|
|
|
|
}:
|
|
|
|
|
2022-02-14 17:40:48 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2019-03-16 19:14:52 +00:00
|
|
|
pname = "retext";
|
2022-02-14 17:40:48 +00:00
|
|
|
version = "7.2.3";
|
|
|
|
format = "setuptools";
|
2019-03-16 19:14:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "retext-project";
|
|
|
|
repo = "retext";
|
2019-09-08 23:38:31 +00:00
|
|
|
rev = version;
|
2022-02-14 17:40:48 +00:00
|
|
|
hash = "sha256-EwaJFODnkZGbqVw1oQrTrx2ME4vRttVW4CMPkWvMtHA=";
|
2019-03-16 19:14:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-14 17:40:48 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
chardet
|
|
|
|
docutils
|
|
|
|
markdown
|
|
|
|
markups
|
|
|
|
pyenchant
|
|
|
|
pygments
|
|
|
|
pyqt5
|
|
|
|
];
|
2019-03-16 19:14:52 +00:00
|
|
|
|
2022-02-14 17:40:48 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Remove wheel check
|
|
|
|
sed -i -e '31,36d' setup.py
|
|
|
|
'';
|
2019-03-16 19:14:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-10-07 22:47:20 +00:00
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
|
|
|
makeWrapperArgs+=(
|
|
|
|
"--set" "ASPELL_CONF" "dict-dir ${buildEnv {
|
2019-03-16 19:14:52 +00:00
|
|
|
name = "aspell-all-dicts";
|
|
|
|
paths = map (path: "${path}/lib/aspell") enchantAspellDicts;
|
|
|
|
}}"
|
2020-10-07 22:47:20 +00:00
|
|
|
)
|
2021-02-09 15:33:33 +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"
|
2019-03-16 19:14:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-14 17:40:48 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"ReText"
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-02-14 17:40:48 +00:00
|
|
|
description = "Editor for Markdown and reStructuredText";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/retext-project/retext/";
|
2022-02-14 17:40:48 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2019-03-16 19:14:52 +00:00
|
|
|
maintainers = with maintainers; [ klntsky ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|