Merge pull request #259899 from Gerg-L/webcord

webcord: 4.4.2 -> 4.4.3
This commit is contained in:
Weijia Wang 2023-10-14 23:40:29 +02:00 committed by GitHub
commit ef83bb17bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,30 +13,25 @@
buildNpmPackage rec {
pname = "webcord";
version = "4.4.2";
version = "4.4.3";
src = fetchFromGitHub {
owner = "SpacingBat3";
repo = "WebCord";
rev = "v${version}";
hash = "sha256-23YmyRU+xBXpC7bZtBY3RZeVpLFQ3I/Ag5Tvi3m9cIs=";
hash = "sha256-Se73TANnZUvbSe3v4woofRzYARP2h2HjO1kv/5sDRyA=";
};
npmDepsHash = "sha256-gHX5ZdcC46BwMu22G05Q8UhvZ6CtQ1HSf6KLLlN2iX0=";
npmDepsHash = "sha256-O3eFtgDO+2A7PygrLj6iT/rptnG+oR5tD2lhhz6Iwug=";
nativeBuildInputs = [
copyDesktopItems
python3
];
libPath = lib.makeLibraryPath [
pipewire
libpulseaudio
];
# npm install will error when electron tries to download its binary
# we don't need it anyways since we wrap the program with our nixpkgs electron
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
# remove husky commit hooks, errors and aren't needed for packaging
postPatch = ''
@ -44,7 +39,15 @@ buildNpmPackage rec {
'';
# override installPhase so we can copy the only folders that matter
installPhase = ''
installPhase =
let
libPath = lib.makeLibraryPath [
libpulseaudio
pipewire
];
binPath = lib.makeBinPath [ xdg-utils ];
in
''
runHook preInstall
# Remove dev deps that aren't necessary for running the app
@ -56,10 +59,10 @@ buildNpmPackage rec {
install -Dm644 sources/assets/icons/app.png $out/share/icons/hicolor/256x256/apps/webcord.png
# Add xdg-utils to path via suffix, per PR #181171
makeWrapper '${electron_25}/bin/electron' $out/bin/webcord \
makeWrapper '${lib.getExe electron_25}' $out/bin/webcord \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/webcord \
--suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}" \
--suffix PATH : "${binPath}" \
--add-flags "--ozone-platform-hint=auto" \
--add-flags $out/lib/node_modules/webcord/
runHook postInstall
@ -78,14 +81,14 @@ buildNpmPackage rec {
passthru.updateScript = nix-update-script { };
meta = with lib; {
meta = {
description = "A Discord and SpaceBar electron-based client implemented without Discord API";
homepage = "https://github.com/SpacingBat3/WebCord";
downloadPage = "https://github.com/SpacingBat3/WebCord/releases";
changelog = "https://github.com/SpacingBat3/WebCord/releases/tag/v${version}";
license = licenses.mit;
license = lib.licenses.mit;
mainProgram = "webcord";
maintainers = with maintainers; [ huantian ];
platforms = platforms.linux;
maintainers = with lib.maintainers; [ huantian ];
platforms = lib.platforms.linux;
};
}