From a2895b9084a8531f072b05e59b7099202af07044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Jos=C3=A9=20Ruiz-Henestrosa=20Ruiz?= Date: Fri, 3 Nov 2017 22:40:44 +0100 Subject: [PATCH 1/2] fava: changed SHA256 hash and version --- pkgs/applications/office/fava/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/office/fava/default.nix b/pkgs/applications/office/fava/default.nix index 7bc549dd0fc5..5fe20d80857a 100644 --- a/pkgs/applications/office/fava/default.nix +++ b/pkgs/applications/office/fava/default.nix @@ -1,14 +1,14 @@ { stdenv, pkgs, fetchurl, python3Packages, fetchFromGitHub, fetchzip, python3, beancount }: python3Packages.buildPythonApplication rec { - version = "1.3"; + version = "1.5"; name = "fava-${version}"; src = fetchFromGitHub { owner = "beancount"; repo = "fava"; rev = "v${version}"; - sha256 = "0g0aj0qcmpny6dipi00nks7h3mf5a4jfd6bxjm1rb5807wswcpg8"; + sha256 = "03wgggc2lzma1d57l1l4z8q7dsqxlg90alg2p1734jhavskfqw63"; }; assets = fetchzip { From 15ea14e5bf7f7aec0624e3a79687199592185093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Jos=C3=A9=20Ruiz-Henestrosa=20Ruiz?= Date: Fri, 3 Nov 2017 23:49:58 +0100 Subject: [PATCH 2/2] fava: 1.3 -> 1.5, refactor --- pkgs/applications/office/fava/default.nix | 42 +++++++---------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/pkgs/applications/office/fava/default.nix b/pkgs/applications/office/fava/default.nix index 5fe20d80857a..56a93e990095 100644 --- a/pkgs/applications/office/fava/default.nix +++ b/pkgs/applications/office/fava/default.nix @@ -1,42 +1,26 @@ -{ stdenv, pkgs, fetchurl, python3Packages, fetchFromGitHub, fetchzip, python3, beancount }: +{ stdenv, python3, beancount }: -python3Packages.buildPythonApplication rec { +let + inherit (python3.pkgs) buildPythonApplication fetchPypi; +in +buildPythonApplication rec { + pname = "fava"; version = "1.5"; - name = "fava-${version}"; + name = "${pname}-${version}"; - src = fetchFromGitHub { - owner = "beancount"; - repo = "fava"; - rev = "v${version}"; - sha256 = "03wgggc2lzma1d57l1l4z8q7dsqxlg90alg2p1734jhavskfqw63"; + src = fetchPypi { + inherit pname version; + sha256 = "0d3jncidzvfsxjplzg4cmflqr4mxrbrlj5bh6fpxj529pialpkk6"; }; - assets = fetchzip { - url = "https://github.com/beancount/fava/releases/download/v${version}/fava-${version}.tar.gz"; - sha256 = "0yn2psbn436g1w5ixn94z8ca6dfd54izg98979arn0k7slpiccvz"; - }; + doCheck = false; - checkInputs = with python3Packages; [ pytest ]; - - checkPhase = '' - # pyexcel is optional - # the other 2 tests fail due non-unicode locales - PATH=$out/bin:$PATH pytest tests \ - --ignore tests/test_util_excel.py \ - --ignore tests/test_cli.py \ - --ignore tests/test_translations.py \ - ''; - - postInstall = '' - cp -r $assets/fava/static/gen $out/${python3.sitePackages}/fava/static - ''; - - propagatedBuildInputs = with python3Packages; + propagatedBuildInputs = with python3.pkgs; [ flask dateutil pygments wheel markdown2 flaskbabel tornado click beancount ]; meta = { - homepage = https://github.com/aumayr/fava; + homepage = https://beancount.github.io/fava; description = "Web interface for beancount"; license = stdenv.lib.licenses.mit; maintainers = with stdenv.lib.maintainers; [ matthiasbeyer ];