nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 stdenv,
5 cmake,
6 copyDesktopItems,
7 makeDesktopItem,
8 makeWrapper,
9 pkg-config,
10 alsa-lib,
11 curl,
12 gtkmm3,
13 libhandy,
14 libopus,
15 libpulseaudio,
16 libsecret,
17 libsodium,
18 nlohmann_json,
19 pcre2,
20 spdlog,
21 sqlite,
22}:
23
24stdenv.mkDerivation rec {
25 pname = "abaddon";
26 version = "0.2.2";
27
28 src = fetchFromGitHub {
29 owner = "uowuo";
30 repo = "abaddon";
31 tag = "v${version}";
32 hash = "sha256-48lR1rIWMwLaTv+nIdqmQ3mHOayrC1P5OQuUb+URYh0=";
33 fetchSubmodules = true;
34 };
35
36 nativeBuildInputs = [
37 cmake
38 copyDesktopItems
39 makeWrapper
40 pkg-config
41 ];
42
43 buildInputs = [
44 curl
45 gtkmm3
46 libhandy
47 libopus
48 libsecret
49 libsodium
50 nlohmann_json
51 pcre2
52 spdlog
53 sqlite
54 ];
55
56 installPhase = ''
57 runHook preInstall
58
59 mkdir -p $out/share/abaddon
60 cp -r ../res/{css,res} $out/share/abaddon
61 mkdir $out/bin
62 cp abaddon $out/bin
63 wrapProgram $out/bin/abaddon \
64 --prefix LD_LIBRARY_PATH : "${
65 lib.makeLibraryPath [
66 alsa-lib
67 libpulseaudio
68 ]
69 }" \
70 --chdir $out/share/abaddon
71
72 runHook postInstall
73 '';
74
75 desktopItems = [
76 (makeDesktopItem {
77 name = pname;
78 exec = pname;
79 desktopName = "Abaddon";
80 genericName = meta.description;
81 startupWMClass = pname;
82 categories = [
83 "Network"
84 "InstantMessaging"
85 ];
86 mimeTypes = [ "x-scheme-handler/discord" ];
87 })
88 ];
89
90 meta = {
91 description = "Discord client reimplementation, written in C++";
92 mainProgram = "abaddon";
93 homepage = "https://github.com/uowuo/abaddon";
94 license = lib.licenses.gpl3Plus;
95 maintainers = [ ];
96 platforms = lib.platforms.linux;
97 };
98}