File tree 4 files changed +31
-5
lines changed
4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import nodedownload
26
26
27
27
# imports in tools/
28
28
sys .path .insert (0 , os .path .join (root_dir , 'tools' ))
29
+ import getmoduleversion
29
30
30
31
# parse our options
31
32
parser = optparse .OptionParser ()
Original file line number Diff line number Diff line change 243
243
],
244
244
'conditions' : [
245
245
[ 'node_module_version!="" and OS!="win"' , {
246
- 'product_extension' : 'so.<(node_module_version )' ,
246
+ 'product_extension' : '<(shlib_suffix )' ,
247
247
}]
248
248
],
249
249
}],
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):
133
133
if is_windows :
134
134
output_file += '.dll'
135
135
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/'
140
141
141
142
action ([output_prefix + output_file ], 'bin/' + output_file )
142
143
You can’t perform that action at this time.
0 commit comments