depot/third_party/nixpkgs/pkgs/tools/networking/minio-client/default.nix
Default email c594a97518 Project import generated by Copybara.
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
2022-10-21 20:38:19 +02:00

39 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "minio-client";
version = "2022-10-12T18-12-50Z";
src = fetchFromGitHub {
owner = "minio";
repo = "mc";
rev = "RELEASE.${version}";
sha256 = "sha256-kzIJL3cB/zifu5H1OT0/4luMNHa6XuHVdsUcAh2sY0c=";
};
vendorSha256 = "sha256-DA1EpLmr0/+QEDRHW8nzF1myuZd5IZ7WHG5rrFrb/kE=";
subPackages = [ "." ];
patchPhase = ''
sed -i "s/Version.*/Version = \"${version}\"/g" cmd/build-constants.go
sed -i "s/ReleaseTag.*/ReleaseTag = \"RELEASE.${version}\"/g" cmd/build-constants.go
sed -i "s/CommitID.*/CommitID = \"${src.rev}\"/g" cmd/build-constants.go
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/mc --version | grep ${version} > /dev/null
'';
passthru.tests.minio = nixosTests.minio;
meta = with lib; {
homepage = "https://github.com/minio/mc";
description = "A replacement for ls, cp, mkdir, diff and rsync commands for filesystems and object storage";
maintainers = with maintainers; [ bachp eelco ];
mainProgram = "mc";
platforms = platforms.unix;
license = licenses.asl20;
};
}