Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 68 lines 1.6 kB view raw
1{ 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 nixosTests, 6}: 7 8let 9 # The web client verifies, that the server version is a valid datetime string: 10 # https://github.com/minio/minio/blob/3a0e7347cad25c60b2e51ff3194588b34d9e424c/browser/app/js/web.js#L51-L53 11 # 12 # Example: 13 # versionToTimestamp "2021-04-22T15-44-28Z" 14 # => "2021-04-22T15:44:28Z" 15 versionToTimestamp = 16 version: 17 let 18 splitTS = builtins.elemAt (builtins.split "(.*)(T.*)" version) 1; 19 in 20 builtins.concatStringsSep "" [ 21 (builtins.elemAt splitTS 0) 22 (builtins.replaceStrings [ "-" ] [ ":" ] (builtins.elemAt splitTS 1)) 23 ]; 24in 25buildGoModule rec { 26 pname = "minio"; 27 version = "2022-10-24T18-35-07Z"; 28 29 src = fetchFromGitHub { 30 owner = "minio"; 31 repo = "minio"; 32 rev = "RELEASE.${version}"; 33 sha256 = "sha256-sABNzhyfBNU5pWyE/VWHUzuSyKsx0glj01ectJPakV8="; 34 }; 35 36 vendorHash = "sha256-wB3UiuptT6D0CIUlHC1d5k0rjIxNeh5yAWOmYpyLGmA="; 37 38 doCheck = false; 39 40 subPackages = [ "." ]; 41 42 env.CGO_ENABLED = 0; 43 44 tags = [ "kqueue" ]; 45 46 ldflags = 47 let 48 t = "github.com/minio/minio/cmd"; 49 in 50 [ 51 "-s" 52 "-w" 53 "-X ${t}.Version=${versionToTimestamp version}" 54 "-X ${t}.ReleaseTag=RELEASE.${version}" 55 "-X ${t}.CommitID=${src.rev}" 56 ]; 57 58 passthru.tests.minio = nixosTests.minio; 59 60 meta = with lib; { 61 homepage = "https://www.minio.io/"; 62 description = "S3-compatible object storage server"; 63 mainProgram = "minio"; 64 changelog = "https://github.com/minio/minio/releases/tag/RELEASE.${version}"; 65 maintainers = with maintainers; [ bachp ]; 66 license = licenses.agpl3Plus; 67 }; 68}