2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 # This script builds out/pnacl_multicrx_<rev>.zip for upload to the Chrome
7 # Web Store. It runs gyp + ninja once for each architecture and assembles
8 # the results along with a manifest file.
10 # TODO(sbc): rewrite this in python
15 SCRIPT_DIR
="$(cd $(dirname $0) && pwd)"
16 CHROME_SRC
=$
(dirname $
(dirname $
(dirname ${SCRIPT_DIR})))
20 # The original version of the script ran 'gclient runhooks' which run turn
21 # runs gyp_chromium. However its a lot faster and quieter to just run the
22 # gyp file containing the target we need.
23 gyp_dir
=ppapi
/native_client
/src
/untrusted
/pnacl_support_extension
24 build
/gyp_chromium
--depth=.
$gyp_dir/pnacl_support_extension.gyp
27 individual_packages
() {
28 export GYP_GENERATOR_FLAGS
="output_dir=out_pnacl"
29 local base_out_dir
=out
33 GYP_DEFINES
="target_arch=arm" run_gyp
34 ninja
-C out_pnacl
/Release
/ pnacl_support_extension
35 local target_dir
=${base_out_dir}/pnacl_arm
36 mkdir
-p ${target_dir}
37 cp out_pnacl
/Release
/pnacl
/* ${target_dir}/.
41 GYP_DEFINES
="target_arch=ia32" run_gyp
42 ninja
-C out_pnacl
/Release
/ pnacl_support_extension
43 target_dir
=${base_out_dir}/pnacl_x86_32
44 mkdir
-p ${target_dir}
45 cp out_pnacl
/Release
/pnacl
/* ${target_dir}/.
49 GYP_DEFINES
="target_arch=x64" run_gyp
50 ninja
-C out_pnacl
/Release
/ pnacl_support_extension
51 target_dir
=${base_out_dir}/pnacl_x86_64
52 mkdir
-p ${target_dir}
53 cp out_pnacl
/Release
/pnacl
/* ${target_dir}/.
59 local base_out_dir
=out
60 local target_dir
=${base_out_dir}/pnacl_multicrx
61 mkdir
-p ${target_dir}
62 cat > ${target_dir}/manifest.json
<<EOF
64 "description": "Portable Native Client Translator Multi-CRX",
65 "name": "PNaCl Translator Multi-CRX",
66 "manifest_version": 2,
67 "minimum_chrome_version": "30.0.0.0",
68 "version": "${version}",
71 "nacl_arch": "x86-32",
72 "sub_package_path": "_platform_specific/x86_32/"
75 "nacl_arch": "x86-64",
76 "sub_package_path": "_platform_specific/x86_64/"
80 "sub_package_path": "_platform_specific/arm/"
86 for arch
in x86_32 x86_64 arm
; do
87 local sub_dir
="${target_dir}/_platform_specific/${arch}"
88 local src_dir
="${base_out_dir}/pnacl_${arch}"
90 cp ${src_dir}/pnacl_public_
* ${sub_dir}/.
92 (cd ${target_dir} && zip -r ../${outfile} . && ls -l ../${outfile})
93 echo "DONE: created ${outfile} -- upload that!"
94 echo "You can also delete ${target_dir} later (the pre-zipped contents)."
98 echo "Usage: $0 <outfile> <rev_number>"
104 echo "Building file ${outfile} version=${version}"
106 multi_crx
${outfile} ${version}