2021-06-16 00:01:11 +00:00
|
|
|
{ stdenv
|
2020-03-23 13:27:13 +00:00
|
|
|
, lib
|
2021-06-16 00:01:11 +00:00
|
|
|
, buildPythonApplication
|
2020-03-23 13:27:13 +00:00
|
|
|
, fetchFromGitHub
|
2023-03-25 18:23:26 +00:00
|
|
|
# python requirements
|
|
|
|
, beautifulsoup4
|
|
|
|
, boto3
|
|
|
|
, faker
|
|
|
|
, fonttools
|
2020-03-23 13:27:13 +00:00
|
|
|
, h5py
|
2023-03-25 18:23:26 +00:00
|
|
|
, importlib-metadata
|
|
|
|
, lxml
|
|
|
|
, matplotlib
|
|
|
|
, numpy
|
2021-11-15 06:38:14 +00:00
|
|
|
, odfpy
|
2023-03-25 18:23:26 +00:00
|
|
|
, openpyxl
|
|
|
|
, pandas
|
|
|
|
, pdfminer-six
|
|
|
|
, praw
|
|
|
|
, psutil
|
2021-06-15 23:59:37 +00:00
|
|
|
, psycopg2
|
2023-03-25 18:23:26 +00:00
|
|
|
, pyarrow
|
2020-03-23 13:27:13 +00:00
|
|
|
, pyshp
|
2023-03-25 18:23:26 +00:00
|
|
|
, pypng
|
|
|
|
, python-dateutil
|
2021-06-15 23:59:37 +00:00
|
|
|
, pyyaml
|
2023-03-25 18:23:26 +00:00
|
|
|
, requests
|
|
|
|
, seaborn
|
|
|
|
, setuptools
|
|
|
|
, sh
|
2021-06-15 23:59:37 +00:00
|
|
|
, tabulate
|
2023-03-25 18:23:26 +00:00
|
|
|
, urllib3
|
|
|
|
, vobject
|
2021-06-15 23:59:37 +00:00
|
|
|
, wcwidth
|
2023-03-25 18:23:26 +00:00
|
|
|
, xlrd
|
|
|
|
, xlwt
|
2021-06-15 23:59:37 +00:00
|
|
|
, zstandard
|
2023-03-25 18:23:26 +00:00
|
|
|
, zulip
|
|
|
|
# other
|
2021-06-16 00:01:11 +00:00
|
|
|
, git
|
2021-06-15 23:59:37 +00:00
|
|
|
, withPcap ? true, dpkt, dnslib
|
2022-07-18 19:34:07 +00:00
|
|
|
, withXclip ? stdenv.isLinux, xclip
|
2022-11-28 22:32:15 +00:00
|
|
|
, testers
|
|
|
|
, visidata
|
2018-10-23 09:00:00 +00:00
|
|
|
}:
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "visidata";
|
2023-10-29 18:03:39 +00:00
|
|
|
version = "2.11.1";
|
2018-10-23 09:00:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "saulpw";
|
|
|
|
repo = "visidata";
|
|
|
|
rev = "v${version}";
|
2023-10-29 18:03:39 +00:00
|
|
|
hash = "sha256-A8iYFdW30Em5pjGn3DRpaV0A7ixwfSzmIp8AgtPkBCI=";
|
2018-10-23 09:00:00 +00:00
|
|
|
};
|
|
|
|
|
2020-03-23 13:27:13 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-06-15 23:59:37 +00:00
|
|
|
# from visidata/requirements.txt
|
|
|
|
# packages not (yet) present in nixpkgs are commented
|
2021-07-03 11:37:24 +00:00
|
|
|
python-dateutil
|
2021-06-15 23:59:37 +00:00
|
|
|
pandas
|
|
|
|
requests
|
|
|
|
lxml
|
2020-03-23 13:27:13 +00:00
|
|
|
openpyxl
|
|
|
|
xlrd
|
2023-03-25 18:23:26 +00:00
|
|
|
xlwt
|
2020-03-23 13:27:13 +00:00
|
|
|
h5py
|
2021-06-15 23:59:37 +00:00
|
|
|
psycopg2
|
2023-03-25 18:23:26 +00:00
|
|
|
boto3
|
2020-03-23 13:27:13 +00:00
|
|
|
pyshp
|
2021-06-15 23:59:37 +00:00
|
|
|
#mapbox-vector-tile
|
2023-03-25 18:23:26 +00:00
|
|
|
pypng
|
2021-06-15 23:59:37 +00:00
|
|
|
fonttools
|
|
|
|
#sas7bdat
|
|
|
|
#xport
|
|
|
|
#savReaderWriter
|
|
|
|
pyyaml
|
|
|
|
#namestand
|
|
|
|
#datapackage
|
2022-05-25 04:20:00 +00:00
|
|
|
pdfminer-six
|
2021-06-15 23:59:37 +00:00
|
|
|
#tabula
|
|
|
|
vobject
|
|
|
|
tabulate
|
|
|
|
wcwidth
|
|
|
|
zstandard
|
2021-11-15 06:38:14 +00:00
|
|
|
odfpy
|
2023-03-25 18:23:26 +00:00
|
|
|
urllib3
|
|
|
|
pyarrow
|
|
|
|
seaborn
|
|
|
|
matplotlib
|
|
|
|
sh
|
|
|
|
psutil
|
|
|
|
numpy
|
|
|
|
|
|
|
|
#requests_cache
|
|
|
|
beautifulsoup4
|
|
|
|
|
|
|
|
faker
|
|
|
|
praw
|
|
|
|
zulip
|
|
|
|
#pyairtable
|
|
|
|
|
2020-03-23 13:27:13 +00:00
|
|
|
setuptools
|
2022-11-28 22:32:15 +00:00
|
|
|
importlib-metadata
|
2022-07-18 19:34:07 +00:00
|
|
|
] ++ lib.optionals withPcap [ dpkt dnslib ]
|
|
|
|
++ lib.optional withXclip xclip;
|
2018-10-23 09:00:00 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2021-06-16 00:01:11 +00:00
|
|
|
git
|
|
|
|
];
|
|
|
|
|
|
|
|
# check phase uses the output bin, which is not possible when cross-compiling
|
|
|
|
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
|
|
|
|
|
|
|
checkPhase = ''
|
2022-11-28 22:32:15 +00:00
|
|
|
runHook preCheck
|
2021-06-16 00:01:11 +00:00
|
|
|
# disable some tests which require access to the network
|
2023-03-25 18:23:26 +00:00
|
|
|
rm -f tests/load-http.vd # http
|
|
|
|
rm -f tests/graph-cursor-nosave.vd # http
|
|
|
|
rm -f tests/messenger-nosave.vd # dns
|
2021-06-16 00:01:11 +00:00
|
|
|
|
|
|
|
# tests use git to compare outputs to references
|
|
|
|
git init -b "test-reference"
|
2023-03-25 18:23:26 +00:00
|
|
|
git config user.name "nobody"
|
|
|
|
git config user.email "no@where"
|
|
|
|
git add .
|
|
|
|
git commit -m "test reference"
|
2021-06-16 00:01:11 +00:00
|
|
|
|
|
|
|
substituteInPlace dev/test.sh --replace "bin/vd" "$out/bin/vd"
|
|
|
|
bash dev/test.sh
|
2022-11-28 22:32:15 +00:00
|
|
|
runHook postCheck
|
2021-06-16 00:01:11 +00:00
|
|
|
'';
|
2023-03-30 18:00:49 +00:00
|
|
|
postInstall = ''
|
|
|
|
python dev/zsh-completion.py
|
|
|
|
install -Dm644 _visidata -t $out/share/zsh/site-functions
|
|
|
|
'';
|
2018-10-23 09:00:00 +00:00
|
|
|
|
2022-11-28 22:32:15 +00:00
|
|
|
pythonImportsCheck = ["visidata"];
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = visidata;
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
|
2018-10-23 09:00:00 +00:00
|
|
|
meta = {
|
|
|
|
description = "Interactive terminal multitool for tabular data";
|
2020-03-23 13:27:13 +00:00
|
|
|
license = lib.licenses.gpl3;
|
2021-11-16 08:57:38 +00:00
|
|
|
maintainers = with lib.maintainers; [ raskin markus1189 ];
|
2022-11-28 22:32:15 +00:00
|
|
|
homepage = "https://visidata.org/";
|
2021-02-03 13:50:53 +00:00
|
|
|
changelog = "https://github.com/saulpw/visidata/blob/v${version}/CHANGELOG.md";
|
2018-10-23 09:00:00 +00:00
|
|
|
};
|
|
|
|
}
|