1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-18 10:56:53 +00:00
nixpkgs/pkgs/applications/misc/ddgr/default.nix

39 lines
1 KiB
Nix
Raw Normal View History

2020-04-09 03:16:42 +01:00
{ stdenv, fetchFromGitHub, python3, installShellFiles }:
2017-12-04 17:30:38 +00:00
stdenv.mkDerivation rec {
2020-04-09 03:16:42 +01:00
version = "1.8";
pname = "ddgr";
2017-12-04 17:30:38 +00:00
src = fetchFromGitHub {
owner = "jarun";
repo = "ddgr";
rev = "v${version}";
2020-04-09 03:16:42 +01:00
sha256 = "1cyaindcg2vc3ij0p6b35inr01c6ys04izxsn1h70ixhsz46qg8z";
2017-12-04 17:30:38 +00:00
};
2020-04-09 03:16:42 +01:00
nativeBuildInputs = [ installShellFiles ];
buildInputs = [ python3 ];
2017-12-04 17:30:38 +00:00
makeFlags = [ "PREFIX=$(out)" ];
2017-12-04 17:30:38 +00:00
2020-04-09 03:16:42 +01:00
# Version 1.8 was released as 1.7
postPatch = ''
substituteInPlace ddgr --replace "_VERSION_ = '1.7'" "_VERSION_ = '${version}'"
2019-09-09 15:31:57 +01:00
'';
2017-12-04 17:30:38 +00:00
postInstall = ''
2020-04-09 03:16:42 +01:00
installShellCompletion --bash --name ddgr.bash auto-completion/bash/ddgr-completion.bash
installShellCompletion --fish auto-completion/fish/ddgr.fish
installShellCompletion --zsh auto-completion/zsh/_ddgr
2017-12-04 17:30:38 +00:00
'';
meta = with stdenv.lib; {
2020-04-09 03:16:42 +01:00
homepage = "https://github.com/jarun/ddgr";
2017-12-04 17:30:38 +00:00
description = "Search DuckDuckGo from the terminal";
license = licenses.gpl3;
maintainers = with maintainers; [ ceedubs markus1189 ];
2020-04-09 03:16:42 +01:00
platforms = python3.meta.platforms;
2017-12-04 17:30:38 +00:00
};
}