Skip to content

Commit

Permalink
fix(prebuildify-cross): patching packages to fix prebuilding
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Serafin committed Sep 25, 2024
1 parent 0f5b456 commit 19a4c6f
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 15 deletions.
36 changes: 21 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,44 @@
"node": ">=6"
},
"dependencies": {
"debug": "^4.3.4",
"debug": "^4.3.7",
"napi-thread-safe-callback": "^0.0.6",
"node-addon-api": "^4.3.0",
"node-gyp-build": "^4.6.1"
"node-addon-api": "^8.1.0",
"node-gyp-build": "^4.8.1",
"patch-package": "^8.0.0"
},
"optionalDependencies": {
"@stoprocent/bluetooth-hci-socket": "^1.3.0"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@eslint/js": "^9.7.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"async": "^3.2.5",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.1.1",
"async": "^3.2.6",
"cross-env": "^7.0.3",
"eslint": "^8",
"eslint-config-semistandard": "^17.0.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^15.6.0",
"eslint-plugin-promise": "^6.2.0",
"mocha": "^10.4.0",
"node-gyp": "^10.0.0",
"nyc": "^15.1.0",
"eslint": "^8.57.1",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-n": "^17.10.3",
"eslint-plugin-promise": "^7.1.0",
"mocha": "^10.7.0",
"nyc": "^17.0.0",
"prebuildify": "^6.0.1",
"prebuildify-cross": "^5.1.0",
"prettier": "^2.8.1",
"semantic-release": "^24.1.1",
"jshint": "^2.13.6",
"prettier": "^3.3.3",
"proxyquire": "^2.1.3",
"semantic-release": "^23.1.1",
"should": "^13.2.3",
"sinon": "^15.0.1",
"ws": "^8.11.0"
},
"scripts": {
"install": "node-gyp-build",
"postinstall": "patch-package",
"lint": "eslint \"**/*.js\"",
"lint-fix": "eslint \"**/*.js\" --fix",
"prebuildify": "prebuildify --napi --target 14.0.0 --force --strip --verbose",
Expand Down
13 changes: 13 additions & 0 deletions patches/@vweevers+docker-pull+1.1.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@vweevers/docker-pull/index.js b/node_modules/@vweevers/docker-pull/index.js
index 67b3e73..bac4a84 100644
--- a/node_modules/@vweevers/docker-pull/index.js
+++ b/node_modules/@vweevers/docker-pull/index.js
@@ -12,7 +12,7 @@ var pull = function (image, opts, cb) {
image = parse(image)
if (!image) throw new Error('Invalid image')

- var request = docker({host: opts.host, version: opts.version || 'v1.21'})
+ var request = docker({host: opts.host, version: opts.version || 'v1.24'})
var that = new events.EventEmitter()
var layers = {}
var progress = {}
13 changes: 13 additions & 0 deletions patches/docker-run+3.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/docker-run/index.js b/node_modules/docker-run/index.js
index ea7fc0d..1f08702 100644
--- a/node_modules/docker-run/index.js
+++ b/node_modules/docker-run/index.js
@@ -14,7 +14,7 @@ var endsWith = function(str, suffix) {
var run = function(image, opts) {
if (!opts) opts = {}

- var request = docker(opts.host, {version:'v1.14'})
+ var request = docker(opts.host, {version:'v1.24'})
var that = new events.EventEmitter()
var tty = !!opts.tty

26 changes: 26 additions & 0 deletions patches/prebuildify-cross+5.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/node_modules/prebuildify-cross/guest.js b/node_modules/prebuildify-cross/guest.js
index dfd9eb7..c660f86 100644
--- a/node_modules/prebuildify-cross/guest.js
+++ b/node_modules/prebuildify-cross/guest.js
@@ -10,18 +10,12 @@ const files = JSON.parse(process.env.PREBUILDIFY_CROSS_FILES)
const argv = process.argv.slice(2)

// Copy host files to working directory
-for (const file of files) {
- const a = path.join('/input', file)
- const b = path.join(cwd, file)
+fs.cpSync("/input", cwd, { recursive: true })

- fs.mkdirSync(path.dirname(b), { recursive: true })
- fs.copyFileSync(a, b, fs.constants.COPYFILE_EXCL)
- fs.chmodSync(b, 0o644)
+if (fs.existsSync(cwd + "/build")) {
+ fs.rmSync(cwd + "/build", { recursive: true, })
}

-// Use node_modules of host to avoid a second install step
-fs.symlinkSync('/input/node_modules', path.join(cwd, 'node_modules'))
-
const stdio = ['ignore', 2, 2]
const res = cp.spawnSync('npx', ['--no-install', 'prebuildify', ...argv], { cwd, stdio })

0 comments on commit 19a4c6f

Please sign in to comment.