-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bundling of 3rdparty apps for receipt-scanner #7
Conversation
5ff7714
to
1982759
Compare
Release builds now work, but with one caveat. To build it, you need to define PKG_CONFIG_PATH=$(pwd)/thirdparty/opencv/lib/pkgconfig npm run release This should be included somewhere in the dev setup though so it happens automatically. Current file size is 389.6 MB. Breakdown:
|
e067fe2
to
5df3266
Compare
Current coverage is 93.37% (diff: 100%)@@ master #7 diff @@
==========================================
Files 3 3
Lines 166 166
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 155 155
Misses 11 11
Partials 0 0
|
Overall this PR is ready for 👀, and can be shipped. There're a few minor things that can be done, namely removing all unnecessary files. We can probably remove 20MB+. |
Current file size is 332.8 MB. Breakdown:
DMG: 103.5 MB I think this is good for now. @Schultzer can you take a 👀 on this and let me know if there's anything else we could rip out of third party dependencies. |
cf1cdb6
to
9bdadb5
Compare
Removed a lot of unnecessary opencv libraries. Current file size is 302.6 MB. Breakdown:
DMG: 94.2 MB |
849b487
to
220c81a
Compare
I've added all eng related |
79a3c8a
to
b2992b7
Compare
Removed a lot of unnecessary
|
b2992b7
to
3ef00ed
Compare
Was a lot of work to get node-opencv to work with available modules, but it's working now. I'll put up a PR soon to fix it upstream, but for now, we'll just use the branch to build. |
e55208b
to
17bd239
Compare
17bd239
to
677f77a
Compare
90577b5
to
2d41235
Compare
The last detail in this is
I'm not sure if we should support JPEG 2000 ( The support is limited: http://caniuse.com/#feat=jpeg2000 |
Removed |
31c80bb
to
dee4000
Compare
We only need to run the build scripts on mac when doing release.
- Moved thirdparty dependencies to Resources location - Removed most tesseract trained data, just keeping eng and osd (orientation) - Update readme with PKG_CONFIG_PATH instructions
Make untar silent
There’s not really a need for libopenjpeg, since only poppler required it, and it was not compiled into anything else. Enabled zlib again on leptonica.
dee4000
to
9137052
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should follow #21 with a uniform syntax and use single quotation marks and only use double quotation marks when escaping single quotation in out JS code base.
var thirdpartyPath = getResourcesPath('thirdparty'), | ||
env = {}; | ||
|
||
if (process.platform == 'darwin') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(process.platform == 'darwin')
this should be (process.platform === 'darwin')
-D WITH_IPP=ON \ | ||
-D WITH_OPENCL=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF -D BUILD_opencv_gpuarithm=OFF -D BUILD_opencv_gpubgsegm=OFF -D BUILD_opencv_gpucodec=OFF -D BUILD_opencv_gpufeatures2d=OFF -D BUILD_opencv_gpufilters=OFF -D BUILD_opencv_gpuimgproc=OFF -D BUILD_opencv_gpulegacy=OFF -D BUILD_opencv_gpuoptflow=OFF -D BUILD_opencv_gpustereo=OFF -D BUILD_opencv_gpuwarping=OFF -D BUILD_opencv_shape=OFF -D BUILD_opencv_stiching=OFF -D BUILD_opencv_superres=OFF -D BUILD_opencv_objdetect=OFF \ | ||
-D BUILD_TIFF=OFF -D BUILD_PNG=OFF -D BUILD_JPEG=OFF -D BUILD_ZLIB=OFF -D WITH_JASPER=OFF -D WITH_OPENEXR=OFF \ | ||
-D BUILD_opencv_highgui=OFF -D BUILD_opencv_flann=OFF -D BUILD_opencv_ml=OFF -D BUILD_opencv_calib3d=OFF -D BUILD_opencv_videoio=OFF -D BUILD_opencv_video=OFF -D BUILD_opencv_videostab=OFF -D BUILD_opencv_java=OFF -DBUILD_opencv_python=OFF \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-DBUILD_opencv_python=OFF
This should be -D BUILD_opencv_python=OFF
if (process.platform == 'darwin') { | ||
// Set 3rd party binaries and libraries | ||
env.PATH = [ | ||
"$PATH", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"$PATH"
should be '$PATH'
we should use single quotation marks for strings
// Set 3rd party binaries and libraries | ||
env.PATH = [ | ||
"$PATH", | ||
thirdpartyPath + "/poppler/bin", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/poppler/bin"
should be '/poppler/bin'
env.PATH = [ | ||
"$PATH", | ||
thirdpartyPath + "/poppler/bin", | ||
thirdpartyPath + "/tesseract/bin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/tesseract/bin"
should be /tesseract/bin
gutil.log("Going to build for", gutil.colors.cyan("'" + platform + "'")); | ||
|
||
var buildCommand = [ | ||
"BUILDDIR=" + buildDir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"BUILDDIR="
should be 'BUILDDIR='
|
||
var buildCommand = [ | ||
"BUILDDIR=" + buildDir, | ||
"THIRDPARTYDIR=" + buildDestDir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"THIRDPARTYDIR="
should be 'THIRDPARTYDIR='
"BUILDDIR=" + buildDir, | ||
"THIRDPARTYDIR=" + buildDestDir, | ||
'sh ' + buildScript, | ||
].join(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
join(" ");
should be join(' ');
}, | ||
function(error, stdout, stderr) { | ||
if (!error) { | ||
gutil.log("Build succesful"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gutil.log("Build succesful");
should be gutil.log('Build succesful');
gutil.log("Build succesful"); | ||
resolve(); | ||
} else { | ||
gutil.log("Build failed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gutil.log("Build failed");
should be gutil.log('Build failed');
08c07bc
to
f18e930
Compare
Resolves #2
share/man
filesinclude
filesSet(added readme instead)PKG_CONFIG_PATH
env var onnpm install
Use Core Graphics instead of compiling libjpeg, libtiff, etc?(can't be used)