2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
2020-05-29 06:06:01 +00:00
|
|
|
, installShellFiles
|
2020-04-24 23:36:52 +00:00
|
|
|
, coreutils
|
|
|
|
, gnused
|
|
|
|
, gnugrep
|
|
|
|
, sqlite
|
|
|
|
, wget
|
|
|
|
, w3m
|
|
|
|
, socat
|
|
|
|
, gawk
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dasht";
|
2020-05-29 06:06:01 +00:00
|
|
|
version = "2.4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sunaku";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-05-29 06:06:01 +00:00
|
|
|
sha256 = "08wssmifxi7pnvn9gqrvpzpkc2qpkfbzbhxh0dk1gff2y2211qqk";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
deps = lib.makeBinPath [
|
|
|
|
coreutils
|
|
|
|
gnused
|
|
|
|
gnugrep
|
|
|
|
sqlite
|
|
|
|
wget
|
|
|
|
w3m
|
|
|
|
socat
|
|
|
|
gawk
|
|
|
|
(placeholder "out")
|
|
|
|
];
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/* $out/bin/
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
installManPage man/man1/*
|
|
|
|
installShellCompletion --zsh etc/zsh/completions/*
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
for i in $out/bin/*; do
|
|
|
|
echo "Wrapping $i"
|
|
|
|
wrapProgram $i --prefix PATH : ${deps};
|
|
|
|
done;
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Search API docs offline, in terminal or browser";
|
|
|
|
homepage = "https://sunaku.github.io/dasht/man";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
platforms = lib.platforms.unix; #cannot test other
|
|
|
|
maintainers = with lib.maintainers; [ matthiasbeyer ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|