about summary refs log tree commit diff
path: root/pkgs/by-name/be/betterdiscordctl/package.nix
blob: 4c1eae4392154bea4a0ef9b1169a6e3ccfb0cdfb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  fetchFromGitHub,
  lib,
  stdenvNoCC,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "betterdiscordctl";
  version = "2.0.1";

  src = fetchFromGitHub {
    owner = "bb010g";
    repo = "betterdiscordctl";
    rev = "v${finalAttrs.version}";
    sha256 = "0p321rfcihz2779sdd6qfgpxgk5yd53d33vq5pvb50dbdgxww0bc";
  };

  postPatch = ''
    substituteInPlace betterdiscordctl \
      --replace "DISABLE_SELF_UPGRADE=" "DISABLE_SELF_UPGRADE=yes"
  '';

  installPhase = ''
    runHook preInstall

    install -Dm 755 -t "$out/bin" -- betterdiscordctl
    install -Dm 644 -t "$out/share/doc/betterdiscordctl" -- README.md

    runHook postInstall
  '';

  doInstallCheck = true;

  installCheckPhase = ''
    runHook preInstallCheck

    "$out/bin/betterdiscordctl" --version

    runHook postInstallCheck
  '';

  meta = {
    homepage = "https://github.com/bb010g/betterdiscordctl";
    description = "Utility for managing BetterDiscord on Linux";
    license = lib.licenses.mit;
    mainProgram = "betterdiscordctl";
    maintainers = [ ];
    platforms = lib.platforms.linux;
  };
})