2022-02-20 05:27:41 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
2022-12-02 08:20:57 +00:00
|
|
|
, fetchzip
|
2022-02-20 05:27:41 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
2022-12-02 08:20:57 +00:00
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, qtsvg
|
2022-02-20 05:27:41 +00:00
|
|
|
, buildEnv
|
|
|
|
, aspellDicts
|
|
|
|
# Use `lib.collect lib.isDerivation aspellDicts;` to make all dictionaries
|
|
|
|
# available.
|
2020-04-24 23:36:52 +00:00
|
|
|
, enchantAspellDicts ? with aspellDicts; [ en en-computers en-science ]
|
|
|
|
}:
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "retext";
|
2022-12-02 08:20:57 +00:00
|
|
|
version = "8.0.0";
|
2022-02-20 05:27:41 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "retext-project";
|
2022-12-02 08:20:57 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2022-12-02 08:20:57 +00:00
|
|
|
hash = "sha256-22yqNwIehgTfeElqhN5Jzye7LbcAiseTeoMgenpmsL0=";
|
|
|
|
};
|
|
|
|
|
|
|
|
toolbarIcons = fetchzip {
|
|
|
|
url = "https://github.com/retext-project/retext/archive/icons.zip";
|
|
|
|
hash = "sha256-LQtSFCGWcKvXis9pFDmPqAMd1m6QieHQiz2yykeTdnI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapQtAppsHook
|
2022-12-02 08:20:57 +00:00
|
|
|
qttools.dev
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
chardet
|
|
|
|
docutils
|
|
|
|
markdown
|
|
|
|
markups
|
|
|
|
pyenchant
|
|
|
|
pygments
|
2022-12-02 08:20:57 +00:00
|
|
|
pyqt6
|
|
|
|
pyqt6-webengine
|
2022-02-20 05:27:41 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
patches = [ ./remove-wheel-check.patch ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
lrelease ReText/locale/*.ts
|
2022-02-20 05:27:41 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
# prevent double wrapping
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2020-10-11 12:50:04 +00:00
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
|
|
|
makeWrapperArgs+=(
|
|
|
|
"--set" "ASPELL_CONF" "dict-dir ${buildEnv {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "aspell-all-dicts";
|
|
|
|
paths = map (path: "${path}/lib/aspell") enchantAspellDicts;
|
|
|
|
}}"
|
2020-10-11 12:50:04 +00:00
|
|
|
)
|
2021-03-23 19:22:30 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
cp ${toolbarIcons}/* $out/${python3.pkgs.python.sitePackages}/ReText/icons
|
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
substituteInPlace $out/share/applications/me.mitya57.ReText.desktop \
|
|
|
|
--replace "Exec=ReText-${version}.data/scripts/retext %F" "Exec=$out/bin/retext %F" \
|
2022-12-02 08:20:57 +00:00
|
|
|
--replace "Icon=ReText/icons/retext.svg" "Icon=retext"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"ReText"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-02-20 05:27:41 +00:00
|
|
|
description = "Editor for Markdown and reStructuredText";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/retext-project/retext/";
|
2022-12-02 08:20:57 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ klntsky ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|