]> git.scottworley.com Git - paperdoorknob/blame - default.nix
Rename html → dom
[paperdoorknob] / default.nix
CommitLineData
92b11a10 1{ pkgs ? import <nixpkgs> { }, lint ? false }:
1e512629
SW
2pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, makeWrapper
3 , autopep8, mypy, pylint, beautifulsoup4, requests, requests-cache
8d583d5b 4 , texliveFull, types-beautifulsoup4, types-requests, xdg-base-dirs
07f9b178 5 , pandoc-cli }:
92b11a10
SW
6 buildPythonPackage rec {
7 pname = "paperdoorknob";
681c2bd0
SW
8 version = lib.removeSuffix "'" (lib.removePrefix "paperdoorknob_version = '"
9 (lib.fileContents ./version.py));
92b11a10 10 src = lib.cleanSource ./.;
1e512629 11 nativeBuildInputs = [ makeWrapper ];
136277e3
SW
12 propagatedBuildInputs =
13 [ beautifulsoup4 requests requests-cache xdg-base-dirs ];
07f9b178 14 nativeCheckInputs =
8d583d5b 15 [ mypy pandoc-cli texliveFull types-beautifulsoup4 types-requests ]
b25a2f90 16 ++ lib.optionals lint [ autopep8 pylint ];
92b11a10
SW
17 doCheck = true;
18 checkPhase = "./test.sh";
1e512629
SW
19 postInstall = ''
20 wrapProgram "$out/bin/paperdoorknob" \
21 --add-flags "--pandoc=${pandoc-cli}/bin/pandoc" \
22
23 '';
92b11a10
SW
24 meta = {
25 description = "A polite glowfic → printable book scraper.";
26 homepage = "https://git.scottworley.com/paperdoorknob";
27 license = pkgs.lib.licenses.gpl3;
28 maintainers = with pkgs.lib.maintainers; [ chkno ];
29 };
1e512629 30 }) { inherit (pkgs.haskellPackages) pandoc-cli; }