pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/npm lang/npm: Limit Python version t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6ca1d80e3dd1
branches:  trunk
changeset: 307275:6ca1d80e3dd1
user:      fhajny <fhajny%pkgsrc.org@localhost>
date:      Fri May 04 13:23:53 2018 +0000
description:
lang/npm: Limit Python version to 2.7, fix path to interpreter.

diffstat:

 lang/npm/Makefile                                              |  12 +++-
 lang/npm/distinfo                                              |   3 +-
 lang/npm/patches/patch-node__modules_node-gyp_lib_configure.js |  30 ++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)

diffs (87 lines):

diff -r b043d2c07d9e -r 6ca1d80e3dd1 lang/npm/Makefile
--- a/lang/npm/Makefile Fri May 04 09:40:02 2018 +0000
+++ b/lang/npm/Makefile Fri May 04 13:23:53 2018 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.3 2018/05/04 09:40:02 adam Exp $
+# $NetBSD: Makefile,v 1.4 2018/05/04 13:23:53 fhajny Exp $
 
 DISTNAME=      npm-6.0.0
+PKGREVISION=   1
 CATEGORIES=    lang
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=npm/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}
@@ -17,12 +18,20 @@
 
 USE_TOOLS+=    gmake perl
 
+PYTHON_VERSIONS_INCOMPATIBLE=  34 35 36 # required by gyp scripts included
+
 REPLACE_INTERPRETER+=  node
 REPLACE.node.old=      .*node
 REPLACE.node.new=      ${PREFIX}/bin/node
 REPLACE_FILES.node=    bin/npm-cli.js
 REPLACE_FILES.node+=   bin/npx-cli.js
 
+SUBST_CLASSES+=                python
+SUBST_STAGE.python=    pre-configure
+SUBST_FILES.python=    node_modules/node-gyp/lib/configure.js
+SUBST_MESSAGE.python=  Fixing path to Python
+SUBST_VARS.python=     PYTHONBIN
+
 CHECK_INTERPRETER_SKIP+=lib/node_modules/npm/*
 
 .include "../../mk/bsd.prefs.mk"
@@ -42,4 +51,5 @@
 .endif
 
 .include "../../lang/nodejs/nodeversion.mk"
+.include "../../lang/python/pyversion.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r b043d2c07d9e -r 6ca1d80e3dd1 lang/npm/distinfo
--- a/lang/npm/distinfo Fri May 04 09:40:02 2018 +0000
+++ b/lang/npm/distinfo Fri May 04 13:23:53 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2018/05/04 09:40:02 adam Exp $
+$NetBSD: distinfo,v 1.4 2018/05/04 13:23:53 fhajny Exp $
 
 SHA1 (marked-0.3.19.tar.gz) = d30691ac399f05d156f40a0a893ce7a2a7f6c5be
 RMD160 (marked-0.3.19.tar.gz) = e78a28dfaf5fc1039e48f63228f892fa24a13e6f
@@ -11,3 +11,4 @@
 SHA1 (patch-Makefile) = b5f882d5ab883bfdb527a5802a0f477feef3eb27
 SHA1 (patch-node__modules_node-gyp_gyp_pylib_gyp_generator_make.py) = 291e079fb48caea7501ab864c19ef26672b76bc5
 SHA1 (patch-node__modules_node-gyp_gyp_pylib_gyp_xcode__emulation.py) = 7f9f5cd8aadafd309ba8dfb27f96fe8fa56a8af8
+SHA1 (patch-node__modules_node-gyp_lib_configure.js) = 5cee993904ffeb1497418706e258c2e61bbd847e
diff -r b043d2c07d9e -r 6ca1d80e3dd1 lang/npm/patches/patch-node__modules_node-gyp_lib_configure.js
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/npm/patches/patch-node__modules_node-gyp_lib_configure.js    Fri May 04 13:23:53 2018 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-node__modules_node-gyp_lib_configure.js,v 1.1 2018/05/04 13:23:53 fhajny Exp $
+
+Skip Python detection, version 2.7 is required and we know where it is.
+
+--- node_modules/node-gyp/lib/configure.js.orig        2018-04-24 05:41:37.000000000 +0000
++++ node_modules/node-gyp/lib/configure.js
+@@ -29,21 +29,14 @@ exports.usage = 'Generates ' + (win ? 'M
+ 
+ function configure (gyp, argv, callback) {
+ 
+-  var python = gyp.opts.python || process.env.PYTHON || 'python2'
++  var python = '@PYTHONBIN@'
+     , buildDir = path.resolve('build')
+     , configNames = [ 'config.gypi', 'common.gypi' ]
+     , configs = []
+     , nodeDir
+     , release = processRelease(argv, gyp, process.version, process.release)
+ 
+-  findPython(python, function (err, found) {
+-    if (err) {
+-      callback(err)
+-    } else {
+-      python = found
+-      getNodeDir()
+-    }
+-  })
++  getNodeDir()
+ 
+   function getNodeDir () {
+ 



Home | Main Index | Thread Index | Old Index