1{ buildGoModule
2, fetchFromGitHub
3, lib
4, testers
5, twitch-cli
6}:
7
8buildGoModule rec {
9 pname = "twitch-cli";
10 version = "1.1.22";
11
12 src = fetchFromGitHub {
13 owner = "twitchdev";
14 repo = pname;
15 rev = "v${version}";
16 hash = "sha256-9tbU9gR8UHg98UKZ9ganapAz1bar18xb7ISvKoeuwe4=";
17 };
18
19 patches = [
20 ./application-name.patch
21 ];
22
23 vendorHash = "sha256-1uUokMeI0D/apDFJLq+Go5BQp1JMYxJQF8nKvw52E7o=";
24
25 ldflags = [
26 "-s"
27 "-w"
28 "-X=main.buildVersion=${version}"
29 ];
30
31 preCheck = ''
32 export HOME=$(mktemp -d)
33 '';
34
35 __darwinAllowLocalNetworking = true;
36
37 passthru.tests.version = testers.testVersion {
38 package = twitch-cli;
39 command = "HOME=$(mktemp -d) ${pname} version";
40 version = "${pname}/${version}";
41 };
42
43 meta = with lib; {
44 description = "The official Twitch CLI to make developing on Twitch easier";
45 mainProgram = "twitch-cli";
46 homepage = "https://github.com/twitchdev/twitch-cli";
47 license = licenses.asl20;
48 maintainers = with maintainers; [ benediktbroich ];
49 };
50}