{ pkgs ? import <nixpkgs> { }, lint ? false }:
-pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, autopep8, mypy
- , pylint, beautifulsoup4, requests, requests-cache, types-beautifulsoup4
- , types-requests, xdg-base-dirs }:
+pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, makeWrapper
+ , autopep8, mypy, pylint, beautifulsoup4, requests, requests-cache
+ , types-beautifulsoup4, types-requests, xdg-base-dirs, pandoc-cli }:
buildPythonPackage rec {
pname = "paperdoorknob";
version = "0.0.1";
src = lib.cleanSource ./.;
+ nativeBuildInputs = [ makeWrapper ];
propagatedBuildInputs =
[ beautifulsoup4 requests requests-cache xdg-base-dirs ];
nativeCheckInputs = [ mypy types-beautifulsoup4 types-requests ]
++ lib.optionals lint [ autopep8 pylint ];
doCheck = true;
checkPhase = "./test.sh";
+ postInstall = ''
+ wrapProgram "$out/bin/paperdoorknob" \
+ --add-flags "--pandoc=${pandoc-cli}/bin/pandoc" \
+
+ '';
meta = {
description = "A polite glowfic → printable book scraper.";
homepage = "https://git.scottworley.com/paperdoorknob";
license = pkgs.lib.licenses.gpl3;
maintainers = with pkgs.lib.maintainers; [ chkno ];
};
- }) { }
+ }) { inherit (pkgs.haskellPackages) pandoc-cli; }
help='The filename stem at which to write output ' +
'(eg: "%(default)s" produces %(default)s.text, %(default)s.pdf, etc.)',
default='book')
+ parser.add_argument('--pandoc', help='Location of the pandoc executable')
parser.add_argument(
'--timeout',
help='How long to wait for HTTP requests, in seconds',