commit | 1d57e79b57b407aaf45b81eec64594547306b84e | [log] [tgz] |
---|---|---|
author | Mike Frysinger <vapier@chromium.org> | Fri Mar 24 03:50:53 2017 |
committer | Mike Frysinger <vapier@chromium.org> | Fri Mar 24 03:54:31 2017 |
tree | b80fedaa3ad41b26e29872645664bf44de557ec3 | |
parent | 3878e753aefb54de4a53fbafe31f2b5a5f819364 [diff] |
fix thinko in assert statement Make sure we use string concatenation for the message to console.assert and not pass extra args which will simply be ignored. Change-Id: I5b182fdab9f604436788eed4d981fe4be7555789
This is the ZIP Unpacker extension used in Chrome OS to support reading and unpacking of zip archives.
Since the code is built with NaCl, you‘ll need its toolchain. See the download page. The install location does not matter as it’ll be set via NACL_SDK_ROOT
.
You should install the current stable version.
$ wget https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip $ unzip -u nacl_sdk.zip $ ./nacl_sdk/naclsdk install
Then configure the path to the root of the specific SDK version.
# This assumes there's only one version of the SDK. $ export NACL_SDK_ROOT=$(echo ${PWD}/nacl_sdk/pepper_*)
We'll use libraries from webports. See How to Checkout.
The install location does not matter as it'll be set via WEBPORTS_PATH
.
Make sure to checkout the branch that matches the version of the SDK you‘re using. If you’re using pepper_47
, then check out the pepper_47
branch.
$ cd src $ branch=$(basename "${NACL_SDK_ROOT}") $ git checkout -b ${branch} remotes/origin/${branch} $ cd .. $ export WEBPORTS_PATH=${PWD}
First install npm using your normal packaging system. On Debian, you'll want something like:
$ sudo apt-get install npm
Then install the npm modules that we require. Do this in the root of the unpacker repo.
$ npm install bower 'vulcanize@<0.8'
Once done, install the libarchive-fork from third-party of the unpacker project. Note that you cannot use libarchive nor libarchive-dev packages from webports at this moment, as not all patches in the fork are upstreamed.
$ cd third-party $ make libarchive-fork
Polymer is used for UI. In order to fetch it, in the same directory type:
$ make polymer
Build the PNaCl module.
$ cd unpacker $ make [debug]
The package can be found in the release or debug directory. You can run it directly from there using Chrome's “Load unpacked extension” feature, or you can zip it up for posting to the Chrome Web Store.
$ zip -r release.zip release/
Once it's loaded, you should be able to open ZIP archives in the Files app.
To see debug messages open chrome from a terminal and check the output. For output redirection see https://developer.chrome.com/native-client/devguide/devcycle/debugging.
Install Karma for tests runner, Mocha for asynchronous testings, Chai for assertions, and Sinon for spies and stubs.
$ npm install --save-dev \ karma karma-chrome-launcher karma-cli \ mocha karma-mocha karma-chai chai karma-sinon sinon # Run tests: $ cd unpacker-test $ ./run_js_tests.sh # JavaScript tests. $ ./run_cpp_tests.sh # C++ tests. # Check JavaScript code using the Closure JS Compiler. # See https://www.npmjs.com/package/closurecompiler $ cd unpacker $ npm install google-closure-compiler $ bash check_js_for_errors.sh