3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/misc/ddgr/default.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

{stdenv, fetchFromGitHub, python3}:
2017-12-04 17:30:38 +00:00
stdenv.mkDerivation rec {
2019-09-09 15:31:57 +01:00
version = "1.7";
pname = "ddgr";
2017-12-04 17:30:38 +00:00
src = fetchFromGitHub {
owner = "jarun";
repo = "ddgr";
rev = "v${version}";
2019-09-09 15:31:57 +01:00
sha256 = "0kcl8z9w8iwn3pxay1pfahhw6vs2l1dp60yfv3i19in4ac9va7m0";
2017-12-04 17:30:38 +00:00
};
buildInputs = [ python3 ];
2017-12-04 17:30:38 +00:00
makeFlags = "PREFIX=$(out)";
2019-09-09 15:31:57 +01:00
preBuild = ''
# Version 1.7 was released as 1.6
# https://github.com/jarun/ddgr/pull/95
sed -i "s/_VERSION_ = '1.6'/_VERSION_ = '1.7'/" ddgr
'';
2017-12-04 17:30:38 +00:00
postInstall = ''
mkdir -p "$out/share/bash-completion/completions/"
cp "auto-completion/bash/ddgr-completion.bash" "$out/share/bash-completion/completions/"
mkdir -p "$out/share/fish/vendor_completions.d/"
cp "auto-completion/fish/ddgr.fish" "$out/share/fish/vendor_completions.d/"
mkdir -p "$out/share/zsh/site-functions/"
cp "auto-completion/zsh/_ddgr" "$out/share/zsh/site-functions/"
'';
meta = with stdenv.lib; {
homepage = https://github.com/jarun/ddgr;
description = "Search DuckDuckGo from the terminal";
license = licenses.gpl3;
maintainers = with maintainers; [ ceedubs markus1189 ];
2017-12-04 17:30:38 +00:00
platforms = platforms.unix;
};
}