mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 11:40:45 +00:00
minio: set CopyrightYear for cli ui
This commit is contained in:
parent
c585eaf8d8
commit
d51db98b2b
|
@ -12,6 +12,12 @@ let
|
|||
splitTS = builtins.elemAt (builtins.split "(.*)(T.*)" version) 1;
|
||||
in
|
||||
builtins.concatStringsSep "" [ (builtins.elemAt splitTS 0) (builtins.replaceStrings [ "-" ] [ ":" ] (builtins.elemAt splitTS 1)) ];
|
||||
|
||||
# CopyrightYear will be printed to the CLI UI.
|
||||
# Example:
|
||||
# versionToYear "2021-04-22T15-44-28Z"
|
||||
# => "2021"
|
||||
versionToYear = version: builtins.elemAt (lib.splitString "-" version) 0;
|
||||
in
|
||||
buildGoModule rec {
|
||||
pname = "minio";
|
||||
|
@ -35,7 +41,12 @@ buildGoModule rec {
|
|||
tags = [ "kqueue" ];
|
||||
|
||||
ldflags = let t = "github.com/minio/minio/cmd"; in [
|
||||
"-s" "-w" "-X ${t}.Version=${versionToTimestamp version}" "-X ${t}.ReleaseTag=RELEASE.${version}" "-X ${t}.CommitID=${src.rev}"
|
||||
"-s"
|
||||
"-w"
|
||||
"-X ${t}.Version=${versionToTimestamp version}"
|
||||
"-X ${t}.CopyrightYear=${versionToYear version}"
|
||||
"-X ${t}.ReleaseTag=RELEASE.${version}"
|
||||
"-X ${t}.CommitID=${src.rev}"
|
||||
];
|
||||
|
||||
passthru.tests.minio = nixosTests.minio;
|
||||
|
|
Loading…
Reference in a new issue