discord-{ptb,canary}: init; add update-discord
This commit is contained in:
parent
0687a9d8db
commit
e6f23b8b1e
36
maintainers/scripts/update-discord
Executable file
36
maintainers/scripts/update-discord
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# script to generate `pkgs/networking/instant-messengers/discord/default.nix`
|
||||||
|
|
||||||
|
set -e
|
||||||
|
exec >${1:?usage: $0 <output-file>}
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
{ branch ? "stable", pkgs }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (pkgs) callPackage fetchurl;
|
||||||
|
in {
|
||||||
|
EOF
|
||||||
|
|
||||||
|
for branch in "" ptb canary; do
|
||||||
|
url=$(curl -sI "https://discordapp.com/api/download${branch:+/}${branch}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+')
|
||||||
|
version=${url##https://dl*.discordapp.net/apps/linux/}
|
||||||
|
version=${version%%/*.tar.gz}
|
||||||
|
echo " ${branch:-stable} = callPackage ./base.nix {"
|
||||||
|
echo " pname = \"discord${branch:+-}${branch}\";"
|
||||||
|
case $branch in
|
||||||
|
"") suffix="" ;;
|
||||||
|
ptb) suffix="PTB" ;;
|
||||||
|
canary) suffix="Canary" ;;
|
||||||
|
esac
|
||||||
|
echo " binaryName = \"Discord${suffix}\";"
|
||||||
|
echo " desktopName = \"Discord${suffix:+ }${suffix}\";"
|
||||||
|
echo " version = \"${version}\";"
|
||||||
|
echo " src = fetchurl {"
|
||||||
|
echo " url = \"${url}\";"
|
||||||
|
echo " sha256 = \"$(nix-prefetch-url "$url")\";"
|
||||||
|
echo " };"
|
||||||
|
echo " };"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "}.\${branch}"
|
@ -0,0 +1,61 @@
|
|||||||
|
{ pname, version, src, binaryName, desktopName
|
||||||
|
, stdenv, fetchurl, makeDesktopItem, wrapGAppsHook
|
||||||
|
, alsaLib, atk, at-spi2-atk, at-spi2-core, cairo, cups, dbus, expat, fontconfig, freetype
|
||||||
|
, gdk_pixbuf, glib, gtk3, libnotify, libX11, libXcomposite, libXcursor, libXdamage, libuuid
|
||||||
|
, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, nspr, nss, libxcb
|
||||||
|
, pango, systemd, libXScrnSaver, libcxx, libpulseaudio }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit binaryName;
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
|
inherit pname version src;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ wrapGAppsHook ];
|
||||||
|
|
||||||
|
dontWrapGApps = true;
|
||||||
|
|
||||||
|
libPath = stdenv.lib.makeLibraryPath [
|
||||||
|
libcxx systemd libpulseaudio
|
||||||
|
stdenv.cc.cc alsaLib atk at-spi2-atk at-spi2-core 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
|
||||||
|
];
|
||||||
|
|
||||||
|
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/
|
||||||
|
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${binaryName}.png
|
||||||
|
|
||||||
|
ln -s "${desktopItem}/share/applications" $out/share/
|
||||||
|
'';
|
||||||
|
|
||||||
|
desktopItem = makeDesktopItem {
|
||||||
|
name = pname;
|
||||||
|
exec = binaryName;
|
||||||
|
icon = pname;
|
||||||
|
inherit desktopName;
|
||||||
|
genericName = meta.description;
|
||||||
|
categories = "Network;InstantMessaging;";
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "All-in-one cross-platform voice and text chat for gamers";
|
||||||
|
homepage = "https://discordapp.com/";
|
||||||
|
downloadPage = "https://discordapp.com/download";
|
||||||
|
license = licenses.unfree;
|
||||||
|
maintainers = with maintainers; [ ldesgoui MP2E tadeokondrak ];
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
|
};
|
||||||
|
}
|
@ -1,64 +1,36 @@
|
|||||||
{ stdenv, fetchurl, makeDesktopItem, wrapGAppsHook
|
{ branch ? "stable", pkgs }:
|
||||||
, alsaLib, atk, at-spi2-atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk_pixbuf
|
|
||||||
, glib, gtk3, libnotify, libX11, libXcomposite, libXcursor, libXdamage, libuuid
|
|
||||||
, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, nspr, nss, libxcb
|
|
||||||
, pango, systemd, libXScrnSaver, libcxx, libpulseaudio }:
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
pname = "discord";
|
inherit (pkgs) callPackage fetchurl;
|
||||||
version = "0.0.9";
|
in {
|
||||||
|
stable = callPackage ./base.nix {
|
||||||
src = fetchurl {
|
pname = "discord";
|
||||||
url = "https://cdn.discordapp.com/apps/linux/${version}/${pname}-${version}.tar.gz";
|
binaryName = "Discord";
|
||||||
sha256 = "1i0f8id10rh2fx381hx151qckvvh8hbznfsfav8w0dfbd1bransf";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ wrapGAppsHook ];
|
|
||||||
|
|
||||||
dontWrapGApps = true;
|
|
||||||
|
|
||||||
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
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/{bin,opt/discord,share/pixmaps}
|
|
||||||
mv * $out/opt/discord
|
|
||||||
|
|
||||||
chmod +x $out/opt/discord/Discord
|
|
||||||
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
|
|
||||||
$out/opt/discord/Discord
|
|
||||||
|
|
||||||
wrapProgram $out/opt/discord/Discord \
|
|
||||||
"''${gappsWrapperArgs[@]}" \
|
|
||||||
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
||||||
--prefix LD_LIBRARY_PATH : ${libPath}
|
|
||||||
|
|
||||||
ln -s $out/opt/discord/Discord $out/bin/
|
|
||||||
ln -s $out/opt/discord/discord.png $out/share/pixmaps
|
|
||||||
|
|
||||||
ln -s "${desktopItem}/share/applications" $out/share/
|
|
||||||
'';
|
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
|
||||||
name = pname;
|
|
||||||
exec = "Discord";
|
|
||||||
icon = pname;
|
|
||||||
desktopName = "Discord";
|
desktopName = "Discord";
|
||||||
genericName = meta.description;
|
version = "0.0.9";
|
||||||
categories = "Network;InstantMessaging;";
|
src = fetchurl {
|
||||||
|
url = "https://dl.discordapp.net/apps/linux/0.0.9/discord-0.0.9.tar.gz";
|
||||||
|
sha256 = "1i0f8id10rh2fx381hx151qckvvh8hbznfsfav8w0dfbd1bransf";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
ptb = callPackage ./base.nix {
|
||||||
meta = with stdenv.lib; {
|
pname = "discord-ptb";
|
||||||
description = "All-in-one cross-platform voice and text chat for gamers";
|
binaryName = "DiscordPTB";
|
||||||
homepage = https://discordapp.com/;
|
desktopName = "Discord PTB";
|
||||||
downloadPage = "https://github.com/crmarsh/discord-linux-bugs";
|
version = "0.0.15";
|
||||||
license = licenses.unfree;
|
src = fetchurl {
|
||||||
maintainers = [ maintainers.ldesgoui maintainers.MP2E ];
|
url = "https://dl-ptb.discordapp.net/apps/linux/0.0.15/discord-ptb-0.0.15.tar.gz";
|
||||||
platforms = [ "x86_64-linux" ];
|
sha256 = "0znqb0a3yglgx7a9ypkb81jcm8kqgc6559zi7vfqn02zh15gqv6a";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
canary = callPackage ./base.nix {
|
||||||
|
pname = "discord-canary";
|
||||||
|
binaryName = "DiscordCanary";
|
||||||
|
desktopName = "Discord Canary";
|
||||||
|
version = "0.0.83";
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://dl-canary.discordapp.net/apps/linux/0.0.83/discord-canary-0.0.83.tar.gz";
|
||||||
|
sha256 = "100a61x71cgyfm0xk4qdlbp1v41089jy7lajksbpy4y7him6bg2s";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}.${branch}
|
||||||
|
@ -24135,7 +24135,20 @@ in
|
|||||||
|
|
||||||
togglesg-download = callPackage ../tools/misc/togglesg-download { };
|
togglesg-download = callPackage ../tools/misc/togglesg-download { };
|
||||||
|
|
||||||
discord = callPackage ../applications/networking/instant-messengers/discord { };
|
discord = import ../applications/networking/instant-messengers/discord {
|
||||||
|
branch = "stable";
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
|
||||||
|
discord-ptb = import ../applications/networking/instant-messengers/discord {
|
||||||
|
branch = "ptb";
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
|
||||||
|
discord-canary = import ../applications/networking/instant-messengers/discord {
|
||||||
|
branch = "canary";
|
||||||
|
inherit pkgs;
|
||||||
|
};
|
||||||
|
|
||||||
golden-cheetah = libsForQt56.callPackage ../applications/misc/golden-cheetah {};
|
golden-cheetah = libsForQt56.callPackage ../applications/misc/golden-cheetah {};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user