Unverified Commit 107df089 authored by Sefa Eyeoglu's avatar Sefa Eyeoglu Committed by GitHub
Browse files

vesktop: specify electron version (#486865)

parents b4a79a4c 0f06b79e
Loading
Loading
Loading
Loading
+22 −10
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
  makeDesktopItem,
  copyDesktopItems,
  vencord,
  electron,
  electron_40,
  libicns,
  pipewire,
  libpulseaudio,
@@ -17,6 +17,7 @@
  fetchPnpmDeps,
  pnpmConfigHook,
  nodejs,
  jq,
  nix-update-script,
  withTTS ? true,
  withMiddleClickScroll ? false,
@@ -24,6 +25,9 @@
  # letting vesktop manage it's own version
  withSystemVencord ? false,
}:
let
  electron = electron_40;
in
stdenv.mkDerivation (finalAttrs: {
  pname = "vesktop";
  version = "1.6.4";
@@ -51,6 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
    nodejs
    pnpmConfigHook
    pnpm_10
    jq
  ]
  ++ lib.optionals stdenv.hostPlatform.isLinux [
    # vesktop uses venmic, which is a shipped as a prebuilt node module
@@ -89,8 +94,15 @@ stdenv.mkDerivation (finalAttrs: {
  '';

  # electron builds must be writable
  preBuild =
    lib.optionalString stdenv.hostPlatform.isDarwin ''
  preBuild = ''
    # Validate electron version matches upstream package.json
    if [ "`jq -r '.devDependencies.electron' < package.json | cut -d. -f1 | tr -d '^'`" != "${lib.versions.major electron.version}" ]
    then
      echo "ERROR: electron version mismatch between package.json and nixpkgs"
      exit 1
    fi
  ''
  + lib.optionalString stdenv.hostPlatform.isDarwin ''
    cp -r ${electron.dist}/Electron.app .
    chmod -R u+w Electron.app
  ''