nixpkgs/pkgs/applications/editors/retext/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
1.6 KiB
Nix
Raw Normal View History

{ 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 ]
}:
python3.pkgs.buildPythonApplication rec {
2019-03-16 19:14:52 +00:00
pname = "retext";
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;
hash = "sha256-EwaJFODnkZGbqVw1oQrTrx2ME4vRttVW4CMPkWvMtHA=";
2019-03-16 19:14:52 +00:00
};
nativeBuildInputs = [
wrapQtAppsHook
];
propagatedBuildInputs = with python3.pkgs; [
chardet
docutils
markdown
markups
pyenchant
pygments
pyqt5
];
2019-03-16 19:14:52 +00:00
postPatch = ''
# Remove wheel check
sed -i -e '31,36d' setup.py
'';
2019-03-16 19:14:52 +00:00
postInstall = ''
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;
}}"
)
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
'';
doCheck = false;
pythonImportsCheck = [
"ReText"
];
meta = with lib; {
description = "Editor for Markdown and reStructuredText";
homepage = "https://github.com/retext-project/retext/";
license = licenses.gpl2Plus;
2019-03-16 19:14:52 +00:00
maintainers = with maintainers; [ klntsky ];
platforms = platforms.unix;
};
}