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

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

94 lines
2.1 KiB
Nix
Raw Permalink Normal View History

{ lib
, python3
2022-10-15 12:43:51 +02:00
, fetchzip
, fetchFromGitHub
, wrapQtAppsHook
2022-10-15 12:43:51 +02:00
, qtbase
, qttools
, qtsvg
, buildEnv
, aspellDicts
# Use `lib.collect lib.isDerivation aspellDicts;` to make all dictionaries
# available.
2019-03-16 20:14:52 +01:00
, enchantAspellDicts ? with aspellDicts; [ en en-computers en-science ]
}:
python3.pkgs.buildPythonApplication rec {
2019-03-16 20:14:52 +01:00
pname = "retext";
2024-03-19 15:55:38 +01:00
version = "8.0.2";
format = "setuptools";
2019-03-16 20:14:52 +01:00
src = fetchFromGitHub {
owner = "retext-project";
2022-10-15 12:43:51 +02:00
repo = pname;
2024-01-12 03:40:54 +01:00
rev = "refs/tags/${version}";
2024-03-19 15:55:38 +01:00
hash = "sha256-BToW9rPFEbgAErvJ5gtUpNadCLtlRihE7eKKFgO5N68=";
2022-10-15 12:43:51 +02:00
};
toolbarIcons = fetchzip {
url = "https://github.com/retext-project/retext/archive/icons.zip";
hash = "sha256-LQtSFCGWcKvXis9pFDmPqAMd1m6QieHQiz2yykeTdnI=";
2019-03-16 20:14:52 +01:00
};
nativeBuildInputs = [
wrapQtAppsHook
2022-10-15 12:43:51 +02:00
qttools.dev
];
buildInputs = [
qtbase
qtsvg
];
propagatedBuildInputs = with python3.pkgs; [
chardet
docutils
markdown
markups
pyenchant
pygments
2022-10-15 12:43:51 +02:00
pyqt6
pyqt6-webengine
];
2019-03-16 20:14:52 +01:00
2022-10-15 12:43:51 +02:00
patches = [ ./remove-wheel-check.patch ];
preConfigure = ''
lrelease ReText/locale/*.ts
'';
2019-03-16 20:14:52 +01:00
2022-10-15 12:43:51 +02:00
# prevent double wrapping
dontWrapQtApps = true;
2019-03-16 20:14:52 +01:00
postInstall = ''
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;
}}"
)
2021-02-09 16:33:33 +01:00
2022-10-15 12:43:51 +02:00
cp ${toolbarIcons}/* $out/${python3.pkgs.python.sitePackages}/ReText/icons
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" \
2022-10-15 12:43:51 +02:00
--replace "Icon=ReText/icons/retext.svg" "Icon=retext"
2019-03-16 20:14:52 +01:00
'';
doCheck = false;
pythonImportsCheck = [
"ReText"
];
meta = with lib; {
description = "Editor for Markdown and reStructuredText";
homepage = "https://github.com/retext-project/retext/";
2022-10-15 12:43:51 +02:00
license = licenses.gpl3Plus;
2019-03-16 20:14:52 +01:00
maintainers = with maintainers; [ klntsky ];
platforms = platforms.unix;
2023-11-27 02:17:53 +01:00
mainProgram = "retext";
2019-03-16 20:14:52 +01:00
};
}