rss2email: modernize, move to pkgs/by-name (#424463)

This commit is contained in:
Aleksana 2025-07-15 22:36:22 +08:00 committed by GitHub
commit 7c257e66bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 22 deletions

View File

@ -1,23 +1,15 @@
{ {
lib, lib,
pythonPackages, python3Packages,
fetchPypi, fetchPypi,
fetchpatch2, fetchpatch2,
nixosTests, nixosTests,
}: }:
with pythonPackages; python3Packages.buildPythonApplication rec {
buildPythonApplication rec {
pname = "rss2email"; pname = "rss2email";
version = "3.14"; version = "3.14";
format = "setuptools"; pyproject = true;
propagatedBuildInputs = [
feedparser
html2text
];
nativeCheckInputs = [ beautifulsoup4 ];
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
@ -30,6 +22,11 @@ buildPythonApplication rec {
url = "https://github.com/rss2email/rss2email/commit/b5c0e78006c2db6929b5ff50e8529de58a00412a.patch"; url = "https://github.com/rss2email/rss2email/commit/b5c0e78006c2db6929b5ff50e8529de58a00412a.patch";
hash = "sha256-edmsi3I0acx5iF9xoAS9deSexqW2UtWZR/L7CgeZs/M="; hash = "sha256-edmsi3I0acx5iF9xoAS9deSexqW2UtWZR/L7CgeZs/M=";
}) })
(fetchpatch2 {
name = "use-poetry-core.patch";
url = "https://github.com/rss2email/rss2email/commit/183a17aefe4eb66f898cf088519b1e845559f2bd.patch";
hash = "sha256-SoWahlOJ7KkaHMwOrKIBgwEz8zJQrSXVD1w2wiV1phE=";
})
]; ];
outputs = [ outputs = [
@ -40,10 +37,19 @@ buildPythonApplication rec {
postPatch = '' postPatch = ''
# sendmail executable is called from PATH instead of sbin by default # sendmail executable is called from PATH instead of sbin by default
sed -e 's|/usr/sbin/sendmail|sendmail|' \ substituteInPlace rss2email/config.py \
-i rss2email/config.py --replace-fail '/usr/sbin/sendmail' 'sendmail'
''; '';
build-system = with python3Packages; [
poetry-core
];
dependencies = with python3Packages; [
feedparser
html2text
];
postInstall = '' postInstall = ''
install -Dm 644 r2e.1 $man/share/man/man1/r2e.1 install -Dm 644 r2e.1 $man/share/man/man1/r2e.1
# an alias for better finding the manpage # an alias for better finding the manpage
@ -54,11 +60,14 @@ buildPythonApplication rec {
cp AUTHORS COPYING CHANGELOG README.rst $doc/share/doc/rss2email/ cp AUTHORS COPYING CHANGELOG README.rst $doc/share/doc/rss2email/
''; '';
checkPhase = '' nativeCheckInputs = [
runHook preCheck python3Packages.unittestCheckHook
env PATH=$out/bin:$PATH python ./test/test.py ];
runHook postCheck
''; unittestFlagsArray = [
"-s"
"test"
];
meta = with lib; { meta = with lib; {
description = "Tool that converts RSS/Atom newsfeeds to email"; description = "Tool that converts RSS/Atom newsfeeds to email";

View File

@ -4287,10 +4287,6 @@ with pkgs;
rsibreak = libsForQt5.callPackage ../applications/misc/rsibreak { }; rsibreak = libsForQt5.callPackage ../applications/misc/rsibreak { };
rss2email = callPackage ../applications/networking/feedreaders/rss2email {
pythonPackages = python3Packages;
};
rucio = callPackage ../by-name/ru/rucio/package.nix { rucio = callPackage ../by-name/ru/rucio/package.nix {
# Pinned to python 3.12 while python313Packages.future does not evaluate and # Pinned to python 3.12 while python313Packages.future does not evaluate and
# until https://github.com/CZ-NIC/pyoidc/issues/649 is resolved # until https://github.com/CZ-NIC/pyoidc/issues/649 is resolved