$OpenBSD: patch-deps_npm_node_modules_node-gyp_lib_install_js,v 1.10 2018/09/19 19:10:27 abieber Exp $

Allow building of sub-packages (ie. node-sqlite3) with USE_SYSTRACE
set, also prevents downloading of the node distfile again.

Index: deps/npm/node_modules/node-gyp/lib/install.js
--- deps/npm/node_modules/node-gyp/lib/install.js.orig
+++ deps/npm/node_modules/node-gyp/lib/install.js
@@ -145,7 +145,7 @@ function install (fs, gyp, argv, callback) {
       }
 
       // now download the node tarball
-      var tarPath = gyp.opts.tarball
+      var tarPath = gyp.opts['tarball'] || '${PREFIX}/share/node/${DISTNAME}${EXTRACT_SUFX}' // Fix for OpenBSD
       var badDownload = false
         , extractCount = 0
         , gunzip = zlib.createGunzip()
