Skip to content

Commit 9b17341

Browse files
committed
update node-gyp patch
1 parent 9c03c9c commit 9b17341

File tree

1 file changed

+48
-16
lines changed

1 file changed

+48
-16
lines changed

patches/node-gyp.patch

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From fbea4c4c9a0643a91acbd5025a4d7053345db95d Mon Sep 17 00:00:00 2001
1+
From 5fb79ad0ed697e4e5c7188ecd229d4f10988c8a4 Mon Sep 17 00:00:00 2001
22
From: toyobayashi <[email protected]>
33
Date: Sun, 28 Jan 2024 23:21:28 +0800
4-
Subject: [PATCH 1/5] feat: `node-gyp build` with make generator on Windows
4+
Subject: [PATCH 1/6] feat: `node-gyp build` with make generator on Windows
55

66
---
77
lib/build.js | 18 ++++++++++++------
@@ -66,10 +66,10 @@ index 6b8d84d3ed..07779f8df1 100644
6666
const verbose = log.logger.isVisible('verbose')
6767
let j
6868
diff --git a/lib/configure.js b/lib/configure.js
69-
index 8da41a849d..3a39878c91 100644
69+
index e4b8c94e3d..b0fe7ec32f 100644
7070
--- a/lib/configure.js
7171
+++ b/lib/configure.js
72-
@@ -66,8 +66,18 @@ async function configure (gyp, argv) {
72+
@@ -92,8 +92,18 @@ async function configure (gyp, argv) {
7373
log.verbose(
7474
'build dir', '"build" dir needed to be created?', isNew ? 'Yes' : 'No'
7575
)
@@ -91,10 +91,10 @@ index 8da41a849d..3a39878c91 100644
9191

9292
async function createConfigFile (vsInfo) {
9393

94-
From ff228bb4e4fe9a6f30962da34ab2ffc013663ac0 Mon Sep 17 00:00:00 2001
94+
From c25782ddaec79e3ac7fb3694b3f558ea19d65960 Mon Sep 17 00:00:00 2001
9595
From: toyobayashi <[email protected]>
9696
Date: Sun, 28 Jan 2024 23:28:04 +0800
97-
Subject: [PATCH 2/5] do not add symlinks to `%Path%`
97+
Subject: [PATCH 2/6] do not add symlinks to `%Path%`
9898

9999
---
100100
lib/build.js | 20 ++++++++++----------
@@ -172,20 +172,20 @@ index 07779f8df1..fef817ea0a 100644
172172
const hasSln = argv.some(function (arg) {
173173
return path.extname(arg) === '.sln'
174174

175-
From ecd6086c4eaa07b6cdf85040a77cd5d935731fbe Mon Sep 17 00:00:00 2001
175+
From a43d5f29ae08939ff3dcc0e97b31caf01f4f3b14 Mon Sep 17 00:00:00 2001
176176
From: toyobayashi <[email protected]>
177177
Date: Mon, 29 Jan 2024 00:42:52 +0800
178-
Subject: [PATCH 3/5] also try to find visual studio if format is not msvs
178+
Subject: [PATCH 3/6] also try to find visual studio if format is not msvs
179179

180180
---
181181
lib/configure.js | 6 +++++-
182182
1 file changed, 5 insertions(+), 1 deletion(-)
183183

184184
diff --git a/lib/configure.js b/lib/configure.js
185-
index 3a39878c91..b06c6ce302 100644
185+
index b0fe7ec32f..af1cb50599 100644
186186
--- a/lib/configure.js
187187
+++ b/lib/configure.js
188-
@@ -75,7 +75,11 @@ async function configure (gyp, argv) {
188+
@@ -101,7 +101,11 @@ async function configure (gyp, argv) {
189189
const vsInfo = await findVisualStudio(release.semver, gyp.opts['msvs-version'])
190190
return createConfigFile(vsInfo)
191191
}
@@ -199,20 +199,20 @@ index 3a39878c91..b06c6ce302 100644
199199
return createConfigFile(null)
200200
}
201201

202-
From e90d7da7d26b9be72ce0a0199a70e5d624a4e035 Mon Sep 17 00:00:00 2001
202+
From 943e9d4f12085c1d03b27ba1babdd485ae725223 Mon Sep 17 00:00:00 2001
203203
From: toyobayashi <[email protected]>
204204
Date: Tue, 30 Jan 2024 18:35:38 +0800
205-
Subject: [PATCH 4/5] format can include flavor so use startsWith
205+
Subject: [PATCH 4/6] format can include flavor so use startsWith
206206

207207
---
208208
lib/configure.js | 2 +-
209209
1 file changed, 1 insertion(+), 1 deletion(-)
210210

211211
diff --git a/lib/configure.js b/lib/configure.js
212-
index b06c6ce302..60ee7412bd 100644
212+
index af1cb50599..25987bbb51 100644
213213
--- a/lib/configure.js
214214
+++ b/lib/configure.js
215-
@@ -71,7 +71,7 @@ async function configure (gyp, argv) {
215+
@@ -97,7 +97,7 @@ async function configure (gyp, argv) {
216216
if (gypFormatIndex === -1) {
217217
gypFormatIndex = argv.indexOf('--format')
218218
}
@@ -222,10 +222,10 @@ index b06c6ce302..60ee7412bd 100644
222222
return createConfigFile(vsInfo)
223223
}
224224

225-
From 709ef8fb8e8f2823f205c6c9d13b976192e88cff Mon Sep 17 00:00:00 2001
225+
From ce7badaa025beabcb9348d851ba0c82eca1d91bd Mon Sep 17 00:00:00 2001
226226
From: toyobayashi <[email protected]>
227227
Date: Tue, 4 Jun 2024 21:20:53 +0800
228-
Subject: [PATCH 5/5] exclude make generator
228+
Subject: [PATCH 5/6] exclude make generator
229229

230230
---
231231
lib/configure.js | 24 +++++++++++++++---------
@@ -269,3 +269,35 @@ index 25987bbb51..ee672cfbf2 100644
269269
return createConfigFile(vsInfo)
270270
}
271271
return createConfigFile(null)
272+
273+
From cb8bfc15ed780a6e9940bc7879f33a8d97e68b64 Mon Sep 17 00:00:00 2001
274+
From: toyobayashi <[email protected]>
275+
Date: Thu, 6 Jun 2024 22:11:41 +0800
276+
Subject: [PATCH 6/6] hoist fs
277+
278+
---
279+
lib/build.js | 5 +++--
280+
1 file changed, 3 insertions(+), 2 deletions(-)
281+
282+
diff --git a/lib/build.js b/lib/build.js
283+
index fef817ea0a..e1f49bb6ff 100644
284+
--- a/lib/build.js
285+
+++ b/lib/build.js
286+
@@ -1,6 +1,7 @@
287+
'use strict'
288+
289+
-const fs = require('graceful-fs').promises
290+
+const gracefulFs = require('graceful-fs')
291+
+const fs = gracefulFs.promises
292+
const path = require('path')
293+
const { glob } = require('glob')
294+
const log = require('./log')
295+
@@ -85,7 +86,7 @@ async function build (gyp, argv) {
296+
async function findSolutionFile () {
297+
const files = await glob('build/*.sln')
298+
if (files.length === 0) {
299+
- if (require('fs').existsSync('build/Makefile') || (await glob('build/*.mk')).length !== 0) {
300+
+ if (gracefulFs.existsSync('build/Makefile') || (await glob('build/*.mk')).length !== 0) {
301+
command = makeCommand
302+
await doWhich(false)
303+
return

0 commit comments

Comments
 (0)