From 1d77b8dae7896e7fa53bdb1a3421b280474571e4 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Mon, 21 Jan 2019 16:47:14 +0100 Subject: [PATCH] Update node-pre-gyp patch and move it to another folder To prevent the apply-patches script from doing stuff Change-type: patch --- Makefile | 17 +++++++++-------- ...tron-forks-of-modules-that-use-pre-gyp.patch | 5 ++--- 2 files changed, 11 insertions(+), 11 deletions(-) rename {patches => node_modules_patches}/allow-electron-forks-of-modules-that-use-pre-gyp.patch (90%) diff --git a/Makefile b/Makefile index 00f0cef1..b7fb27cd 100644 --- a/Makefile +++ b/Makefile @@ -92,21 +92,22 @@ TARGET_ARCH ?= $(HOST_ARCH) # --------------------------------------------------------------------- # Electron # --------------------------------------------------------------------- +patches: + # patch from https://github.com/mapbox/node-pre-gyp/pull/279/files , required for lzma-native in electron child processes + # we only apply the patch if it hasn't been applied + if ! [ -f node_modules/node-pre-gyp/lib/util/versioning.js.orig ]; \ + then patch --backup --force --strip=1 --ignore-whitespace < node_modules_patches/allow-electron-forks-of-modules-that-use-pre-gyp.patch; \ + fi; -electron-develop: | $(BUILD_TEMPORARY_DIRECTORY) +electron-develop: patches | $(BUILD_TEMPORARY_DIRECTORY) $(RESIN_SCRIPTS)/electron/install.sh \ -b $(shell pwd) \ -r $(TARGET_ARCH) \ -s $(PLATFORM) \ -n $(BUILD_TEMPORARY_DIRECTORY)/npm \ -a $(S3_BUCKET) - # patch from https://github.com/mapbox/node-pre-gyp/pull/279/files , required for lzma-native in electron child processes - # we only apply the patch if it hasn't been applied - if ! [ -f node_modules/node-pre-gyp/lib/util/versioning.js.orig ]; \ - then patch --backup --force --strip=1 --ignore-whitespace < patches/allow-electron-forks-of-modules-that-use-pre-gyp.patch; \ - fi; -electron-test: +electron-test: patches $(RESIN_SCRIPTS)/electron/test.sh \ -b $(shell pwd) \ -s $(PLATFORM) @@ -114,7 +115,7 @@ electron-test: assets/dmg/background.tiff: assets/dmg/background.png assets/dmg/background@2x.png tiffutil -cathidpicheck $^ -out $@ -electron-build: assets/dmg/background.tiff | $(BUILD_TEMPORARY_DIRECTORY) +electron-build: patches assets/dmg/background.tiff | $(BUILD_TEMPORARY_DIRECTORY) $(RESIN_SCRIPTS)/electron/build.sh \ -b $(shell pwd) \ -r $(TARGET_ARCH) \ diff --git a/patches/allow-electron-forks-of-modules-that-use-pre-gyp.patch b/node_modules_patches/allow-electron-forks-of-modules-that-use-pre-gyp.patch similarity index 90% rename from patches/allow-electron-forks-of-modules-that-use-pre-gyp.patch rename to node_modules_patches/allow-electron-forks-of-modules-that-use-pre-gyp.patch index d76df60e..1dccb6f7 100644 --- a/patches/allow-electron-forks-of-modules-that-use-pre-gyp.patch +++ b/node_modules_patches/allow-electron-forks-of-modules-that-use-pre-gyp.patch @@ -1,6 +1,6 @@ --- a/node_modules/node-pre-gyp/lib/util/versioning.js +++ b/node_modules/node-pre-gyp/lib/util/versioning.js -@@ -70,7 +70,14 @@ function get_runtime_abi(runtime, target_version) { +@@ -80,7 +80,14 @@ function get_runtime_abi(runtime, target_version) { if (runtime === 'node-webkit') { return get_node_webkit_abi(runtime, target_version || process.versions['node-webkit']); } else if (runtime === 'electron') { @@ -16,7 +16,7 @@ } else { if (runtime != 'node') { throw new Error("Unknown Runtime: '" + runtime + "'"); -@@ -245,7 +252,8 @@ function get_process_runtime(versions) { +@@ -263,7 +270,8 @@ function get_process_runtime(versions) { var runtime = 'node'; if (versions['node-webkit']) { runtime = 'node-webkit'; @@ -26,4 +26,3 @@ runtime = 'electron'; } return runtime; -