[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / crx_file / crx3.gni
1 # Copyright 2021 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/compiled_action.gni")
6 import("//build/config/zip.gni")
7
8 # Creates a CRX3 archive of the inputs
9 #
10 # inputs: A list of files that will be placed into the CRX.
11 # key: Path to a file containing an RSA key (DER-encoded PKCS #8 PrivateKeyInfo)
12 # to sign the CRX with.
13 # output: Path to the output CRX.
14 # base_dir (optional): The CRX paths will be relative to this directory.
15 #
16 # Note: you can generate and format a compatible key using openssl:
17 # `openssl genrsa 4096 | openssl pkcs8 \
18 #      -inform PEM -nocrypt -topk8 -outform DER -out my_file.pkcs8.der`
19 template("crx3") {
20   assert(defined(invoker.inputs), "inputs must be defined for $target_name")
21
22   _zip_target = target_name + "_zip"
23   _zip_out = "$target_gen_dir/$_zip_target.zip"
24   zip(_zip_target) {
25     inputs = invoker.inputs
26     output = _zip_out
27     if (defined(invoker.base_dir)) {
28       base_dir = invoker.base_dir
29     }
30     forward_variables_from(invoker,
31                            [
32                              "data",
33                              "data_deps",
34                              "deps",
35                              "public_deps",
36                              "testonly",
37                              "visibility",
38                            ])
39   }
40
41   compiled_action(target_name) {
42     tool = "//components/crx_file:crx3_build_action"
43     outputs = [ invoker.output ]
44     args = [
45       rebase_path(invoker.output, root_build_dir),
46       rebase_path(_zip_out, root_build_dir),
47       rebase_path(invoker.key, root_build_dir),
48     ]
49     inputs = [ _zip_out ]
50     deps = [ ":$_zip_target" ]
51     forward_variables_from(invoker,
52                            [
53                              "testonly",
54                              "visibility",
55                            ])
56   }
57 }