Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / ce / centrifugo / package.nix
blob82601a7fba637047ec19ea31571393ab2640b1fc
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , nix-update-script
5 , nixosTests
6 , testers
7 , centrifugo
8 }:
9 let
10   # Inspect build flags with `go version -m centrifugo`.
11   statsEndpoint = "https://graphite-prod-01-eu-west-0.grafana.net/graphite/metrics,https://stats.centrifugal.dev/usage";
12   statsToken = "425599:eyJrIjoi" +
13     "OWJhMTcyZGNjN2FkYjEzM2E1OTQwZjIyMTU3MTBjMjUyYzAyZWE2MSIsIm4iOiJVc2FnZSBTdGF0cyIsImlkIjo2NDUzOTN9";
15 buildGoModule rec {
16   pname = "centrifugo";
17   version = "5.4.1";
19   src = fetchFromGitHub {
20     owner = "centrifugal";
21     repo = "centrifugo";
22     rev = "v${version}";
23     hash = "sha256-rIsc+abyfhHncogxZnx7Dmvc/JRm+L4YKZOOW/Qtddg=";
24   };
26   vendorHash = "sha256-+fZnoDH5nbzrGWrr8ayBqzJoAji6y+CYI+TvEISxPRs=";
28   ldflags = [
29     "-s"
30     "-w"
31     "-X=github.com/centrifugal/centrifugo/v5/internal/build.Version=${version}"
32     "-X=github.com/centrifugal/centrifugo/v5/internal/build.UsageStatsEndpoint=${statsEndpoint}"
33     "-X=github.com/centrifugal/centrifugo/v5/internal/build.UsageStatsToken=${statsToken}"
34   ];
36   excludedPackages = [
37     "./internal/gen/api"
38   ];
40   passthru = {
41     updateScript = nix-update-script { };
42     tests = {
43       inherit (nixosTests) centrifugo;
44       version = testers.testVersion {
45         package = centrifugo;
46         command = "${pname} version";
47         version = "v${version}";
48       };
49     };
50   };
52   meta = {
53     description = "Scalable real-time messaging server";
54     homepage = "https://centrifugal.dev";
55     changelog = "https://github.com/centrifugal/centrifugo/releases/tag/v${version}";
56     license = lib.licenses.asl20;
57     maintainers = [ lib.maintainers.tie ];
58     mainProgram = "centrifugo";
59   };