nixpkgs/pkgs/development/python-modules/arelle/default.nix

69 lines
1.8 KiB
Nix
Raw Normal View History

2017-06-21 10:49:21 +00:00
{ gui ? true,
buildPythonPackage, fetchFromGitHub, lib,
sphinx, lxml, isodate, numpy, pytest, openpyxl,
tkinter ? null, py3to2, isPy3k, python,
2017-06-21 10:49:21 +00:00
... }:
2017-09-15 19:59:12 +00:00
buildPythonPackage rec {
pname = "arelle${lib.optionalString (!gui) "-headless"}";
version = "18.3";
2017-09-15 19:59:12 +00:00
disabled = !isPy3k;
2017-06-21 10:49:21 +00:00
# Releases are published at http://arelle.org/download/ but sadly no
# tags are published on github.
src = fetchFromGitHub {
owner = "Arelle";
repo = "Arelle";
rev = "edgr${version}";
sha256 = "12a94ipdp6xalqyds7rcp6cjwps6fbj3byigzfy403hlqc9n1g33";
2017-06-21 10:49:21 +00:00
};
outputs = ["out" "doc"];
2017-09-15 19:59:12 +00:00
patches = [
./tests.patch
];
2017-06-21 10:49:21 +00:00
postPatch = "rm testParser2.py";
buildInputs = [
sphinx
2017-06-21 10:49:21 +00:00
pytest
2017-09-14 18:28:29 +00:00
py3to2
2017-06-21 10:49:21 +00:00
];
propagatedBuildInputs = [
lxml
isodate
numpy
openpyxl
2017-06-21 10:49:21 +00:00
] ++ lib.optional gui [
tkinter
];
# arelle-gui is useless without gui dependencies, so delete it when !gui.
postInstall = lib.optionalString (!gui) ''
find $out/bin -name "*arelle-gui*" -delete
'' +
# 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 10:49:21 +00:00
'';
# Documentation
postBuild = ''
(cd apidocs && make html && cp -r _build $doc)
'';
2017-09-15 19:59:12 +00:00
doCheck = if gui then true else false;
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";
2017-06-21 10:49:21 +00:00
homepage = http://arelle.org/;
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [ roberth ];
2017-06-21 10:49:21 +00:00
};
}