File electron-version-from-env.patch of Package nodejs-electron.v3
Do not try to get version from git repository tags. We are not building from a git checkout.
--- src/electron/script/lib/get-version.js.old 2022-11-01 16:48:22.401632400 +0000
+++ src/electron/script/lib/get-version.js 2022-11-01 20:04:47.283620900 +0000
@@ -11,12 +11,5 @@
// The only difference in the "git describe" technique is that technically a commit can "change" it's version
// number if a tag is created / removed retroactively. i.e. the first time a commit is pushed it will be 1.2.3
// and after the tag is made rebuilding the same commit will result in it being 1.2.4
- const output = spawnSync('git', ['describe', '--tags', '--abbrev=0'], {
- cwd: path.resolve(__dirname, '..', '..')
- });
- if (output.status !== 0) {
- console.error(output.stderr);
- throw new Error('Failed to get current electron version');
- }
- return output.stdout.toString().trim().replace(/^v/g, '');
+ return process.env.SUSE_ELECTRON_VERSION
};
--- src/electron/BUILD.gn.old 2022-11-01 16:48:22.313588400 +0000
+++ src/electron/BUILD.gn 2022-11-01 20:50:40.467344500 +0000
@@ -111,8 +111,6 @@
[],
"trim string",
[
- ".git/packed-refs",
- ".git/HEAD",
"script/lib/get-version.js",
])