This repository was archived by the owner on Oct 18, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 1+ const { execSync } = require ( "child_process" ) ;
2+ const isX64 = process . arch === "x64" ;
3+
4+ const install = ( pkg ) => {
5+ execSync ( `npm install ${ pkg } ` ) ;
6+ }
7+
8+ const packages = {
9+ "darwin" : [
10+ ] ,
11+ "win32" : [
12+ ] ,
13+ "linux" : [
14+ ]
15+ }
16+
17+ if ( ! isX64 ) {
18+ console . log ( "Unsupported platform, only x64 is supported." ) ;
19+ process . exit ( - 1 ) ;
20+ }
21+
22+ const op = process . platform ;
23+
24+ console . log ( `Installing prebuilt OpenCV v${ process . env . npm_package_opencv } for plattform ${ op } ` ) ;
25+ install ( `@nut-tree/opencv-build-${ op } @${ process . env . npm_package_opencv } ` ) ;
26+ packages [ op ] . forEach ( pkg => {
27+ console . log ( `Installing additional runtime dependency '${ pkg } '` ) ;
28+ install ( pkg ) ;
29+ } ) ;
30+ console . log ( `Done.` ) ;
Original file line number Diff line number Diff line change 3333 "main" : " ./lib/opencv4nodejs.js" ,
3434 "typings" : " ./lib/index.d.ts" ,
3535 "scripts" : {
36+ "preinstall" : " node ./install.js" ,
3637 "install" : " prebuild-install --tag-prefix \"\" || node-gyp rebuild" ,
3738 "configure" : " node-gyp configure" ,
3839 "build" : " node-gyp configure build" ,
4647 "macro-inferno" : " ^0.2.3" ,
4748 "nan" : " ^2.12.1" ,
4849 "native-node-utils" : " ^0.1.5" ,
49- "prebuild-install" : " ^5.3.0" ,
50- "@nut-tree/opencv-build" : " ^1.0.0"
50+ "prebuild-install" : " ^5.3.0"
5151 },
5252 "optionalDependencies" : {
5353 "@types/node" : " >6"
5454 },
5555 "devDependencies" : {
5656 "prebuild" : " ^8.2.0"
57- }
57+ },
58+ "opencv" : " 3.4.6-beta3"
5859}
You can’t perform that action at this time.
0 commit comments