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

72 lines
1.8 KiB
Nix
Raw Normal View History

2017-06-21 11:49:21 +01:00
{ gui ? true,
buildPythonPackage, fetchFromGitHub, lib,
sphinx, lxml, isodate, numpy, openpyxl,
tkinter ? null, py3to2, isPy3k, python,
2017-06-21 11:49:21 +01:00
... }:
2017-09-15 20:59:12 +01:00
buildPythonPackage rec {
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";
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 = [
sphinx
2017-09-14 19:28:29 +01:00
py3to2
2017-06-21 11:49:21 +01:00
];
propagatedBuildInputs = [
lxml
isodate
numpy
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
'' +
# 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
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";
homepage = "http://arelle.org/";
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [ roberth ];
2017-06-21 11:49:21 +01:00
};
}