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