2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python3, fetchpatch }:
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
self = py;
|
|
|
|
|
|
|
|
# not compatible with prompt_toolkit >=2.0
|
|
|
|
prompt_toolkit = super.prompt_toolkit.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
name = "${oldAttrs.pname}-${version}";
|
|
|
|
version = "1.0.18";
|
|
|
|
src = oldAttrs.src.override {
|
|
|
|
inherit version;
|
|
|
|
sha256 = "09h1153wgr5x2ny7ds0w2m81n3bb9j8hjb8sjfnrg506r01clkyx";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
with py.pkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "haxor-news";
|
2020-11-06 00:33:48 +00:00
|
|
|
version = "unstable-2020-10-20";
|
|
|
|
|
|
|
|
# haven't done a stable release in 3+ years, but actively developed
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "donnemartin";
|
|
|
|
repo = pname;
|
|
|
|
rev = "811a5804c09406465b2b02eab638c08bf5c4fa7f";
|
|
|
|
sha256 = "1g3dfsyk4727d9jh9w6j5r51ag07851cls7v7a7hmdvdixpvbzp6";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
colorama
|
|
|
|
requests
|
|
|
|
pygments
|
|
|
|
prompt_toolkit
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
# will fail without pre-seeded config files
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
checkInputs = [ mock ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover -s tests -v
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/donnemartin/haxor-news";
|
|
|
|
description = "Browse Hacker News like a haxor";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|