opencv-build
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -70,6 +70,21 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var autoBuildFile, hasLibs, err_1; | ||
var rootPackageJSON, autoBuildFile, hasLibs, err_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (process.env.INIT_CWD) { | ||
rootPackageJSON = require(path.resolve(process.env.INIT_CWD, 'package.json')); | ||
if (rootPackageJSON.opencv4nodejs && | ||
rootPackageJSON.opencv4nodejs.autoBuildFlags) { | ||
if (process.env.OPENCV4NODEJS_AUTOBUILD_FLAGS) { | ||
process.env.OPENCV4NODEJS_AUTOBUILD_FLAGS = [ | ||
process.env.OPENCV4NODEJS_AUTOBUILD_FLAGS, | ||
rootPackageJSON.opencv4nodejs.autoBuildFlags | ||
].join(' '); | ||
} | ||
else { | ||
process.env.OPENCV4NODEJS_AUTOBUILD_FLAGS = rootPackageJSON.opencv4nodejs.autoBuildFlags; | ||
} | ||
} | ||
} | ||
if (env_1.isAutoBuildDisabled()) { | ||
@@ -76,0 +91,0 @@ log.info('install', 'OPENCV4NODEJS_DISABLE_AUTOBUILD is set'); |
{ | ||
"name": "opencv-build", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "A simple script to auto build recent OpenCV + contrib version via npm", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -20,1 +20,13 @@ [![Build Status](https://travis-ci.org/justadudewhohacks/npm-opencv-build.svg?branch=master)](http://travis-ci.org/justadudewhohacks/npm-opencv-build) | ||
``` | ||
## Custom flags | ||
It's possible to specify custom flags to build process inserting on the `package.json` where the dependency is declared an object like: | ||
```json | ||
{ | ||
... | ||
"opencv4nodejs": { | ||
"autoBuildFlags": "-DOPENCV_GENERATE_PKGCONFIG=ON -DOPENCV_PC_FILE_NAME=opencv.pc" | ||
} | ||
} | ||
``` | ||
these flags will be used during building in the same way as described [here](https://github.com/justadudewhohacks/opencv4nodejs#auto-build-flags). |
@@ -41,2 +41,21 @@ import * as fs from 'fs'; | ||
export async function install() { | ||
if (process.env.INIT_CWD) { | ||
let rootPackageJSON = require(path.resolve(process.env.INIT_CWD, 'package.json')) | ||
if (rootPackageJSON.opencv4nodejs && | ||
rootPackageJSON.opencv4nodejs.autoBuildFlags) { | ||
if (process.env.OPENCV4NODEJS_AUTOBUILD_FLAGS) { | ||
process.env.OPENCV4NODEJS_AUTOBUILD_FLAGS = [ | ||
process.env.OPENCV4NODEJS_AUTOBUILD_FLAGS, | ||
rootPackageJSON.opencv4nodejs.autoBuildFlags | ||
].join(' ') | ||
} else { | ||
process.env.OPENCV4NODEJS_AUTOBUILD_FLAGS = rootPackageJSON.opencv4nodejs.autoBuildFlags | ||
} | ||
} | ||
} | ||
if (isAutoBuildDisabled()) { | ||
@@ -43,0 +62,0 @@ log.info('install', 'OPENCV4NODEJS_DISABLE_AUTOBUILD is set') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87370
1707
32
20