1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

sift: use buildGoModule

This commit is contained in:
Aaron Jheng 2023-01-24 01:04:06 +00:00
parent 287b071e9a
commit 51c953ff76
No known key found for this signature in database
GPG key ID: F6A547A869D050A3
2 changed files with 20 additions and 42 deletions

View file

@ -1,27 +1,34 @@
{ lib, buildGoPackage, fetchFromGitHub, installShellFiles }:
{ lib, buildGoModule, fetchFromGitHub, fetchpatch, installShellFiles }:
buildGoPackage rec {
buildGoModule rec {
pname = "sift";
version = "0.9.0";
rev = "v${version}";
goPackagePath = "github.com/svent/sift";
src = fetchFromGitHub {
owner = "svent";
repo = "sift";
rev = "v${version}";
hash = "sha256-IZ4Hwg5NzdSXtrIDNxtkzquuiHQOmLV1HSx8gpwE/i0=";
};
vendorHash = "sha256-y883la4R4jhsS99/ohgBC9SHggybAq9hreda6quG3IY=";
patches = [
# Add Go Modules support
(fetchpatch {
url = "https://github.com/svent/sift/commit/b56fb3d0fd914c8a6c08b148e15dd8a07c7d8a5a.patch";
hash = "sha256-mFCEpkgQ8XDPRQ3yKDZ5qY9tKGSuHs+RnhMeAlx33Ng=";
})
];
nativeBuildInputs = [ installShellFiles ];
src = fetchFromGitHub {
inherit rev;
owner = "svent";
repo = "sift";
sha256 = "0bgy0jf84z1c3msvb60ffj4axayfchdkf0xjnsbx9kad1v10g7i1";
};
ldflags = [ "-s" "-w" ];
postInstall = ''
installShellCompletion --cmd sift --bash go/src/github.com/svent/sift/sift-completion.bash
installShellCompletion --cmd sift --bash sift-completion.bash
'';
goDeps = ./deps.nix;
meta = with lib; {
description = "A fast and powerful alternative to grep";
homepage = "https://sift-tool.org";

View file

@ -1,29 +0,0 @@
[
{
goPackagePath = "golang.org/x/crypto";
fetch = {
type = "git";
url = "https://go.googlesource.com/crypto";
rev = "575fdbe86e5dd89229707ebec0575ce7d088a4a6";
sha256 = "1kgv1mkw9y404pk3lcwbs0vgl133mwyp294i18jg9hp10s5d56xa";
};
}
{
goPackagePath = "github.com/svent/go-flags";
fetch = {
type = "git";
url = "https://github.com/svent/go-flags";
rev = "4bcbad344f0318adaf7aabc16929701459009aa3";
sha256 = "1gb416fgxl9gq4q6wsv3i2grq1mzbi7lvfvmfdqbxqbv9vizzh34";
};
}
{
goPackagePath = "github.com/svent/go-nbreader";
fetch = {
type = "git";
url = "https://github.com/svent/go-nbreader";
rev = "7cef48da76dca6a496faa7fe63e39ed665cbd219";
sha256 = "0hw11jj5r3f6qwydg41nc3c6aadlbkhc1qpxra2609lis0qa9h4r";
};
}
]