summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ab/abaddon/package.nix
blob: a630b59c2bcc6fb7cc6506a775eb8eba02156f94 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
  lib,
  fetchFromGitHub,
  stdenv,
  cmake,
  copyDesktopItems,
  makeDesktopItem,
  makeWrapper,
  pkg-config,
  alsa-lib,
  curl,
  gtkmm3,
  libhandy,
  libopus,
  libpulseaudio,
  libsecret,
  libsodium,
  nlohmann_json,
  pcre2,
  spdlog,
  sqlite,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "abaddon";
  version = "0.2.4";

  src = fetchFromGitHub {
    owner = "uowuo";
    repo = "abaddon";
    tag = "v${finalAttrs.version}";
    hash = "sha256-fSNXMbyYmUOA4x911/an02fhhhWe6a4xlLVb2DIqIOE=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    cmake
    copyDesktopItems
    makeWrapper
    pkg-config
  ];

  buildInputs = [
    curl
    gtkmm3
    libhandy
    libopus
    libsecret
    libsodium
    nlohmann_json
    pcre2
    spdlog
    sqlite
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/share/abaddon
    cp -r ../res/{css,res} $out/share/abaddon
    mkdir $out/bin
    cp abaddon $out/bin
    wrapProgram $out/bin/abaddon \
      --prefix LD_LIBRARY_PATH : "${
        lib.makeLibraryPath [
          alsa-lib
          libpulseaudio
        ]
      }" \
      --chdir $out/share/abaddon

    runHook postInstall
  '';

  desktopItems = [
    (makeDesktopItem {
      name = finalAttrs.pname;
      exec = finalAttrs.pname;
      desktopName = "Abaddon";
      genericName = finalAttrs.meta.description;
      startupWMClass = finalAttrs.pname;
      categories = [
        "Network"
        "InstantMessaging"
      ];
      mimeTypes = [ "x-scheme-handler/discord" ];
    })
  ];

  meta = {
    description = "Discord client reimplementation, written in C++";
    mainProgram = "abaddon";
    homepage = "https://github.com/uowuo/abaddon";
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ choco98 ];
    platforms = lib.platforms.linux;
  };
})