{equicord, equibop}: init (#349863)

authored by scrumplex.net and committed by GitHub 738406dd 47626c90

+249
+16
pkgs/by-name/eq/equibop/disable_update_checking.patch
···
··· 1 + diff --git i/src/main/index.ts w/src/main/index.ts 2 + index 23ea0d6..1ef465f 100644 3 + --- i/src/main/index.ts 4 + +++ w/src/main/index.ts 5 + @@ -32,7 +32,9 @@ if (process.platform === "linux") { 6 + if (IS_DEV) { 7 + require("source-map-support").install(); 8 + } else { 9 + - autoUpdater.checkForUpdatesAndNotify(); 10 + + console.log("Update checking is disabled. Skipping..."); 11 + + // autoUpdater.checkForUpdatesAndNotify(); 12 + + 13 + } 14 + 15 + // Make the Vencord files use our DATA_DIR 16 +
+153
pkgs/by-name/eq/equibop/package.nix
···
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + substituteAll, 6 + makeWrapper, 7 + makeDesktopItem, 8 + copyDesktopItems, 9 + equicord, 10 + electron, 11 + libicns, 12 + pipewire, 13 + libpulseaudio, 14 + autoPatchelfHook, 15 + pnpm_9, 16 + nodejs, 17 + nix-update-script, 18 + withTTS ? true, 19 + withMiddleClickScroll ? false, 20 + # Enables the use of Equicord from nixpkgs instead of 21 + # letting Equibop manage it's own version 22 + withSystemEquicord ? false, 23 + }: 24 + stdenv.mkDerivation (finalAttrs: { 25 + pname = "equibop"; 26 + version = "2.0.9"; 27 + 28 + src = fetchFromGitHub { 29 + owner = "Equicord"; 30 + repo = "Equibop"; 31 + rev = "refs/tags/v${finalAttrs.version}"; 32 + hash = "sha256-mK/zoW8Km6xlppxJnVbuas4yE1rpAOd9QnjETlxxnsE="; 33 + }; 34 + 35 + pnpmDeps = pnpm_9.fetchDeps { 36 + inherit (finalAttrs) 37 + pname 38 + version 39 + src 40 + patches 41 + ; 42 + hash = "sha256-TSdkHSZTbFf3Nq0QHDNTeUHmd6N+L1N1kSiKt0uNF6s="; 43 + }; 44 + 45 + nativeBuildInputs = [ 46 + nodejs 47 + pnpm_9.configHook 48 + # XXX: Equibop *does not* ship venmic as a prebuilt node module. The package 49 + # seems to build with or without this hook, but I (NotAShelf) don't have the 50 + # time to test the consequences of removing this hook. Please open a pull 51 + # request if this bothers you in some way. 52 + autoPatchelfHook 53 + copyDesktopItems 54 + # we use a script wrapper here for environment variable expansion at runtime 55 + # https://github.com/NixOS/nixpkgs/issues/172583 56 + makeWrapper 57 + ]; 58 + 59 + buildInputs = [ 60 + libpulseaudio 61 + pipewire 62 + stdenv.cc.cc.lib 63 + ]; 64 + 65 + patches = 66 + [ ./disable_update_checking.patch ] 67 + ++ lib.optional withSystemEquicord (substituteAll { 68 + inherit equicord; 69 + src = ./use_system_equicord.patch; 70 + }); 71 + 72 + env = { 73 + ELECTRON_SKIP_BINARY_DOWNLOAD = 1; 74 + }; 75 + 76 + buildPhase = '' 77 + runHook preBuild 78 + 79 + pnpm build 80 + pnpm exec electron-builder \ 81 + --dir \ 82 + -c.asarUnpack="**/*.node" \ 83 + -c.electronDist=${electron.dist} \ 84 + -c.electronVersion=${electron.version} 85 + 86 + runHook postBuild 87 + ''; 88 + 89 + postBuild = '' 90 + pushd build 91 + ${libicns}/bin/icns2png -x icon.icns 92 + popd 93 + ''; 94 + 95 + installPhase = '' 96 + runHook preInstall 97 + mkdir -p $out/opt/Equibop 98 + cp -r dist/*unpacked/resources $out/opt/Equibop/ 99 + 100 + for file in build/icon_*x32.png; do 101 + file_suffix=''${file//build\/icon_} 102 + install -Dm0644 $file $out/share/icons/hicolor/''${file_suffix//x32.png}/apps/equibop.png 103 + done 104 + 105 + runHook postInstall 106 + ''; 107 + 108 + postFixup = '' 109 + makeWrapper ${electron}/bin/electron $out/bin/equibop \ 110 + --add-flags $out/opt/Equibop/resources/app.asar \ 111 + ${lib.optionalString withTTS "--add-flags \"--enable-speech-dispatcher\""} \ 112 + ${lib.optionalString withMiddleClickScroll "--add-flags \"--enable-blink-features=MiddleClickAutoscroll\""} \ 113 + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime}}" 114 + ''; 115 + 116 + desktopItems = makeDesktopItem { 117 + name = "equibop"; 118 + desktopName = "Equibop"; 119 + exec = "equibop %U"; 120 + icon = "equibop"; 121 + startupWMClass = "Equibop"; 122 + genericName = "Internet Messenger"; 123 + keywords = [ 124 + "discord" 125 + "equibop" 126 + "electron" 127 + "chat" 128 + ]; 129 + categories = [ 130 + "Network" 131 + "InstantMessaging" 132 + "Chat" 133 + ]; 134 + }; 135 + 136 + passthru = { 137 + inherit (finalAttrs) pnpmDeps; 138 + updateScript = nix-update-script { }; 139 + }; 140 + 141 + meta = { 142 + description = "Custom Discord App aiming to give you better performance and improve linux support"; 143 + homepage = "https://github.com/Equicord/Equibop"; 144 + changelog = "https://github.com/Equicord/Equibop/releases/tag/${finalAttrs.src.rev}"; 145 + license = lib.licenses.gpl3Only; 146 + maintainers = [ 147 + lib.maintainers.NotAShelf 148 + ]; 149 + mainProgram = "equibop"; 150 + # I am not confident in my ability to support Darwin, please PR if this is important to you 151 + platforms = lib.platforms.linux; 152 + }; 153 + })
+17
pkgs/by-name/eq/equibop/use_system_equicord.patch
···
··· 1 + diff --git i/src/main/constants.ts w/src/main/constants.ts 2 + index afb171f..c6a014e 100644 3 + --- i/src/main/constants.ts 4 + +++ w/src/main/constants.ts 5 + @@ -47,10 +47,7 @@ export const VENCORD_THEMES_DIR = join(DATA_DIR, "themes"); 6 + 7 + // needs to be inline require because of circular dependency 8 + // as otherwise "DATA_DIR" (which is used by ./settings) will be uninitialised 9 + -export const VENCORD_DIR = (() => { 10 + - const { State } = require("./settings") as typeof import("./settings"); 11 + - return State.store.vencordDir ? join(State.store.vencordDir, "equibop") : join(SESSION_DATA_DIR, "equicord.asar"); 12 + -})(); 13 + +export const VENCORD_DIR = "@equicord@"; 14 + 15 + export const USER_AGENT = `Equibop/${app.getVersion()} (https://github.com/Equicord/Equibop)`; 16 + 17 +
+63
pkgs/by-name/eq/equicord/package.nix
···
··· 1 + { 2 + fetchFromGitHub, 3 + git, 4 + lib, 5 + nodejs, 6 + pnpm_9, 7 + stdenv, 8 + buildWebExtension ? false, 9 + }: 10 + stdenv.mkDerivation (finalAttrs: { 11 + pname = "equicord"; 12 + version = "1.10.4"; # from package.json 13 + 14 + src = fetchFromGitHub { 15 + owner = "Equicord"; 16 + repo = "Equicord"; 17 + rev = "440b68ea82b6fd44bf5ec70b759a0207ee9f4ca7"; 18 + hash = "sha256-9GIw8g2HZ6/5Lb4gtDyuBqZWi5YK5Uz0lo+u+LrIZwI="; 19 + }; 20 + 21 + pnpmDeps = pnpm_9.fetchDeps { 22 + inherit (finalAttrs) pname version src; 23 + hash = "sha256-kGLF6uIr0xxlB5LaSqKiBKESbmWN7PzDErrCmiT6vXA="; 24 + }; 25 + 26 + nativeBuildInputs = [ 27 + git 28 + nodejs 29 + pnpm_9.configHook 30 + ]; 31 + 32 + env = { 33 + EQUICORD_REMOTE = "${finalAttrs.src.owner}/${finalAttrs.src.repo}"; 34 + EQUICORD_HASH = "${finalAttrs.src.rev}"; 35 + }; 36 + 37 + buildPhase = '' 38 + runHook preBuild 39 + 40 + pnpm run ${if buildWebExtension then "buildWeb" else "build"} \ 41 + -- --standalone --disable-updater 42 + 43 + runHook postBuild 44 + ''; 45 + 46 + installPhase = '' 47 + runHook preInstall 48 + 49 + cp -r dist/${lib.optionalString buildWebExtension "chromium-unpacked/"} $out 50 + 51 + runHook postInstall 52 + ''; 53 + 54 + meta = { 55 + description = "The other cutest Discord client mod"; 56 + homepage = "https://github.com/Equicord/Equicord"; 57 + license = lib.licenses.gpl3Only; 58 + platforms = lib.platforms.linux; 59 + maintainers = [ 60 + lib.maintainers.NotAShelf 61 + ]; 62 + }; 63 + })