@@ -1,17 +1,26 @@
1−{ buildPythonApplication
1+{ stdenv
22, lib
3+, buildPythonApplication
34, fetchFromGitHub
45, dateutil
5−, pyyaml
6+, pandas
7+, requests
8+, lxml
69, openpyxl
710, xlrd
811, h5py
9−, fonttools
10−, lxml
11−, pandas
12+, psycopg2
1213, pyshp
14+, fonttools
15+, pyyaml
16+, pdfminer
17+, vobject
18+, tabulate
19+, wcwidth
20+, zstandard
1321, setuptools
14−, withPcap ? true, dpkt ? null, dnslib ? null
22+, git
23+, withPcap ? true, dpkt, dnslib
1524}:
1625buildPythonApplication rec {
1726 pname = "visidata";
@@ -25,19 +34,62 @@ buildPythonApplication rec {
2534 };
2635
2736 propagatedBuildInputs = [
37+ # from visidata/requirements.txt
38+ # packages not (yet) present in nixpkgs are commented
2839 dateutil
29− pyyaml
40+ pandas
41+ requests
42+ lxml
3043 openpyxl
3144 xlrd
3245 h5py
33− fonttools
34− lxml
35− pandas
46+ psycopg2
3647 pyshp
48+ #mapbox-vector-tile
49+ #pypng
50+ fonttools
51+ #sas7bdat
52+ #xport
53+ #savReaderWriter
54+ pyyaml
55+ #namestand
56+ #datapackage
57+ pdfminer
58+ #tabula
59+ vobject
60+ tabulate
61+ wcwidth
62+ zstandard
3763 setuptools
3864 ] ++ lib.optionals withPcap [ dpkt dnslib ];
3965
40− doCheck = false;
66+ checkInputs = [
67+ git
68+ ];
69+
70+ # check phase uses the output bin, which is not possible when cross-compiling
71+ doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
72+
73+ checkPhase = ''
74+ # disable some tests which require access to the network
75+ rm tests/load-http.vd # http
76+ rm tests/graph-cursor-nosave.vd # http
77+ rm tests/messenger-nosave.vd # dns
78+
79+ # disable some tests which expect Python == 3.6 (not our current version)
80+ # see https://github.com/saulpw/visidata/issues/1014
81+ rm tests/describe.vd
82+ rm tests/describe-error.vd
83+ rm tests/edit-type.vd
84+
85+ # tests use git to compare outputs to references
86+ git init -b "test-reference"
87+ git config user.name "nobody"; git config user.email "no@where"
88+ git add .; git commit -m "test reference"
89+
90+ substituteInPlace dev/test.sh --replace "bin/vd" "$out/bin/vd"
91+ bash dev/test.sh
92+ '';
4193
4294 meta = {
4395 inherit version;