2019-01-17 01:33:07 +00:00
|
|
|
{ stdenv, fetchurl, makeDesktopItem, wrapGAppsHook
|
2019-01-15 19:23:36 +00:00
|
|
|
, alsaLib, atk, at-spi2-atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk_pixbuf
|
|
|
|
, glib, gtk3, libnotify, libX11, libXcomposite, libXcursor, libXdamage, libuuid
|
2017-08-09 03:36:17 +00:00
|
|
|
, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, nspr, nss, libxcb
|
2017-08-20 06:10:55 +00:00
|
|
|
, pango, systemd, libXScrnSaver, libcxx, libpulseaudio }:
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2016-12-15 22:52:34 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-06-19 05:34:09 +00:00
|
|
|
pname = "discord";
|
|
|
|
version = "0.0.9";
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://cdn.discordapp.com/apps/linux/${version}/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "1i0f8id10rh2fx381hx151qckvvh8hbznfsfav8w0dfbd1bransf";
|
|
|
|
};
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook ];
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
dontWrapGApps = true;
|
2019-01-17 01:33:07 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [
|
|
|
|
libcxx systemd libpulseaudio
|
|
|
|
stdenv.cc.cc alsaLib atk at-spi2-atk cairo cups dbus expat fontconfig freetype
|
|
|
|
gdk_pixbuf glib gtk3 libnotify libX11 libXcomposite libuuid
|
|
|
|
libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender
|
|
|
|
libXtst nspr nss libxcb pango systemd libXScrnSaver
|
|
|
|
];
|
2017-08-09 03:36:17 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,opt/discord,share/pixmaps}
|
|
|
|
mv * $out/opt/discord
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
chmod +x $out/opt/discord/Discord
|
|
|
|
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
|
|
|
|
$out/opt/discord/Discord
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
wrapProgram $out/opt/discord/Discord \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${libPath}
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
ln -s $out/opt/discord/Discord $out/bin/
|
|
|
|
ln -s $out/opt/discord/discord.png $out/share/pixmaps
|
2017-08-09 03:36:17 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
ln -s "${desktopItem}/share/applications" $out/share/
|
|
|
|
'';
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
exec = "Discord";
|
|
|
|
icon = pname;
|
|
|
|
desktopName = "Discord";
|
|
|
|
genericName = meta.description;
|
|
|
|
categories = "Network;InstantMessaging;";
|
|
|
|
};
|
2016-04-02 16:58:48 +00:00
|
|
|
|
2019-06-19 05:34:09 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "All-in-one cross-platform voice and text chat for gamers";
|
|
|
|
homepage = https://discordapp.com/;
|
|
|
|
downloadPage = "https://github.com/crmarsh/discord-linux-bugs";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = [ maintainers.ldesgoui maintainers.MP2E ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
2016-04-02 16:58:48 +00:00
|
|
|
}
|