X-Git-Url: http://git.scottworley.com/paperdoorknob/blobdiff_plain/136277e30143cd1219c896bb4980027ac3c6dbe1..9afdb32a9385204c13018198a136637ad599df47:/default.nix?ds=inline diff --git a/default.nix b/default.nix index bf96eb8..bb2d87e 100644 --- a/default.nix +++ b/default.nix @@ -1,21 +1,30 @@ { pkgs ? import { }, 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 + , texliveFull, types-beautifulsoup4, types-requests, xdg-base-dirs + , pandoc-cli }: buildPythonPackage rec { pname = "paperdoorknob"; - version = "0.0.1"; + version = lib.removeSuffix "'" (lib.removePrefix "paperdoorknob_version = '" + (lib.fileContents ./version.py)); src = lib.cleanSource ./.; + nativeBuildInputs = [ makeWrapper ]; propagatedBuildInputs = [ beautifulsoup4 requests requests-cache xdg-base-dirs ]; - nativeCheckInputs = [ mypy types-beautifulsoup4 types-requests ] + nativeCheckInputs = + [ mypy pandoc-cli texliveFull 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; }