discord: add derivations for {x86_64,aarch64}-darwin
This commit is contained in:
parent
2bf5958169
commit
8a6cde9143
@ -0,0 +1,14 @@
|
|||||||
|
{ pname, version, src, meta, stdenv, binaryName, desktopName, undmg }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
inherit pname version src meta;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ undmg ];
|
||||||
|
|
||||||
|
sourceRoot = ".";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/Applications
|
||||||
|
cp -r "${desktopName}.app" $out/Applications
|
||||||
|
'';
|
||||||
|
}
|
@ -1,35 +1,89 @@
|
|||||||
{ branch ? "stable", pkgs }:
|
{ branch ? "stable", pkgs, lib, stdenv }:
|
||||||
let
|
let
|
||||||
inherit (pkgs) callPackage fetchurl;
|
inherit (pkgs) callPackage fetchurl;
|
||||||
in {
|
versions = if stdenv.isLinux then {
|
||||||
stable = callPackage ./base.nix rec {
|
stable = "0.0.16";
|
||||||
pname = "discord";
|
ptb = "0.0.27";
|
||||||
binaryName = "Discord";
|
canary = "0.0.132";
|
||||||
desktopName = "Discord";
|
} else {
|
||||||
version = "0.0.16";
|
stable = "0.0.264";
|
||||||
src = fetchurl {
|
ptb = "0.0.58";
|
||||||
url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
|
canary = "0.0.280";
|
||||||
sha256 = "UTVKjs/i7C/m8141bXBsakQRFd/c//EmqqhKhkr1OOk=";
|
};
|
||||||
|
version = versions.${branch};
|
||||||
|
srcs = {
|
||||||
|
x86_64-linux = {
|
||||||
|
stable = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
|
||||||
|
sha256 = "UTVKjs/i7C/m8141bXBsakQRFd/c//EmqqhKhkr1OOk=";
|
||||||
|
};
|
||||||
|
ptb = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
|
||||||
|
sha256 = "0yphs65wpyr0ap6y24b0nbhq7sm02dg5c1yiym1fxjbynm1mdvqb";
|
||||||
|
};
|
||||||
|
canary = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
|
||||||
|
sha256 = "1jjbd9qllgcdpnfxg5alxpwl050vzg13rh17n638wha0vv4mjhyv";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
x86_64-darwin = {
|
||||||
|
stable = fetchurl {
|
||||||
|
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
|
||||||
|
sha256 = "1jvlxmbfqhslsr16prsgbki77kq7i3ipbkbn67pnwlnis40y9s7p";
|
||||||
|
};
|
||||||
|
ptb = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
|
||||||
|
sha256 = "sha256-GwYUoPBbx9lSaRP1JwzI0UE9gEU+rV4a9BNPVSxHki0=";
|
||||||
|
};
|
||||||
|
canary = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg";
|
||||||
|
sha256 = "0ccchsywry68vv81pqzzxmh1r19lnvxr429iwvgfr9y82lyjvz06";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# Only PTB bundles a MachO Universal binary with ARM support.
|
||||||
|
aarch64-darwin = {
|
||||||
|
ptb = fetchurl {
|
||||||
|
url =
|
||||||
|
"https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
|
||||||
|
sha256 = "sha256-GwYUoPBbx9lSaRP1JwzI0UE9gEU+rV4a9BNPVSxHki0=";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
ptb = callPackage ./base.nix rec {
|
src = srcs.${stdenv.hostPlatform.system}.${branch};
|
||||||
pname = "discord-ptb";
|
|
||||||
binaryName = "DiscordPTB";
|
meta = with lib; {
|
||||||
desktopName = "Discord PTB";
|
description = "All-in-one cross-platform voice and text chat for gamers";
|
||||||
version = "0.0.27";
|
homepage = "https://discordapp.com/";
|
||||||
src = fetchurl {
|
downloadPage = "https://discordapp.com/download";
|
||||||
url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
|
license = licenses.unfree;
|
||||||
sha256 = "0yphs65wpyr0ap6y24b0nbhq7sm02dg5c1yiym1fxjbynm1mdvqb";
|
maintainers = with maintainers; [ ldesgoui MP2E devins2518 ];
|
||||||
|
platforms = [ "x86_64-linux" "x86_64-darwin" ]
|
||||||
|
++ lib.optionals (branch == "ptb") [ "aarch64-darwin" ];
|
||||||
|
};
|
||||||
|
package = if stdenv.isLinux then ./linux.nix else ./darwin.nix;
|
||||||
|
packages = {
|
||||||
|
stable = callPackage package rec {
|
||||||
|
inherit src version meta;
|
||||||
|
pname = "discord";
|
||||||
|
binaryName = "Discord";
|
||||||
|
desktopName = "Discord";
|
||||||
|
};
|
||||||
|
ptb = callPackage package rec {
|
||||||
|
inherit src version meta;
|
||||||
|
pname = "discord-ptb";
|
||||||
|
binaryName = "DiscordPTB";
|
||||||
|
desktopName = "Discord PTB";
|
||||||
|
};
|
||||||
|
canary = callPackage package rec {
|
||||||
|
inherit src version meta;
|
||||||
|
pname = "discord-canary";
|
||||||
|
binaryName = "DiscordCanary";
|
||||||
|
desktopName = "Discord Canary";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
canary = callPackage ./base.nix rec {
|
in packages.${branch}
|
||||||
pname = "discord-canary";
|
|
||||||
binaryName = "DiscordCanary";
|
|
||||||
desktopName = "Discord Canary";
|
|
||||||
version = "0.0.132";
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
|
|
||||||
sha256 = "1jjbd9qllgcdpnfxg5alxpwl050vzg13rh17n638wha0vv4mjhyv";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}.${branch}
|
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
{ pname, version, src, binaryName, desktopName
|
{ pname, version, src, meta, binaryName, desktopName, autoPatchelfHook
|
||||||
, autoPatchelfHook, makeDesktopItem, lib, stdenv, wrapGAppsHook
|
, makeDesktopItem, lib, stdenv, wrapGAppsHook, alsa-lib, at-spi2-atk
|
||||||
, alsa-lib, at-spi2-atk, at-spi2-core, atk, cairo, cups, dbus, expat, fontconfig
|
, at-spi2-core, atk, cairo, cups, dbus, expat, fontconfig, freetype, gdk-pixbuf
|
||||||
, freetype, gdk-pixbuf, glib, gtk3, libcxx, libdrm, libnotify, libpulseaudio, libuuid
|
, glib, gtk3, libcxx, libdrm, libnotify, libpulseaudio, libuuid, libX11
|
||||||
, libX11, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext
|
, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext, libXfixes
|
||||||
, libXfixes, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence
|
, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence, mesa, nspr, nss
|
||||||
, mesa, nspr, nss, pango, systemd, libappindicator-gtk3, libdbusmenu
|
, pango, systemd, libappindicator-gtk3, libdbusmenu, writeScript
|
||||||
, writeScript, common-updater-scripts
|
, common-updater-scripts }:
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
stdenv.mkDerivation rec {
|
||||||
inherit binaryName;
|
inherit pname version src meta;
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
inherit pname version src;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
alsa-lib
|
alsa-lib
|
||||||
@ -33,13 +30,45 @@ in stdenv.mkDerivation rec {
|
|||||||
dontWrapGApps = true;
|
dontWrapGApps = true;
|
||||||
|
|
||||||
libPath = lib.makeLibraryPath [
|
libPath = lib.makeLibraryPath [
|
||||||
libcxx systemd libpulseaudio libdrm mesa
|
libcxx
|
||||||
stdenv.cc.cc alsa-lib atk at-spi2-atk at-spi2-core cairo cups dbus expat fontconfig freetype
|
systemd
|
||||||
gdk-pixbuf glib gtk3 libnotify libX11 libXcomposite libuuid
|
libpulseaudio
|
||||||
libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender
|
libdrm
|
||||||
libXtst nspr nss libxcb pango libXScrnSaver
|
mesa
|
||||||
libappindicator-gtk3 libdbusmenu
|
stdenv.cc.cc
|
||||||
];
|
alsa-lib
|
||||||
|
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
|
||||||
|
libXScrnSaver
|
||||||
|
libappindicator-gtk3
|
||||||
|
libdbusmenu
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/{bin,opt/${binaryName},share/pixmaps}
|
mkdir -p $out/{bin,opt/${binaryName},share/pixmaps}
|
||||||
@ -56,7 +85,9 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/
|
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/
|
||||||
# Without || true the install would fail on case-insensitive filesystems
|
# Without || true the install would fail on case-insensitive filesystems
|
||||||
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/${lib.strings.toLower binaryName} || true
|
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/${
|
||||||
|
lib.strings.toLower binaryName
|
||||||
|
} || true
|
||||||
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${pname}.png
|
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${pname}.png
|
||||||
|
|
||||||
ln -s "${desktopItem}/share/applications" $out/share/
|
ln -s "${desktopItem}/share/applications" $out/share/
|
||||||
@ -76,18 +107,11 @@ in stdenv.mkDerivation rec {
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p curl gnugrep common-updater-scripts
|
#!nix-shell -i bash -p curl gnugrep common-updater-scripts
|
||||||
set -eou pipefail;
|
set -eou pipefail;
|
||||||
url=$(curl -sI "https://discordapp.com/api/download/${builtins.replaceStrings ["discord-" "discord"] ["" "stable"] pname}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+')
|
url=$(curl -sI "https://discordapp.com/api/download/${
|
||||||
|
builtins.replaceStrings [ "discord-" "discord" ] [ "" "stable" ] pname
|
||||||
|
}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+')
|
||||||
version=''${url##https://dl*.discordapp.net/apps/linux/}
|
version=''${url##https://dl*.discordapp.net/apps/linux/}
|
||||||
version=''${version%%/*.tar.gz}
|
version=''${version%%/*.tar.gz}
|
||||||
update-source-version ${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix
|
update-source-version ${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with 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 ];
|
|
||||||
platforms = [ "x86_64-linux" ];
|
|
||||||
};
|
|
||||||
}
|
}
|
@ -34023,17 +34023,17 @@ with pkgs;
|
|||||||
|
|
||||||
discord = import ../applications/networking/instant-messengers/discord {
|
discord = import ../applications/networking/instant-messengers/discord {
|
||||||
branch = "stable";
|
branch = "stable";
|
||||||
inherit pkgs;
|
inherit pkgs lib stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
discord-ptb = import ../applications/networking/instant-messengers/discord {
|
discord-ptb = import ../applications/networking/instant-messengers/discord {
|
||||||
branch = "ptb";
|
branch = "ptb";
|
||||||
inherit pkgs;
|
inherit pkgs lib stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
discord-canary = import ../applications/networking/instant-messengers/discord {
|
discord-canary = import ../applications/networking/instant-messengers/discord {
|
||||||
branch = "canary";
|
branch = "canary";
|
||||||
inherit pkgs;
|
inherit pkgs lib stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
golden-cheetah = libsForQt514.callPackage ../applications/misc/golden-cheetah {};
|
golden-cheetah = libsForQt514.callPackage ../applications/misc/golden-cheetah {};
|
||||||
|
Loading…
Reference in New Issue
Block a user