2021-06-16 02:01:11 +02:00
|
|
|
{ stdenv
|
2020-03-23 14:27:13 +01:00
|
|
|
, lib
|
2021-06-16 02:01:11 +02:00
|
|
|
, buildPythonApplication
|
2020-03-23 14:27:13 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, dateutil
|
2021-06-16 01:59:37 +02:00
|
|
|
, pandas
|
|
|
|
, requests
|
|
|
|
, lxml
|
2020-03-23 14:27:13 +01:00
|
|
|
, openpyxl
|
|
|
|
, xlrd
|
|
|
|
, h5py
|
2021-06-16 01:59:37 +02:00
|
|
|
, psycopg2
|
2020-03-23 14:27:13 +01:00
|
|
|
, pyshp
|
2021-06-16 01:59:37 +02:00
|
|
|
, fonttools
|
|
|
|
, pyyaml
|
|
|
|
, pdfminer
|
|
|
|
, vobject
|
|
|
|
, tabulate
|
|
|
|
, wcwidth
|
|
|
|
, zstandard
|
2020-03-23 14:27:13 +01:00
|
|
|
, setuptools
|
2021-06-16 02:01:11 +02:00
|
|
|
, git
|
2021-06-16 01:59:37 +02:00
|
|
|
, withPcap ? true, dpkt, dnslib
|
2018-10-23 11:00:00 +02:00
|
|
|
}:
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "visidata";
|
2021-05-09 10:49:52 +02:00
|
|
|
version = "2.4";
|
2018-10-23 11:00:00 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "saulpw";
|
|
|
|
repo = "visidata";
|
|
|
|
rev = "v${version}";
|
2021-05-09 10:49:52 +02:00
|
|
|
sha256 = "0mvf2603d9b0s6rh7sl7mg4ipbh0nk05xgh1078mwvx31qjsmq1i";
|
2018-10-23 11:00:00 +02:00
|
|
|
};
|
|
|
|
|
2020-03-23 14:27:13 +01:00
|
|
|
propagatedBuildInputs = [
|
2021-06-16 01:59:37 +02:00
|
|
|
# from visidata/requirements.txt
|
|
|
|
# packages not (yet) present in nixpkgs are commented
|
2020-03-23 14:27:13 +01:00
|
|
|
dateutil
|
2021-06-16 01:59:37 +02:00
|
|
|
pandas
|
|
|
|
requests
|
|
|
|
lxml
|
2020-03-23 14:27:13 +01:00
|
|
|
openpyxl
|
|
|
|
xlrd
|
|
|
|
h5py
|
2021-06-16 01:59:37 +02:00
|
|
|
psycopg2
|
2020-03-23 14:27:13 +01:00
|
|
|
pyshp
|
2021-06-16 01:59:37 +02:00
|
|
|
#mapbox-vector-tile
|
|
|
|
#pypng
|
|
|
|
fonttools
|
|
|
|
#sas7bdat
|
|
|
|
#xport
|
|
|
|
#savReaderWriter
|
|
|
|
pyyaml
|
|
|
|
#namestand
|
|
|
|
#datapackage
|
|
|
|
pdfminer
|
|
|
|
#tabula
|
|
|
|
vobject
|
|
|
|
tabulate
|
|
|
|
wcwidth
|
|
|
|
zstandard
|
2020-03-23 14:27:13 +01:00
|
|
|
setuptools
|
2020-10-19 10:53:13 +02:00
|
|
|
] ++ lib.optionals withPcap [ dpkt dnslib ];
|
2018-10-23 11:00:00 +02:00
|
|
|
|
2021-06-16 02:01:11 +02:00
|
|
|
checkInputs = [
|
|
|
|
git
|
|
|
|
];
|
|
|
|
|
|
|
|
# check phase uses the output bin, which is not possible when cross-compiling
|
|
|
|
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# disable some tests which require access to the network
|
|
|
|
rm tests/load-http.vd # http
|
|
|
|
rm tests/graph-cursor-nosave.vd # http
|
|
|
|
rm tests/messenger-nosave.vd # dns
|
|
|
|
|
|
|
|
# disable some tests which expect Python == 3.6 (not our current version)
|
|
|
|
# see https://github.com/saulpw/visidata/issues/1014
|
|
|
|
rm tests/describe.vd
|
|
|
|
rm tests/describe-error.vd
|
|
|
|
rm tests/edit-type.vd
|
|
|
|
|
|
|
|
# tests use git to compare outputs to references
|
|
|
|
git init -b "test-reference"
|
|
|
|
git config user.name "nobody"; git config user.email "no@where"
|
|
|
|
git add .; git commit -m "test reference"
|
|
|
|
|
|
|
|
substituteInPlace dev/test.sh --replace "bin/vd" "$out/bin/vd"
|
|
|
|
bash dev/test.sh
|
|
|
|
'';
|
2018-10-23 11:00:00 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
inherit version;
|
|
|
|
description = "Interactive terminal multitool for tabular data";
|
2020-03-23 14:27:13 +01:00
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = [ lib.maintainers.raskin ];
|
2018-10-23 11:00:00 +02:00
|
|
|
homepage = "http://visidata.org/";
|
2021-02-03 14:50:53 +01:00
|
|
|
changelog = "https://github.com/saulpw/visidata/blob/v${version}/CHANGELOG.md";
|
2018-10-23 11:00:00 +02:00
|
|
|
};
|
|
|
|
}
|