2022-02-14 18:40:48 +01:00
|
|
|
{ lib
|
|
|
|
, python3
|
2022-10-15 12:43:51 +02:00
|
|
|
, fetchzip
|
2022-02-14 18:40:48 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
2022-10-15 12:43:51 +02:00
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, qtsvg
|
2022-02-14 18:40:48 +01:00
|
|
|
, 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 ]
|
|
|
|
}:
|
|
|
|
|
2022-02-14 18:40:48 +01:00
|
|
|
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";
|
2022-02-14 18:40:48 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2022-02-14 18:40:48 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapQtAppsHook
|
2022-10-15 12:43:51 +02:00
|
|
|
qttools.dev
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
2022-02-14 18:40:48 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
chardet
|
|
|
|
docutils
|
|
|
|
markdown
|
|
|
|
markups
|
|
|
|
pyenchant
|
|
|
|
pygments
|
2022-10-15 12:43:51 +02:00
|
|
|
pyqt6
|
|
|
|
pyqt6-webengine
|
2022-02-14 18:40:48 +01:00
|
|
|
];
|
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
|
2022-02-14 18:40:48 +01:00
|
|
|
'';
|
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 = ''
|
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
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2022-02-14 18:40:48 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"ReText"
|
|
|
|
];
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2022-02-14 18:40:48 +01:00
|
|
|
description = "Editor for Markdown and reStructuredText";
|
2020-04-01 03:11:51 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|