From e14ce3e49a81d93869b47e2c7a72d5ce4d5f6d59 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Wed, 19 Jan 2022 16:50:00 -0800 Subject: buku: make bukuserver optional bukuserver (an optional web GUI frontend for buku) depends on a large number of flask packages, which break in nixpkgs very often. --- pkgs/applications/misc/buku/default.nix | 39 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'pkgs/applications/misc/buku/default.nix') diff --git a/pkgs/applications/misc/buku/default.nix b/pkgs/applications/misc/buku/default.nix index e8b8714ca2ab5..1be8bc76ba63b 100644 --- a/pkgs/applications/misc/buku/default.nix +++ b/pkgs/applications/misc/buku/default.nix @@ -1,4 +1,4 @@ -{ lib, python3, fetchFromGitHub }: +{ lib, python3, fetchFromGitHub, withServer ? false }: let python3' = python3.override { @@ -19,6 +19,21 @@ let }); }; }; + serverRequire = with python3'.pkgs; [ + requests + flask + flask-admin + flask-api + flask-bootstrap + flask-paginate + flask-reverse-proxy-fix + flask_wtf + arrow + werkzeug + click + vcrpy + toml + ]; in with python3'.pkgs; buildPythonApplication rec { version = "4.6"; @@ -40,27 +55,16 @@ with python3'.pkgs; buildPythonApplication rec { flake8 pyyaml mypy-extensions + click ]; propagatedBuildInputs = [ cryptography beautifulsoup4 - requests + certifi urllib3 - flask - flask-admin - flask-api - flask-bootstrap - flask-paginate - flask-reverse-proxy-fix - flask_wtf - arrow - werkzeug - click html5lib - vcrpy - toml - ]; + ] ++ lib.optionals withServer serverRequire; postPatch = '' # Jailbreak problematic dependencies @@ -80,6 +84,8 @@ with python3'.pkgs; buildPythonApplication rec { --replace "self.assertEqual(url, \"https://www.google.com\")" "" substituteInPlace setup.py \ --replace mypy-extensions==0.4.1 mypy-extensions>=0.4.1 + '' + lib.optionalString (!withServer) '' + rm tests/test_{server,views}.py ''; postInstall = '' @@ -89,6 +95,8 @@ with python3'.pkgs; buildPythonApplication rec { cp auto-completion/zsh/* $out/share/zsh/site-functions cp auto-completion/bash/* $out/share/bash-completion/completions cp auto-completion/fish/* $out/share/fish/vendor_completions.d + '' + lib.optionalString (!withServer) '' + rm $out/bin/bukuserver ''; meta = with lib; { @@ -99,4 +107,3 @@ with python3'.pkgs; buildPythonApplication rec { maintainers = with maintainers; [ matthiasbeyer infinisil ma27 ]; }; } - -- cgit 1.4.1