50 lines
1.2 KiB
Nix
50 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
buildGoModule,
|
|
versionCheckHook,
|
|
nix-update-script,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "minio-warp";
|
|
version = "1.1.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "minio";
|
|
repo = "warp";
|
|
rev = "v${version}";
|
|
hash = "sha256-zRRvY/PpLSY8cx3vqcAGfVK7FJKzFnxtghhIwrlUh+Y=";
|
|
};
|
|
|
|
vendorHash = "sha256-Qyb8ivuZplbOIxoS2cC+2FSZbW7CnChv1jaIKkCzgN4=";
|
|
|
|
# See .goreleaser.yml
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/minio/warp/pkg.ReleaseTag=v${version}"
|
|
"-X github.com/minio/warp/pkg.CommitID=${src.rev}"
|
|
"-X github.com/minio/warp/pkg.Version=${version}"
|
|
"-X github.com/minio/warp/pkg.ShortCommitID=${src.rev}"
|
|
"-X github.com/minio/warp/pkg.ReleaseTime=1970-01-01T00:00:00Z"
|
|
];
|
|
|
|
postInstall = ''
|
|
mv $out/bin/warp $out/bin/minio-warp
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgramArg = [ "--version" ];
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "S3 benchmarking tool";
|
|
homepage = "https://github.com/minio/warp";
|
|
license = lib.licenses.agpl3Plus;
|
|
maintainers = with lib.maintainers; [ christoph-heiss ];
|
|
mainProgram = "minio-warp";
|
|
};
|
|
}
|