2019-06-19 05:39:15 +00:00
|
|
|
{ pname, version, src, binaryName, desktopName
|
2021-04-19 00:16:42 +00:00
|
|
|
, autoPatchelfHook, makeDesktopItem, lib, stdenv, wrapGAppsHook
|
2020-06-09 04:37:12 +00:00
|
|
|
, alsaLib, at-spi2-atk, at-spi2-core, atk, cairo, cups, dbus, expat, fontconfig
|
|
|
|
, freetype, gdk-pixbuf, glib, gtk3, libcxx, libdrm, libnotify, libpulseaudio, libuuid
|
|
|
|
, libX11, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext
|
|
|
|
, libXfixes, libXi, libXrandr, libXrender, libXtst, libxcb
|
2020-10-11 19:14:59 +00:00
|
|
|
, mesa, nspr, nss, pango, systemd, libappindicator-gtk3, libdbusmenu
|
2020-06-09 04:37:12 +00:00
|
|
|
}:
|
2019-06-19 05:39:15 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit binaryName;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
inherit pname version src;
|
|
|
|
|
2020-06-09 04:37:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
alsaLib
|
|
|
|
autoPatchelfHook
|
|
|
|
cups
|
|
|
|
libdrm
|
2020-06-14 07:36:29 +00:00
|
|
|
libuuid
|
2021-04-18 18:12:38 +00:00
|
|
|
libXdamage
|
2020-06-09 04:37:12 +00:00
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXtst
|
|
|
|
libxcb
|
|
|
|
mesa.drivers
|
|
|
|
nss
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
2019-06-19 05:39:15 +00:00
|
|
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
libPath = lib.makeLibraryPath [
|
2019-06-19 05:39:15 +00:00
|
|
|
libcxx systemd libpulseaudio
|
|
|
|
stdenv.cc.cc alsaLib atk at-spi2-atk at-spi2-core cairo cups dbus expat fontconfig freetype
|
2019-05-22 11:03:39 +00:00
|
|
|
gdk-pixbuf glib gtk3 libnotify libX11 libXcomposite libuuid
|
2019-06-19 05:39:15 +00:00
|
|
|
libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender
|
|
|
|
libXtst nspr nss libxcb pango systemd libXScrnSaver
|
2020-10-11 19:14:59 +00:00
|
|
|
libappindicator-gtk3 libdbusmenu
|
2019-06-19 05:39:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,opt/${binaryName},share/pixmaps}
|
|
|
|
mv * $out/opt/${binaryName}
|
|
|
|
|
|
|
|
chmod +x $out/opt/${binaryName}/${binaryName}
|
|
|
|
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
|
|
|
|
$out/opt/${binaryName}/${binaryName}
|
|
|
|
|
|
|
|
wrapProgram $out/opt/${binaryName}/${binaryName} \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${libPath}
|
|
|
|
|
|
|
|
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/
|
2019-07-18 22:53:14 +00:00
|
|
|
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${pname}.png
|
2019-06-19 05:39:15 +00:00
|
|
|
|
|
|
|
ln -s "${desktopItem}/share/applications" $out/share/
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
exec = binaryName;
|
|
|
|
icon = pname;
|
|
|
|
inherit desktopName;
|
|
|
|
genericName = meta.description;
|
|
|
|
categories = "Network;InstantMessaging;";
|
2019-12-20 05:50:19 +00:00
|
|
|
mimeType = "x-scheme-handler/discord";
|
2019-06-19 05:39:15 +00:00
|
|
|
};
|
|
|
|
|
2020-04-12 15:55:36 +00:00
|
|
|
passthru.updateScript = ./update-discord.sh;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-06-19 05:39:15 +00:00
|
|
|
description = "All-in-one cross-platform voice and text chat for gamers";
|
|
|
|
homepage = "https://discordapp.com/";
|
|
|
|
downloadPage = "https://discordapp.com/download";
|
|
|
|
license = licenses.unfree;
|
2021-04-27 19:10:25 +00:00
|
|
|
maintainers = with maintainers; [ ldesgoui MP2E ];
|
2019-06-19 05:39:15 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|