2017-06-21 11:49:21 +01:00
|
|
|
{ gui ? true,
|
|
|
|
buildPythonPackage, fetchFromGitHub, lib,
|
2019-06-16 20:59:06 +01:00
|
|
|
sphinx, lxml, isodate, numpy, openpyxl,
|
2018-11-13 13:12:09 +00:00
|
|
|
tkinter ? null, py3to2, isPy3k, python,
|
2017-06-21 11:49:21 +01:00
|
|
|
... }:
|
|
|
|
|
2017-09-15 20:59:12 +01:00
|
|
|
buildPythonPackage rec {
|
2018-11-13 13:12:09 +00:00
|
|
|
pname = "arelle${lib.optionalString (!gui) "-headless"}";
|
|
|
|
version = "18.3";
|
2017-09-15 20:59:12 +01:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2017-06-21 11:49:21 +01:00
|
|
|
# Releases are published at http://arelle.org/download/ but sadly no
|
|
|
|
# tags are published on github.
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Arelle";
|
|
|
|
repo = "Arelle";
|
2018-11-13 13:12:09 +00:00
|
|
|
rev = "edgr${version}";
|
|
|
|
sha256 = "12a94ipdp6xalqyds7rcp6cjwps6fbj3byigzfy403hlqc9n1g33";
|
2017-06-21 11:49:21 +01:00
|
|
|
};
|
|
|
|
outputs = ["out" "doc"];
|
2017-09-15 20:59:12 +01:00
|
|
|
patches = [
|
|
|
|
./tests.patch
|
|
|
|
];
|
2017-06-21 11:49:21 +01:00
|
|
|
postPatch = "rm testParser2.py";
|
2019-02-17 11:07:40 +00:00
|
|
|
nativeBuildInputs = [
|
2018-11-13 13:12:09 +00:00
|
|
|
sphinx
|
2017-09-14 19:28:29 +01:00
|
|
|
py3to2
|
2017-06-21 11:49:21 +01:00
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
lxml
|
|
|
|
isodate
|
|
|
|
numpy
|
2018-11-13 13:12:09 +00:00
|
|
|
openpyxl
|
2019-02-17 11:07:40 +00:00
|
|
|
] ++ lib.optionals gui [
|
2017-06-21 11:49:21 +01:00
|
|
|
tkinter
|
|
|
|
];
|
|
|
|
|
|
|
|
# arelle-gui is useless without gui dependencies, so delete it when !gui.
|
|
|
|
postInstall = lib.optionalString (!gui) ''
|
|
|
|
find $out/bin -name "*arelle-gui*" -delete
|
2018-11-13 13:12:09 +00:00
|
|
|
'' +
|
|
|
|
# By default, not the entirety of the src dir is copied. This means we don't
|
|
|
|
# copy the `images` dir, which is needed for the gui version.
|
|
|
|
lib.optionalString (gui) ''
|
|
|
|
targetDir=$out/${python.sitePackages}
|
|
|
|
cp -vr $src/arelle $targetDir
|
2017-06-21 11:49:21 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Documentation
|
|
|
|
postBuild = ''
|
|
|
|
(cd apidocs && make html && cp -r _build $doc)
|
|
|
|
'';
|
|
|
|
|
2019-02-17 11:07:40 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
py.test
|
|
|
|
'';
|
2017-09-15 20:59:12 +01:00
|
|
|
|
2018-11-13 13:12:09 +00:00
|
|
|
meta = with lib; {
|
|
|
|
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";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://arelle.org/";
|
2018-11-13 13:12:09 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ roberth ];
|
2017-06-21 11:49:21 +01:00
|
|
|
};
|
|
|
|
}
|