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

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

93 lines
2.0 KiB
Nix
Raw Normal View History

{ lib
, python3
2022-10-15 10:43:51 +00:00
, fetchzip
, fetchFromGitHub
, wrapQtAppsHook
2022-10-15 10:43:51 +00:00
, qtbase
, qttools
, qtsvg
, 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";
2022-10-15 10:43:51 +00:00
version = "8.0.0";
format = "setuptools";
2019-03-16 19:14:52 +00:00
src = fetchFromGitHub {
owner = "retext-project";
2022-10-15 10:43:51 +00:00
repo = pname;
2019-09-08 23:38:31 +00:00
rev = version;
2022-10-15 10:43:51 +00:00
hash = "sha256-22yqNwIehgTfeElqhN5Jzye7LbcAiseTeoMgenpmsL0=";
};
toolbarIcons = fetchzip {
url = "https://github.com/retext-project/retext/archive/icons.zip";
hash = "sha256-LQtSFCGWcKvXis9pFDmPqAMd1m6QieHQiz2yykeTdnI=";
2019-03-16 19:14:52 +00:00
};
nativeBuildInputs = [
wrapQtAppsHook
2022-10-15 10:43:51 +00:00
qttools.dev
];
buildInputs = [
qtbase
qtsvg
];
propagatedBuildInputs = with python3.pkgs; [
chardet
docutils
markdown
markups
pyenchant
pygments
2022-10-15 10:43:51 +00:00
pyqt6
pyqt6-webengine
];
2019-03-16 19:14:52 +00:00
2022-10-15 10:43:51 +00:00
patches = [ ./remove-wheel-check.patch ];
preConfigure = ''
lrelease ReText/locale/*.ts
'';
2019-03-16 19:14:52 +00:00
2022-10-15 10:43:51 +00:00
# prevent double wrapping
dontWrapQtApps = true;
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
2022-10-15 10:43:51 +00:00
cp ${toolbarIcons}/* $out/${python3.pkgs.python.sitePackages}/ReText/icons
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" \
2022-10-15 10:43:51 +00:00
--replace "Icon=ReText/icons/retext.svg" "Icon=retext"
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/";
2022-10-15 10:43:51 +00:00
license = licenses.gpl3Plus;
2019-03-16 19:14:52 +00:00
maintainers = with maintainers; [ klntsky ];
platforms = platforms.unix;
};
}