From d29162388715cc85db7b3dcca9fe43432f81ff9e Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 16 Jun 2021 01:59:37 +0200 Subject: [PATCH 1/2] visidata: add missing dependencies --- pkgs/applications/misc/visidata/default.nix | 42 ++++++++++++++++----- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/misc/visidata/default.nix b/pkgs/applications/misc/visidata/default.nix index ad49a1b291e2..237e5ee8ae55 100644 --- a/pkgs/applications/misc/visidata/default.nix +++ b/pkgs/applications/misc/visidata/default.nix @@ -2,16 +2,23 @@ , lib , fetchFromGitHub , dateutil -, pyyaml +, pandas +, requests +, lxml , openpyxl , xlrd , h5py -, fonttools -, lxml -, pandas +, psycopg2 , pyshp +, fonttools +, pyyaml +, pdfminer +, vobject +, tabulate +, wcwidth +, zstandard , setuptools -, withPcap ? true, dpkt ? null, dnslib ? null +, withPcap ? true, dpkt, dnslib }: buildPythonApplication rec { pname = "visidata"; @@ -25,15 +32,32 @@ buildPythonApplication rec { }; propagatedBuildInputs = [ + # from visidata/requirements.txt + # packages not (yet) present in nixpkgs are commented dateutil - pyyaml + pandas + requests + lxml openpyxl xlrd h5py - fonttools - lxml - pandas + psycopg2 pyshp + #mapbox-vector-tile + #pypng + fonttools + #sas7bdat + #xport + #savReaderWriter + pyyaml + #namestand + #datapackage + pdfminer + #tabula + vobject + tabulate + wcwidth + zstandard setuptools ] ++ lib.optionals withPcap [ dpkt dnslib ]; From 4a8d262c7c485caf9648acb0a6f757a1ccd9e1c3 Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 16 Jun 2021 02:01:11 +0200 Subject: [PATCH 2/2] visidata: enable tests --- pkgs/applications/misc/visidata/default.nix | 32 +++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/visidata/default.nix b/pkgs/applications/misc/visidata/default.nix index 237e5ee8ae55..9663d09304f8 100644 --- a/pkgs/applications/misc/visidata/default.nix +++ b/pkgs/applications/misc/visidata/default.nix @@ -1,5 +1,6 @@ -{ buildPythonApplication +{ stdenv , lib +, buildPythonApplication , fetchFromGitHub , dateutil , pandas @@ -18,6 +19,7 @@ , wcwidth , zstandard , setuptools +, git , withPcap ? true, dpkt, dnslib }: buildPythonApplication rec { @@ -61,7 +63,33 @@ buildPythonApplication rec { setuptools ] ++ lib.optionals withPcap [ dpkt dnslib ]; - doCheck = false; + 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 + ''; meta = { inherit version;