File tree Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import nodedownload
2626
2727# imports in tools/
2828sys .path .insert (0 , os .path .join (root_dir , 'tools' ))
29+ import getmoduleversion
2930
3031# parse our options
3132parser = optparse .OptionParser ()
Original file line number Diff line number Diff line change 243243 ],
244244 'conditions' : [
245245 [ 'node_module_version!="" and OS!="win"' , {
246- 'product_extension' : 'so.<(node_module_version )' ,
246+ 'product_extension' : '<(shlib_suffix )' ,
247247 }]
248248 ],
249249 }],
Original file line number Diff line number Diff line change 1+ from __future__ import print_function
2+ import os
3+ import re
4+
5+ def get_version ():
6+ node_version_h = os .path .join (
7+ os .path .dirname (__file__ ),
8+ '..' ,
9+ 'src' ,
10+ 'node_version.h' )
11+
12+ f = open (node_version_h )
13+
14+ regex = '^#define NODE_MODULE_VERSION [0-9]+'
15+
16+ for line in f :
17+ if re .match (regex , line ):
18+ major = line .split ()[2 ]
19+ return major
20+
21+ raise Exception ('Could not find pattern matching %s' % regex )
22+
23+ if __name__ == '__main__' :
24+ print (get_version ())
Original file line number Diff line number Diff line change @@ -133,10 +133,11 @@ def files(action):
133133 if is_windows :
134134 output_file += '.dll'
135135 else :
136- # GYP will output to lib.target, this is hardcoded in its source,
137- # see the _InstallablaeTargetInstallPath function.
138- output_prefix += 'lib.target/'
139- output_file = 'lib' + output_file + '.so'
136+ output_file = 'lib' + output_file + '.' + variables .get ('shlib_suffix' )
137+ # GYP will output to lib.target except on OS X, this is hardcoded
138+ # in its source - see the _InstallableTargetInstallPath function.
139+ if sys .platform != 'darwin' :
140+ output_prefix += 'lib.target/'
140141
141142 action ([output_prefix + output_file ], 'bin/' + output_file )
142143
You can’t perform that action at this time.
0 commit comments