uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -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
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
{ branch ? "stable", pkgs, lib, stdenv }:
|
||||
let
|
||||
inherit (pkgs) callPackage fetchurl;
|
||||
versions = if stdenv.isLinux then {
|
||||
stable = "0.0.17";
|
||||
ptb = "0.0.29";
|
||||
canary = "0.0.135";
|
||||
} else {
|
||||
stable = "0.0.264";
|
||||
ptb = "0.0.59";
|
||||
canary = "0.0.283";
|
||||
};
|
||||
version = versions.${branch};
|
||||
srcs = let
|
||||
darwin-ptb = fetchurl {
|
||||
url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
|
||||
sha256 = "sha256-LS7KExVXkOv8O/GrisPMbBxg/pwoDXIOo1dK9wk1yB8=";
|
||||
};
|
||||
in {
|
||||
x86_64-linux = {
|
||||
stable = fetchurl {
|
||||
url =
|
||||
"https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
|
||||
sha256 = "058k0cmbm4y572jqw83bayb2zzl2fw2aaz0zj1gvg6sxblp76qil";
|
||||
};
|
||||
ptb = fetchurl {
|
||||
url =
|
||||
"https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz";
|
||||
sha256 = "d78NnQZ3MkLje8mHrI6noH2iD2oEvSJ3cDnsmzQsUYc=";
|
||||
};
|
||||
canary = fetchurl {
|
||||
url =
|
||||
"https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
|
||||
sha256 = "sha256-dmG+3BWS1BMHHQAv4fsXuObVeAJBeD+TqnyQz69AMac=";
|
||||
};
|
||||
};
|
||||
x86_64-darwin = {
|
||||
stable = fetchurl {
|
||||
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
|
||||
sha256 = "1jvlxmbfqhslsr16prsgbki77kq7i3ipbkbn67pnwlnis40y9s7p";
|
||||
};
|
||||
ptb = darwin-ptb;
|
||||
canary = fetchurl {
|
||||
url =
|
||||
"https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg";
|
||||
sha256 = "0mqpk1szp46mih95x42ld32rrspc6jx1j7qdaxf01whzb3d4pi9l";
|
||||
};
|
||||
};
|
||||
# Only PTB bundles a MachO Universal binary with ARM support.
|
||||
aarch64-darwin = { ptb = darwin-ptb; };
|
||||
};
|
||||
src = srcs.${stdenv.hostPlatform.system}.${branch};
|
||||
|
||||
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 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 = (builtins.mapAttrs
|
||||
(_: value: callPackage package (value // { inherit src version; meta = meta // { mainProgram = value.binaryName; }; }))
|
||||
{
|
||||
stable = rec {
|
||||
pname = "discord";
|
||||
binaryName = "Discord";
|
||||
desktopName = "Discord";
|
||||
};
|
||||
ptb = rec {
|
||||
pname = "discord-ptb";
|
||||
binaryName = "DiscordPTB";
|
||||
desktopName = "Discord PTB";
|
||||
};
|
||||
canary = rec {
|
||||
pname = "discord-canary";
|
||||
binaryName = "DiscordCanary";
|
||||
desktopName = "Discord Canary";
|
||||
};
|
||||
}
|
||||
);
|
||||
in packages.${branch}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
{ pname, version, src, meta, binaryName, desktopName, autoPatchelfHook
|
||||
, makeDesktopItem, lib, stdenv, wrapGAppsHook, makeShellWrapper, alsa-lib, 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, libxshmfence, mesa, nspr, nss
|
||||
, pango, systemd, libappindicator-gtk3, libdbusmenu, writeScript
|
||||
, common-updater-scripts }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
inherit pname version src meta;
|
||||
|
||||
nativeBuildInputs = [
|
||||
alsa-lib
|
||||
autoPatchelfHook
|
||||
cups
|
||||
libdrm
|
||||
libuuid
|
||||
libXdamage
|
||||
libX11
|
||||
libXScrnSaver
|
||||
libXtst
|
||||
libxcb
|
||||
libxshmfence
|
||||
mesa
|
||||
nss
|
||||
wrapGAppsHook
|
||||
makeShellWrapper
|
||||
];
|
||||
|
||||
dontWrapGApps = true;
|
||||
|
||||
libPath = lib.makeLibraryPath [
|
||||
libcxx
|
||||
systemd
|
||||
libpulseaudio
|
||||
libdrm
|
||||
mesa
|
||||
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 = ''
|
||||
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}
|
||||
|
||||
wrapProgramShell $out/opt/${binaryName}/${binaryName} \
|
||||
"''${gappsWrapperArgs[@]}" \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" \
|
||||
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
||||
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${binaryName}
|
||||
|
||||
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/
|
||||
# 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}/discord.png $out/share/pixmaps/${pname}.png
|
||||
|
||||
ln -s "${desktopItem}/share/applications" $out/share/
|
||||
'';
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = pname;
|
||||
exec = binaryName;
|
||||
icon = pname;
|
||||
inherit desktopName;
|
||||
genericName = meta.description;
|
||||
categories = [ "Network" "InstantMessaging" ];
|
||||
mimeTypes = [ "x-scheme-handler/discord" ];
|
||||
};
|
||||
|
||||
passthru.updateScript = writeScript "discord-update-script" ''
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl gnugrep common-updater-scripts
|
||||
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+')
|
||||
version=''${url##https://dl*.discordapp.net/apps/linux/}
|
||||
version=''${version%%/*.tar.gz}
|
||||
update-source-version ${pname} "$version" --file=./pkgs/applications/networking/instant-messengers/discord/default.nix
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue