mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-31 09:10:08 +00:00
visidata: cleanup
This commit is contained in:
@@ -1,27 +1,36 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
|
||||
# dependencies
|
||||
xclip,
|
||||
|
||||
# tests
|
||||
versionCheckHook,
|
||||
|
||||
withPcap ? true,
|
||||
withXclip ? stdenv.hostPlatform.isLinux,
|
||||
xclip,
|
||||
testers,
|
||||
visidata,
|
||||
stdenv,
|
||||
}:
|
||||
python3Packages.buildPythonApplication (finalAttrs: {
|
||||
pname = "visidata";
|
||||
version = "3.4";
|
||||
format = "setuptools";
|
||||
pyproject = true;
|
||||
__structuredAttrs = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "saulpw";
|
||||
repo = "visidata";
|
||||
rev = "v${finalAttrs.version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-h5utXfafQP6uZ7vXQAYXfV26y0qHbk6vulPl6DXbVX4=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs =
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
];
|
||||
|
||||
dependencies =
|
||||
with python3Packages;
|
||||
[
|
||||
# from visidata/requirements.txt
|
||||
@@ -32,6 +41,7 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
||||
lxml
|
||||
openpyxl
|
||||
xlrd
|
||||
standard-mailcap
|
||||
xlwt
|
||||
h5py
|
||||
psycopg2
|
||||
@@ -84,14 +94,18 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
||||
dnslib
|
||||
]
|
||||
)
|
||||
++ lib.optional withXclip xclip;
|
||||
++ lib.optionals withXclip [
|
||||
xclip
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
|
||||
# check phase uses the output bin, which is not possible when cross-compiling
|
||||
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
preCheck = ''
|
||||
# disable some tests which require access to the network
|
||||
rm tests/load-http-flaky.vd # http
|
||||
rm tests/messenger-nosave.vd # dns
|
||||
@@ -103,8 +117,8 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
||||
patchShebangs tests/
|
||||
substituteInPlace tests/test-vdx.sh --replace-fail "bin/vd" "$out/bin/vd"
|
||||
bash dev/test.sh
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
python dev/zsh-completion.py
|
||||
install -Dm644 _visidata -t $out/share/zsh/site-functions
|
||||
@@ -112,11 +126,6 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
||||
|
||||
pythonImportsCheck = [ "visidata" ];
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = visidata;
|
||||
version = "v${finalAttrs.version}";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Interactive terminal multitool for tabular data";
|
||||
mainProgram = "visidata";
|
||||
@@ -126,6 +135,6 @@ python3Packages.buildPythonApplication (finalAttrs: {
|
||||
markus1189
|
||||
];
|
||||
homepage = "https://visidata.org/";
|
||||
changelog = "https://github.com/saulpw/visidata/blob/v${finalAttrs.version}/CHANGELOG.md";
|
||||
changelog = "https://github.com/saulpw/visidata/blob/${finalAttrs.src.rev}/CHANGELOG.md";
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user