Merge pull request #209034 from farcaller/noborus-ov

ov: init at 0.13.0
This commit is contained in:
Ryan Lahfa 2023-01-15 20:00:50 +01:00 committed by GitHub
commit b4a95a60ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,60 @@
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, pandoc
, makeWrapper
}:
buildGoModule rec {
pname = "ov";
version = "0.13.0";
src = fetchFromGitHub {
owner = "noborus";
repo = "ov";
rev = "refs/tags/v${version}";
hash = "sha256-vBPhCSor3wGCawz+097Lw29xgW6z5fV5PAMAq7TBiNM=";
};
vendorHash = "sha256-y3oSL1W2cjt6oUVbglHhun3XNCidqb7LTXtoA25+mpo=";
ldflags = [
"-X main.Version=v${version}"
"-X main.Revision=${src.rev}"
];
subPackages = [ "." ];
nativeBuildInputs = [
installShellFiles
pandoc
makeWrapper
];
outputs = [ "out" "doc" ];
postInstall = ''
installShellCompletion --cmd ov \
--bash <($out/bin/ov completion bash) \
--fish <($out/bin/ov completion fish) \
--zsh <($out/bin/ov completion zsh)
mkdir -p $out/share/$name
cp $src/ov-less.yaml $out/share/$name/less-config.yaml
makeWrapper $out/bin/ov $out/bin/ov-less --add-flags "--config $out/share/$name/less-config.yaml"
mkdir -p $doc/share/doc/$name
pandoc -s < $src/README.md > $doc/share/doc/$name/README.html
mkdir -p $doc/share/$name
cp $src/ov.yaml $doc/share/$name/sample-config.yaml
'';
meta = with lib; {
description = "Feature-rich terminal-based text viewer";
homepage = "https://noborus.github.io/ov";
license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ farcaller ];
};
}

View file

@ -38624,4 +38624,6 @@ with pkgs;
tuner = callPackage ../applications/audio/tuner { };
jfrog-cli = callPackage ../tools/misc/jfrog-cli { };
ov = callPackage ../tools/text/ov { };
}