]> git.scottworley.com Git - paperdoorknob/blob - default.nix
Handle Unicode characters ≈ and ◁
[paperdoorknob] / default.nix
1 { pkgs ? import <nixpkgs> { }, lint ? false }:
2 pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, makeWrapper
3 , autopep8, mypy, pylint, beautifulsoup4, requests, requests-cache
4 , texliveFull, types-beautifulsoup4, types-requests, xdg-base-dirs
5 , pandoc-cli }:
6 buildPythonPackage rec {
7 pname = "paperdoorknob";
8 version = lib.removeSuffix "'" (lib.removePrefix "paperdoorknob_version = '"
9 (lib.fileContents ./version.py));
10 src = lib.cleanSource ./.;
11 nativeBuildInputs = [ makeWrapper ];
12 propagatedBuildInputs =
13 [ beautifulsoup4 requests requests-cache xdg-base-dirs ];
14 nativeCheckInputs =
15 [ mypy pandoc-cli texliveFull types-beautifulsoup4 types-requests ]
16 ++ lib.optionals lint [ autopep8 pylint ];
17 doCheck = true;
18 checkPhase = "./test.sh";
19 postInstall = ''
20 wrapProgram "$out/bin/paperdoorknob" \
21 --add-flags "--pandoc=${pandoc-cli}/bin/pandoc" \
22
23 '';
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 };
30 }) { inherit (pkgs.haskellPackages) pandoc-cli; }