webcord: init at 4.1.1

Co-authored-by: dev-null-undefined <martinkos007@gmail.com>
This commit is contained in:
huantian 2022-12-01 18:02:48 -07:00
parent 68714466bd
commit 1d1ed8fbb2
No known key found for this signature in database
GPG Key ID: 4A0318E04E555DE5
2 changed files with 83 additions and 0 deletions

View File

@ -0,0 +1,81 @@
{ lib, stdenv, buildNpmPackage, fetchFromGitHub, copyDesktopItems
, python3, pipewire, libpulseaudio, xdg-utils, electron_22, makeDesktopItem }:
buildNpmPackage rec {
name = "webcord";
version = "4.1.1";
src = fetchFromGitHub {
owner = "SpacingBat3";
repo = "WebCord";
rev = "v${version}";
sha256 = "sha256-Buu7eKmI0UGV/9Kfj+urmDcjBtR9HSwW+mlHaYhfUa4=";
};
npmDepsHash = "sha256-PeoOoEljbkHynjZwocCWCTyYvIvSE1gQiABUzIiXEdM=";
nativeBuildInputs = [
copyDesktopItems
python3
];
libPath = lib.makeLibraryPath [
pipewire
libpulseaudio
];
binPath = lib.makeBinPath [
xdg-utils
];
# 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";
# remove husky commit hooks, errors and aren't needed for packaging
postPatch = ''
rm -rf .husky
'';
# override installPhase so we can copy the only folders that matter
installPhase = ''
runHook preInstall
# Remove dev deps that aren't necessary for running the app
npm prune --omit=dev
mkdir -p $out/lib/node_modules/webcord
cp -r app node_modules sources package.json $out/lib/node_modules/webcord/
install -Dm644 sources/assets/icons/app.png $out/share/icons/hicolor/256x256/apps/webcord.png
makeWrapper '${electron_22}/bin/electron' $out/bin/webcord \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/webcord \
--prefix PATH : "${binPath}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}" \
--add-flags $out/lib/node_modules/webcord/
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "webcord";
exec = "webcord";
icon = "webcord";
desktopName = "WebCord";
comment = meta.description;
categories = [ "Network" "InstantMessaging" ];
})
];
meta = with lib; {
description = "A Discord and Fosscord 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;
maintainers = with maintainers; [ huantian ];
platforms = electron_22.meta.platforms;
};
}

View File

@ -33006,6 +33006,8 @@ with pkgs;
webcamoid = libsForQt5.callPackage ../applications/video/webcamoid { };
webcord = callPackage ../applications/networking/instant-messengers/webcord {};
webex = callPackage ../applications/networking/instant-messengers/webex {};
webmacs = libsForQt5.callPackage ../applications/networking/browsers/webmacs {};