1{ gui ? true,
2 buildPythonPackage, fetchFromGitHub, lib,
3 sphinx_1_2, lxml, isodate, numpy, pytest,
4 tkinter ? null, py3to2, isPy34,
5 ... }:
6
7buildPythonPackage rec {
8 name = "arelle-${version}${lib.optionalString (!gui) "-headless"}";
9 version = "2017-08-24";
10
11 disabled = !isPy34;
12
13 # Releases are published at http://arelle.org/download/ but sadly no
14 # tags are published on github.
15 src = fetchFromGitHub {
16 owner = "Arelle";
17 repo = "Arelle";
18 rev = "cb24e35d57b562a864ae3dd4542c4d9fcf3865fe";
19 sha256 = "1sbvhb3xlfnyvf1xj9dxwpcrfiaf7ikkdwvvap7aaxfxgiz85ip2";
20 };
21 outputs = ["out" "doc"];
22 patches = [
23 ./tests.patch
24 ];
25 postPatch = "rm testParser2.py";
26 buildInputs = [
27 sphinx_1_2
28 pytest
29 py3to2
30 ];
31 propagatedBuildInputs = [
32 lxml
33 isodate
34 numpy
35 ] ++ lib.optional gui [
36 tkinter
37 ];
38
39 # arelle-gui is useless without gui dependencies, so delete it when !gui.
40 postInstall = lib.optionalString (!gui) ''
41 find $out/bin -name "*arelle-gui*" -delete
42 '';
43
44 # Documentation
45 postBuild = ''
46 (cd apidocs && make html && cp -r _build $doc)
47 '';
48
49 doCheck = if gui then true else false;
50
51 meta = {
52 description = "An open source facility for XBRL, the eXtensible Business Reporting Language supporting various standards, exposed through a python or REST API" + lib.optionalString gui " and a graphical user interface";
53 homepage = http://arelle.org/;
54 license = lib.licenses.asl20;
55 platforms = lib.platforms.all;
56 maintainers = with lib.maintainers; [ roberth ];
57 };
58}