diff --git a/pkgs/by-name/co/comic-mandown/package.nix b/pkgs/by-name/co/comic-mandown/package.nix new file mode 100644 index 000000000000..1e08eb28cb45 --- /dev/null +++ b/pkgs/by-name/co/comic-mandown/package.nix @@ -0,0 +1,17 @@ +{ lib +, python3Packages +, fetchFromGitHub + +, withGUI ? true +}: +let + mandown' = python3Packages.mandown.overrideAttrs (prev: { + propagatedBuildInputs = prev.propagatedBuildInputs ++ lib.optionals withGUI prev.passthru.optional-dependencies.gui; + }); + mandownApp = python3Packages.toPythonApplication mandown'; +in +mandownApp // { + meta = mandownApp.meta // { + mainProgram = "mandown"; + }; +} diff --git a/pkgs/development/python-modules/comicon/default.nix b/pkgs/development/python-modules/comicon/default.nix new file mode 100644 index 000000000000..8d69ae0fc744 --- /dev/null +++ b/pkgs/development/python-modules/comicon/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, ebooklib +, lxml +, pillow +, pypdf +}: + +buildPythonPackage rec { + pname = "comicon"; + version = "1.0.0"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "potatoeggy"; + repo = "comicon"; + rev = "v${version}"; + hash = "sha256-D6nK+GlcG/XqMTH7h7mJcbZCRG2xDHRsnooSTtphDNs="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + ebooklib + lxml + pillow + pypdf + ]; + + pythonImportsCheck = [ "comicon" ]; + + meta = with lib; { + description = "Lightweight comic converter library between CBZ, PDF, and EPUB"; + homepage = "https://github.com/potatoeggy/comicon"; + license = licenses.agpl3Only; + maintainers = with maintainers; [ Scrumplex ]; + }; +} diff --git a/pkgs/development/python-modules/ebooklib/default.nix b/pkgs/development/python-modules/ebooklib/default.nix new file mode 100644 index 000000000000..63ea0b4d06d2 --- /dev/null +++ b/pkgs/development/python-modules/ebooklib/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, lxml +, six +}: + +buildPythonPackage rec { + pname = "ebooklib"; + version = "0.18"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "aerkalov"; + repo = "ebooklib"; + rev = "v${version}"; + hash = "sha256-Ciks/eeRpkqkWnyLgyHC+x/dSOcj/ZT45KUElKqv1F8="; + }; + + propagatedBuildInputs = [ + lxml + six + ]; + + pythonImportsCheck = [ "ebooklib" ]; + + meta = with lib; { + description = "Python E-book library for handling books in EPUB2/EPUB3 format"; + homepage = "https://github.com/aerkalov/ebooklib"; + changelog = "https://github.com/aerkalov/ebooklib/blob/${src.rev}/CHANGES.txt"; + license = licenses.agpl3Only; + maintainers = with maintainers; [ Scrumplex ]; + }; +} diff --git a/pkgs/development/python-modules/mandown/default.nix b/pkgs/development/python-modules/mandown/default.nix new file mode 100644 index 000000000000..fd699821f6da --- /dev/null +++ b/pkgs/development/python-modules/mandown/default.nix @@ -0,0 +1,65 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, beautifulsoup4 +, comicon +, feedparser +, filetype +, lxml +, natsort +, pillow +, python-slugify +, requests +, typer +, pyside6 +}: + +buildPythonPackage rec { + pname = "mandown"; + version = "1.5.0"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "potatoeggy"; + repo = "mandown"; + rev = "v${version}"; + hash = "sha256-ph+1bb1jhqqDE2d4F8lTf7LAzN7DWpDTGn8qhCiccKA="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + beautifulsoup4 + comicon + feedparser + filetype + lxml + natsort + pillow + python-slugify + requests + typer + ]; + + passthru.optional-dependencies = { + gui = [ + pyside6 + ]; + }; + + postPatch = '' + substituteInPlace pyproject.toml --replace 'typer = "^0.7.0"' 'typer = "^0"' + ''; + + pythonImportsCheck = [ "mandown" ]; + + meta = with lib; { + description = "Comic/manga/webtoon downloader and CBZ/EPUB/MOBI/PDF converter"; + homepage = "https://github.com/potatoeggy/mandown"; + license = licenses.agpl3Only; + maintainers = with maintainers; [ Scrumplex ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3f4f38ebe0af..4eb7a58cd7e9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1825,6 +1825,8 @@ self: super: with self; { inherit (pkgs) secp256k1; }; + comicon = callPackage ../development/python-modules/comicon { }; + connect-box = callPackage ../development/python-modules/connect_box { }; connection-pool = callPackage ../development/python-modules/connection-pool { }; @@ -3354,6 +3356,8 @@ self: super: with self; { ebaysdk = callPackage ../development/python-modules/ebaysdk { }; + ebooklib = callPackage ../development/python-modules/ebooklib { }; + ec2instanceconnectcli = callPackage ../tools/virtualization/ec2instanceconnectcli { }; eccodes = toPythonModule (pkgs.eccodes.override { @@ -6433,6 +6437,8 @@ self: super: with self; { managesieve = callPackage ../development/python-modules/managesieve { }; + mandown = callPackage ../development/python-modules/mandown { }; + manhole = callPackage ../development/python-modules/manhole { }; manimpango = callPackage ../development/python-modules/manimpango {