diff --git a/pkgs/development/tools/electron/common.nix b/pkgs/development/tools/electron/common.nix index ec3f4fe34b46..7d8ca0b388de 100644 --- a/pkgs/development/tools/electron/common.nix +++ b/pkgs/development/tools/electron/common.nix @@ -24,6 +24,10 @@ let gclientDeps = gclient2nix.importGclientDeps info.deps; yarn-berry = yarn-berry_4; + + # Only apply to old versions after upstream updates to Yarn 4.14 + # https://github.com/electron/electron/blob/main/package.json#L148 + yarnPatch = ./yarn-4.14-support.patch; in ((chromium.override { upstream-info = info.chromium; }).mkDerivation (base: { @@ -66,6 +70,7 @@ in yarnOfflineCache = yarn-berry.fetchYarnBerryDeps { src = gclientDeps."src/electron".path; + patches = [ yarnPatch ]; hash = info.electron_yarn_hash; }; @@ -185,7 +190,16 @@ in '' + '' ( + PATH=$PATH:${ + lib.makeBinPath ( + with pkgsBuildHost; + [ + git + ] + ) + } cd electron + git apply ${yarnPatch} YARN_ENABLE_SCRIPTS=0 yarnBerryConfigHook ) ( diff --git a/pkgs/development/tools/electron/info.json b/pkgs/development/tools/electron/info.json index 9782b841607e..3760d3ce76c7 100644 --- a/pkgs/development/tools/electron/info.json +++ b/pkgs/development/tools/electron/info.json @@ -1342,7 +1342,7 @@ "fetcher": "fetchFromGitiles" } }, - "electron_yarn_hash": "sha256-HCnJJqfgcilB+Cl2OaezL9Uu1xk0ZBdVEXg2VDR1dwU=", + "electron_yarn_hash": "sha256-4wVNDVy8SMZgh3tTzytUveyBv0MwLlWpjwDgC/+WYVM=", "modules": "140", "node": "22.22.1", "version": "39.8.9" @@ -2690,7 +2690,7 @@ "fetcher": "fetchFromGitiles" } }, - "electron_yarn_hash": "sha256-0P2Kt1uJA0lmZjIOr4Bpu6NDl4CwEKEgRz/B92oCs9M=", + "electron_yarn_hash": "sha256-HSLQS89ZdIxni51WDVvr19oDZyaG/PlPG8XfdvEDQhQ=", "modules": "143", "node": "24.14.1", "version": "40.9.2" @@ -4054,7 +4054,7 @@ "fetcher": "fetchFromGitiles" } }, - "electron_yarn_hash": "sha256-tPI7O7xlvDjU5+krILVB6JhLpftMq4Bn8+KIKMjBVgA=", + "electron_yarn_hash": "sha256-i9/E2hO0vq5kbDwFLvaVl7OoixGpHxBQ6sMiHgnWYuA=", "modules": "145", "node": "24.15.0", "version": "41.3.0" diff --git a/pkgs/development/tools/electron/yarn-4.14-support.patch b/pkgs/development/tools/electron/yarn-4.14-support.patch new file mode 100644 index 000000000000..1bf5818747e2 --- /dev/null +++ b/pkgs/development/tools/electron/yarn-4.14-support.patch @@ -0,0 +1,20 @@ +diff --git a/.yarnrc.yml b/.yarnrc.yml +--- a/.yarnrc.yml ++++ b/.yarnrc.yml +@@ -12,5 +12,3 @@ npmPreapprovedPackages: + httpProxy: "${HTTP_PROXY:-}" + + httpsProxy: "${HTTPS_PROXY:-}" +- +-yarnPath: .yarn/releases/yarn-4.12.0.cjs +diff --git a/yarn.lock b/yarn.lock +--- a/yarn.lock ++++ b/yarn.lock +@@ -2,6 +2,6 @@ + # Manual changes might be lost - proceed with caution! + + __metadata: +- version: 8 ++ version: 9 + cacheKey: 10c0 +