-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/Legcord/Legcord/releases/tag/v1.0.0 https://github.com/Legcord/Legcord/releases/tag/v1.0.1
- Loading branch information
Showing
1 changed file
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
{ lib | ||
, stdenv | ||
, fetchurl | ||
, autoPatchelfHook | ||
, dpkg | ||
, makeBinaryWrapper | ||
, wrapGAppsHook3 | ||
, alsa-lib | ||
, at-spi2-atk | ||
, at-spi2-core | ||
, atk | ||
, cairo | ||
, cups | ||
, dbus | ||
, expat | ||
, ffmpeg | ||
, fontconfig | ||
, freetype | ||
, gdk-pixbuf | ||
, glib | ||
, gtk3 | ||
, libappindicator-gtk3 | ||
, libdrm | ||
, libnotify | ||
, libpulseaudio | ||
, libsecret | ||
, libuuid | ||
, libxkbcommon | ||
, mesa | ||
, nss | ||
, pango | ||
, systemd | ||
, xdg-utils | ||
, xorg | ||
, wayland | ||
, pipewire | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "legcord"; | ||
version = "1.0.1"; | ||
|
||
src = | ||
let | ||
base = "https://github.com/Legcord/Legcord/releases/download"; | ||
in | ||
{ | ||
x86_64-linux = fetchurl { | ||
url = "${base}/v${version}/Legcord-${version}-linux-amd64.deb"; | ||
hash = "sha256-kZ9dhSJjhYmpZJLbWP8nPP6Lxw+wLe3d9cCahfIomNM="; | ||
}; | ||
aarch64-linux = fetchurl { | ||
url = "${base}/v${version}/Legcord-${version}-linux-arm64.deb"; | ||
hash = "sha256-Ikyjmlt1F7f6WaYWuAgyzLP3zvQPCvMRZ1D9e79umgM="; | ||
}; | ||
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); | ||
|
||
nativeBuildInputs = [ autoPatchelfHook dpkg makeBinaryWrapper wrapGAppsHook3 ]; | ||
|
||
dontWrapGApps = true; | ||
|
||
buildInputs = [ | ||
alsa-lib | ||
at-spi2-atk | ||
at-spi2-core | ||
atk | ||
cairo | ||
cups | ||
dbus | ||
expat | ||
ffmpeg | ||
fontconfig | ||
freetype | ||
gdk-pixbuf | ||
glib | ||
gtk3 | ||
pango | ||
systemd | ||
mesa # for libgbm | ||
nss | ||
libuuid | ||
libdrm | ||
libnotify | ||
libsecret | ||
libpulseaudio | ||
libxkbcommon | ||
libappindicator-gtk3 | ||
xorg.libX11 | ||
xorg.libxcb | ||
xorg.libXcomposite | ||
xorg.libXcursor | ||
xorg.libXdamage | ||
xorg.libXext | ||
xorg.libXfixes | ||
xorg.libXi | ||
xorg.libXrandr | ||
xorg.libXrender | ||
xorg.libXScrnSaver | ||
xorg.libxshmfence | ||
xorg.libXtst | ||
wayland | ||
pipewire | ||
]; | ||
|
||
sourceRoot = "."; | ||
unpackCmd = "dpkg-deb -x $src ."; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p "$out/bin" | ||
cp -R "opt" "$out" | ||
cp -R "usr/share" "$out/share" | ||
chmod -R g-w "$out" | ||
# Wrap the startup command | ||
makeBinaryWrapper $out/opt/Legcord/legcord $out/bin/legcord \ | ||
"''${gappsWrapperArgs[@]}" \ | ||
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \ | ||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WebRTCPipeWireCapturer }}" \ | ||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath buildInputs}" \ | ||
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]} | ||
# Fix desktop link | ||
substituteInPlace $out/share/applications/legcord.desktop \ | ||
--replace /opt/Legcord/ $out/bin/ | ||
runHook postInstall | ||
''; | ||
|
||
meta = with lib; { | ||
description = "Lightweight, alternative desktop client for Discord"; | ||
homepage = "https://legcord.app"; | ||
downloadPage = "https://github.com/Legcord/Legcord"; | ||
sourceProvenance = with sourceTypes; [ binaryNativeCode ]; | ||
license = licenses.osl3; | ||
maintainers = with maintainers; [ wrmilling ]; | ||
platforms = [ "x86_64-linux" "aarch64-linux" ]; | ||
mainProgram = "legcord"; | ||
}; | ||
} |