@@ -1,5 +1,18 @@
11{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
22
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)) ];
15+in
316buildGoModule rec {
417 pname = "minio";
518 version = "2021-04-22T15-44-28Z";
@@ -18,7 +31,7 @@ buildGoModule rec {
1831 subPackages = [ "." ];
1932
2033 patchPhase = ''
21− sed -i "s/Version.*/Version = \"${version}\"/g" cmd/build-constants.go
34+ sed -i "s/Version.*/Version = \"${versionToTimestamp version}\"/g" cmd/build-constants.go
2235 sed -i "s/ReleaseTag.*/ReleaseTag = \"RELEASE.${version}\"/g" cmd/build-constants.go
2336 sed -i "s/CommitID.*/CommitID = \"${src.rev}\"/g" cmd/build-constants.go
2437 '';