void-packages/srcpkgs/atom/patches/use-system-git.patch
Alexander Lobakin 68b24d3049 atom: use system Git instead of prebuilt bundle
One of Atom's dependencies, dugite, downloads a full copy of prebuilt
Git into its node_modules directory, what is totally redundant.
Modify its "source code" to use system Git instead and remove post-install
download target.

To patch Atom package the same approach is used as in commit 4a94ed99271d
("atom: fix Fuzzy finder (git-utils)").
This reduces the total size of Atom xbps package by ~30 Mb.

Signed-off-by: Alexander Lobakin <bloodyreaper@yandex.ru>
2020-03-03 11:55:44 +01:00

51 lines
2.4 KiB
Diff

diff -Naurp0 a/package.json b/package.json
--- a/package.json 2019-12-13 22:07:42.000000000 +0300
+++ b/package.json 2019-12-19 17:00:25.029132872 +0300
@@ -52,0 +53 @@
+ "dugite": "file:packages/dugite",
diff -Naurp0 a/package-lock.json b/package-lock.json
--- a/package-lock.json 2019-12-13 22:07:42.000000000 +0300
+++ b/package-lock.json 2019-12-19 16:44:18.175132282 +0300
@@ -2530,3 +2530 @@
- "version": "1.87.5",
- "resolved": "https://registry.npmjs.org/dugite/-/dugite-1.87.5.tgz",
- "integrity": "sha512-Rfl1pJ7SaIk8kW9knOGFvVl/aRWAL7RnESs/0GMUCay/yOtVejkrDGlK8JciN5dluJbIg/4bMp0KeK3HGuQqEQ==",
+ "version": "file:packages/dugite",
@@ -3212 +3210 @@
- "dugite": "1.87.5",
+ "dugite": "file:packages/dugite",
@@ -6992 +6990 @@
- "dugite": "^1.86.0",
+ "dugite": "file:packages/dugite",
diff -Naurp0 a/packages/dugite/build/lib/git-environment.js b/packages/dugite/build/lib/git-environment.js
--- a/packages/dugite/build/lib/git-environment.js 1985-10-26 11:15:00.000000000 +0300
+++ b/packages/dugite/build/lib/git-environment.js 2019-12-19 15:13:56.919818081 +0300
@@ -4,12 +3,0 @@ const path = require("path");
-function resolveEmbeddedGitDir() {
- if (process.platform === 'darwin' ||
- process.platform === 'linux' ||
- process.platform === 'android' ||
- process.platform === 'win32') {
- const s = path.sep;
- return path
- .resolve(__dirname, '..', '..', 'git')
- .replace(/[\\\/]app.asar[\\\/]/, `${s}app.asar.unpacked${s}`);
- }
- throw new Error('Git not supported on platform: ' + process.platform);
-}
@@ -27 +15 @@ function resolveGitDir() {
- return resolveEmbeddedGitDir();
+ return '/usr';
@@ -108,7 +95,0 @@ function setupEnvironment(environmentVar
- if (!env.GIT_SSL_CAINFO && !env.LOCAL_GIT_DIRECTORY) {
- // use the SSL certificate bundle included in the distribution only
- // when using embedded Git and not providing your own bundle
- const distDir = resolveEmbeddedGitDir();
- const sslCABundle = `${distDir}/ssl/cacert.pem`;
- env.GIT_SSL_CAINFO = sslCABundle;
- }
diff -Naurp0 a/packages/dugite/package.json b/packages/dugite/package.json
--- a/packages/dugite/package.json 1985-10-26 11:15:00.000000000 +0300
+++ b/packages/dugite/package.json 2019-12-19 15:19:07.645889964 +0300
@@ -16 +15,0 @@
- "postinstall": "node ./script/download-git.js",