forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / servers / minio / default.nix
blob7d872128f1f98e45cd16e2abc2cd0d305efb4ad7
1 { lib, buildGoModule, fetchFromGitHub, nixosTests }:
3 let
4   # The web client verifies, that the server version is a valid datetime string:
5   # https://github.com/minio/minio/blob/3a0e7347cad25c60b2e51ff3194588b34d9e424c/browser/app/js/web.js#L51-L53
6   #
7   # Example:
8   #   versionToTimestamp "2021-04-22T15-44-28Z"
9   #   => "2021-04-22T15:44:28Z"
10   versionToTimestamp = version:
11     let
12       splitTS = builtins.elemAt (builtins.split "(.*)(T.*)" version) 1;
13     in
14     builtins.concatStringsSep "" [ (builtins.elemAt splitTS 0) (builtins.replaceStrings [ "-" ] [ ":" ] (builtins.elemAt splitTS 1)) ];
16   # CopyrightYear will be printed to the CLI UI.
17   # Example:
18   #   versionToYear "2021-04-22T15-44-28Z"
19   #   => "2021"
20   versionToYear = version: builtins.elemAt (lib.splitString "-" version) 0;
22 buildGoModule rec {
23   pname = "minio";
24   version = "2024-09-22T00-33-43Z";
26   src = fetchFromGitHub {
27     owner = "minio";
28     repo = "minio";
29     rev = "RELEASE.${version}";
30     hash = "sha256-/2H79fJYdusFNBXj/2i4p+O16wseHzPzJ5LnS1O+Gm4=";
31   };
33   vendorHash = "sha256-MDClQjCh/ygdbybE4jIoWGBsqr3roNn7stXUw9eoN2Y=";
35   doCheck = false;
37   subPackages = [ "." ];
39   CGO_ENABLED = 0;
41   tags = [ "kqueue" ];
43   ldflags = let t = "github.com/minio/minio/cmd"; in [
44     "-s"
45     "-w"
46     "-X ${t}.Version=${versionToTimestamp version}"
47     "-X ${t}.CopyrightYear=${versionToYear version}"
48     "-X ${t}.ReleaseTag=RELEASE.${version}"
49     "-X ${t}.CommitID=${src.rev}"
50   ];
52   passthru.tests.minio = nixosTests.minio;
54   meta = with lib; {
55     homepage = "https://www.minio.io/";
56     description = "S3-compatible object storage server";
57     changelog = "https://github.com/minio/minio/releases/tag/RELEASE.${version}";
58     maintainers = with maintainers; [ bachp ];
59     license = licenses.agpl3Plus;
60     mainProgram = "minio";
61   };