about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/archivy/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/archivy/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/archivy/default.nix76
1 files changed, 54 insertions, 22 deletions
diff --git a/nixpkgs/pkgs/applications/misc/archivy/default.nix b/nixpkgs/pkgs/applications/misc/archivy/default.nix
index 0a89e4f47658..fd58ea48e554 100644
--- a/nixpkgs/pkgs/applications/misc/archivy/default.nix
+++ b/nixpkgs/pkgs/applications/misc/archivy/default.nix
@@ -1,23 +1,55 @@
-{ lib
-, buildPythonApplication
-, fetchPypi
-, appdirs
-, attrs
-, beautifulsoup4
-, click-plugins
-, elasticsearch
-, flask-compress
-, flask_login
-, flask_wtf
-, html2text
-, python-dotenv
-, python-frontmatter
-, requests
-, tinydb
-, validators
-, werkzeug
-, wtforms
-}:
+{ lib, stdenv, python3, fetchPypi }:
+
+let
+  defaultOverrides = [
+    (self: super: {
+      flask = super.flask.overridePythonAttrs (oldAttrs: rec {
+        version = "1.1.2";
+        pname = "Flask";
+
+        src = super.fetchPypi {
+          inherit pname version;
+          sha256 = "sha256-Tvoa4tfJhlr0iYbeiuuFBL8yx/PW/ck1PTSyH0sScGA=";
+        };
+
+        checkInputs = [ self.pytest ];
+        propagatedBuildInputs = with self; [ itsdangerous click werkzeug jinja2 ];
+
+        doCheck = false;
+      });
+    })
+
+    (self: super: {
+      flask_login = super.flask_login.overridePythonAttrs (oldAttrs: rec {
+        pname = "Flask";
+        version = "0.5.0";
+
+        src = fetchPypi {
+          inherit pname version;
+          sha256 = "6d33aef15b5bcead780acc339464aae8a6e28f13c90d8b1cf9de8b549d1c0b4b";
+        };
+        doCheck = false;
+      });
+    })
+  ];
+
+  mkOverride = attrname: version: sha256:
+    self: super: {
+      ${attrname} = super.${attrname}.overridePythonAttrs (oldAttrs: {
+        inherit version;
+        src = oldAttrs.src.override {
+          inherit version sha256;
+        };
+      });
+    };
+
+  py = python3.override {
+    # Put packageOverrides at the start so they are applied after defaultOverrides
+    packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) (defaultOverrides);
+  };
+
+in
+with py.pkgs;
 
 buildPythonApplication rec {
   pname = "archivy";
@@ -40,8 +72,7 @@ buildPythonApplication rec {
       --replace 'validators ==' 'validators >=' \
       --replace 'tinydb ==' 'tinydb >=' \
       --replace 'Flask_WTF == 0.14.3' 'Flask_WTF' \
-      --replace 'Werkzeug ==' 'Werkzeug >=' \
-      --replace 'Flask ==' 'Flask >='
+      --replace 'Werkzeug ==' 'Werkzeug >='
   '';
 
   propagatedBuildInputs = [
@@ -57,6 +88,7 @@ buildPythonApplication rec {
     python-dotenv
     python-frontmatter
     requests
+    setuptools
     tinydb
     validators
     werkzeug