From a188dc9c6ee79a0c431a8676da12c103a6b934e4 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Fri, 25 Feb 2022 13:31:45 +0100 Subject: [PATCH] terminal-life: add python-wiki-fetch --- modules/terminal-life/default.nix | 1 + overlays/python-wiki-fetch.nix | 26 +++++++++++++++++++++++++ overlays/python-wiki-fetch.patch | 32 +++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 overlays/python-wiki-fetch.nix create mode 100644 overlays/python-wiki-fetch.patch diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix index c253c4bd..d32546f0 100644 --- a/modules/terminal-life/default.nix +++ b/modules/terminal-life/default.nix @@ -35,6 +35,7 @@ in mdbook-multilang nnn powerline + python-wiki-fetch vifm watson ]; diff --git a/overlays/python-wiki-fetch.nix b/overlays/python-wiki-fetch.nix new file mode 100644 index 00000000..2b20e95c --- /dev/null +++ b/overlays/python-wiki-fetch.nix @@ -0,0 +1,26 @@ +final: prev: with prev.python39Packages; { + python-wiki-fetch = buildPythonPackage rec { + pname = "fetch"; + version = "unstable-2022-02-25"; + + src = prev.fetchFromGitHub { + owner = "yashsinghcodes"; + repo = "fetch"; + rev = "3a490a2c2f0b6d2491397fe77939e850056963fd"; + sha256 = "sha256-VsZ8YEXZOIf3UbPmJSn84DYaINavLXCzC0nUOqkvOh4="; + }; + + checkPhase = '' + cd test + ${python.interpreter} test.py + ''; + + propagatedBuildInputs = [ + beautifulsoup4 + requests + wheel + ]; + + patches = ./python-wiki-fetch.patch; + }; +} diff --git a/overlays/python-wiki-fetch.patch b/overlays/python-wiki-fetch.patch new file mode 100644 index 00000000..09bb13a4 --- /dev/null +++ b/overlays/python-wiki-fetch.patch @@ -0,0 +1,32 @@ +--- a/setup.py ++++ b/setup.py +@@ -3,13 +3,6 @@ from os import name, path + from sys import version + import setuptools + +-req_pkgs = [ +- 'bs4', +- 'requests', +- 'wheel' +-] +- +- + with open("README.md","r") as f: + long_description = f.read() + +@@ -25,7 +18,7 @@ setuptools.setup( + packages = setuptools.find_packages(), + entry_points={ + 'console_scripts': [ +- 'fetch=fetch.fetch:arguments', ++ 'wiki=fetch.fetch:arguments', + ] + }, + python_requires='>=3.*', +@@ -36,6 +29,4 @@ setuptools.setup( + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + ], +- install_requires=req_pkgs, +- setup_requires=req_pkgs, + )