Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit cc548b1

Browse files
author
Simon Hofmann
committed
Updated bundling process
1 parent f327735 commit cc548b1

File tree

7 files changed

+21
-10
lines changed

7 files changed

+21
-10
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ test_script:
6868
on_success:
6969
- cmd: cd c:\projects\opencv4nodejs
7070
- IF defined APPVEYOR_REPO_TAG_NAME (
71-
npm run prebuild -- -u %GITHUB_TOKEN%
71+
npm run prebuild -- --include-regex "\.(node|a|so|dylib|lib|dll)$" -u %GITHUB_TOKEN%
7272
)

binding.gyp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"cc/core/TermCriteria.cc",
3636
"cc/modules/io/io.cc",
3737
],
38-
3938
"cflags" : [
4039
"-std=c++11"
4140
],
@@ -57,7 +56,6 @@
5756
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
5857
"MACOSX_DEPLOYMENT_TARGET": "10.9"
5958
},
60-
6159
"conditions": [
6260
[ "OS==\"win\"", {
6361
"cflags": [
@@ -82,6 +80,14 @@
8280
"ldflags": ["--coverage"]
8381
},
8482
}
85-
83+
},
84+
{
85+
"target_name": "action_after_build",
86+
"type": "none",
87+
"dependencies": [ "opencv4nodejs" ],
88+
"copies": [{
89+
"files": [ "<!@(node ./lib/bundle.js)" ],
90+
"destination": "<(PRODUCT_DIR)"
91+
}]
8692
}]
8793
}

ci/prebuild/prebuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ npm install --unsafe-perm &&\
44
cd test
55
npm install && npm test
66
cd -
7-
npm run prebuild -- -u $GITHUB_TOKEN;
7+
npm run prebuild -- --include-regex "\.(node|a|so|dylib|lib|dll)$" -u $GITHUB_TOKEN;

lib/bundle.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const { opencvLibDir } = require("./dirs");
2+
const { readdirSync, realpathSync } = require("fs");
3+
const { join } = require("path");
4+
5+
for (const file of readdirSync(opencvLibDir)) {
6+
console.log(join(realpathSync(opencvLibDir), file));
7+
}

lib/dirs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const isOSX = () => process.platform == 'darwin'
66

77
const isUnix = () => !isWin() && !isOSX();
88

9-
const rootDir = `../node_modules/@nut-tree/opencv-build-${process.platform}`
9+
const rootDir = `node_modules/@nut-tree/opencv-build-${process.platform}`
1010
const opencvRoot = join(rootDir, 'opencv');
1111
const opencvBuild = join(opencvRoot, 'build');
1212
const opencvInclude = join(opencvBuild, 'include');

lib/libs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ if (linkSystemLibs()) {
1515
}
1616

1717
// if not windows, link libs dynamically
18-
console.log('-L' + opencvLibDir);
18+
console.log(`-L${resolvePath(opencvLibDir)}`);
1919
opencvBuild.opencvModules.forEach(lib => console.log(`-lopencv_${lib}`));
20-
console.log('-Wl,-rpath,' + opencvLibDir);

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
},
4545
"gypfile": true,
4646
"dependencies": {
47-
"@nut-tree/opencv-build-darwin": "^3.4.6",
4847
"macro-inferno": "^0.2.3",
4948
"nan": "^2.12.1",
5049
"native-node-utils": "^0.1.5",
@@ -56,5 +55,5 @@
5655
"devDependencies": {
5756
"prebuild": "^8.2.0"
5857
},
59-
"opencv": "3.4.6"
58+
"opencv": "3.4.6-local"
6059
}

0 commit comments

Comments
 (0)