Build electron linking to chromium-efl 83/141283/3
authorYoungsoo Choi <kenshin.choi@samsung.com>
Sun, 30 Jul 2017 07:02:42 +0000 (16:02 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Mon, 7 Aug 2017 05:08:56 +0000 (05:08 +0000)
The electron has been liked to prebuilt chromium
that is downloaded from amazon server.

This let electron link to chromium-efl.

Change-Id: I8adc61d9d7f5541bc159943e9eb4f7aa20e75d75
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
13 files changed:
atom/browser/atom_browser_client.h
common.gypi
electron.gyp
script/bootstrap.py
script/build-libchromiumcontent.py
script/update.py
vendor/brightray/brightray.gyp
vendor/brightray/brightray.gypi
vendor/brightray/script/bootstrap
vendor/brightray/vendor/libchromiumcontent/script/build
vendor/brightray/vendor/libchromiumcontent/script/create-dist
vendor/brightray/vendor/libchromiumcontent/script/download
vendor/brightray/vendor/libchromiumcontent/script/update

index 70573d6..a794fba 100644 (file)
@@ -58,7 +58,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
       content::BrowserContext* browser_context,
       content::SiteInstance* current_instance,
       const GURL& dest_url,
-      content::SiteInstance** new_instance) override;
+      content::SiteInstance** new_instance); //override;
   void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
                                       int child_process_id) override;
   void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
index 0e9c276..80d3b13 100644 (file)
@@ -15,6 +15,7 @@
     'python': 'python',
     'openssl_fips': '',
     'openssl_no_asm': 1,
+    'use_efl%': 0,
     'use_openssl_def': 0,
     'OPENSSL_PRODUCT': 'libopenssl.a',
     'node_release_urlbase': 'https://atom.io/download/atom-shell',
index ce3673a..3c5f7c1 100644 (file)
                   }, {
                     'copied_libraries': [
                       '<(PRODUCT_DIR)/lib/libnode.so',
-                      '<(libchromiumcontent_dir)/libffmpeg.so',
+#                      '<(libchromiumcontent_dir)/libffmpeg.so',
                     ],
                   }],
                 ],
               },
               'destination': '<(PRODUCT_DIR)',
               'files': [
+#                '<!(<(echo <(libchromiumcontent_shared_v8_libraries)))',
                 '<@(copied_libraries)',
-                '<(libchromiumcontent_dir)/locales',
-                '<(libchromiumcontent_dir)/icudtl.dat',
-                '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak',
-                '<(libchromiumcontent_dir)/content_resources_200_percent.pak',
+#                '<(libchromiumcontent_dir)/locales',
+#                '<(libchromiumcontent_dir)/icudtl.dat',
+#                '<(libchromiumcontent_dir)/blink_image_resources_200_percent.pak',
+#                '<(libchromiumcontent_dir)/content_resources_200_percent.pak',
                 '<(libchromiumcontent_dir)/content_shell.pak',
-                '<(libchromiumcontent_dir)/ui_resources_200_percent.pak',
-                '<(libchromiumcontent_dir)/views_resources_200_percent.pak',
+#                '<(libchromiumcontent_dir)/ui_resources_200_percent.pak',
+#                '<(libchromiumcontent_dir)/views_resources_200_percent.pak',
                 '<(libchromiumcontent_dir)/natives_blob.bin',
                 '<(libchromiumcontent_dir)/snapshot_blob.bin',
               ],
index 1fd3fd8..030e1d3 100755 (executable)
@@ -31,7 +31,8 @@ def main():
   if sys.platform == 'cygwin':
     update_win32_python()
 
-  update_submodules()
+  if args.libcc_chromium_efl_path == None:
+    update_submodules()
 
   libcc_source_path = args.libcc_source_path
   libcc_shared_library_path = args.libcc_shared_library_path
@@ -52,18 +53,20 @@ def main():
       update_clang()
 
   setup_python_libs()
-  update_node_modules('.')
+  if args.libcc_chromium_efl_path == None:
+    update_node_modules('.')
   bootstrap_brightray(args.dev, args.url, args.target_arch,
                       libcc_source_path, libcc_shared_library_path,
-                      libcc_static_library_path)
+                      libcc_static_library_path, args.libcc_chromium_efl_path)
 
-  if PLATFORM == 'linux':
+  if PLATFORM == 'linux' and args.libcc_chromium_efl_path == None:
     download_sysroot(args.target_arch)
 
   create_chrome_version_h()
   touch_config_gypi()
   run_update(defines, args.msvs)
-  update_electron_modules('spec', args.target_arch)
+  if args.libcc_chromium_efl_path == None:
+    update_electron_modules('spec', args.target_arch)
 
 
 def parse_args():
@@ -102,6 +105,8 @@ def parse_args():
                       help='The static library path of libchromiumcontent.')
   parser.add_argument('--defines', default='',
                       help='The build variables passed to gyp')
+  parser.add_argument('--libcc_chromium_efl_path', required=False,
+                      help='The shared library path of chromium-efl.')
   return parser.parse_args()
 
 
@@ -136,7 +141,7 @@ def setup_python_libs():
 
 def bootstrap_brightray(is_dev, url, target_arch, libcc_source_path,
                         libcc_shared_library_path,
-                        libcc_static_library_path):
+                        libcc_static_library_path, libcc_chromium_efl_path):
   bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap')
   args = [
     '--commit', LIBCHROMIUMCONTENT_COMMIT,
@@ -151,6 +156,8 @@ def bootstrap_brightray(is_dev, url, target_arch, libcc_source_path,
     args += ['--libcc_source_path', libcc_source_path,
              '--libcc_shared_library_path', libcc_shared_library_path,
              '--libcc_static_library_path', libcc_static_library_path]
+  if libcc_chromium_efl_path != None:
+    args += ['--libcc_chromium_efl_path', libcc_chromium_efl_path]
   execute_stdout([sys.executable, bootstrap] + args)
 
 
index e0a95f6..e04a3b6 100755 (executable)
@@ -29,7 +29,7 @@ def main():
   build = os.path.join(script_dir, 'build')
   create_dist = os.path.join(script_dir, 'create-dist')
   execute_stdout([sys.executable, bootstrap])
-  execute_stdout([sys.executable, update, '-t', args.target_arch,
+  execute_stdout([sys.executable, update, '-t', args.target_arch, '-N',
                   '--defines', args.defines])
   execute_stdout([sys.executable, build, '-R', '-t', args.target_arch])
   execute_stdout([sys.executable, create_dist, '-c', 'static_library',
index 35331eb..f53dc4f 100755 (executable)
@@ -84,8 +84,11 @@ def run_gyp(target_arch, component):
 
   # Add the defines passed from command line.
   args = parse_args()
+  use_efl=0
   for define in [d.strip() for d in args.defines.split(' ')]:
     if define:
+      if define == 'use_efl=1':
+        use_efl=1
       defines += ['-D' + define]
 
   generator = 'ninja'
index e60d17a..b8a5843 100644 (file)
           }
         }, {  # (Release build on Linux)
           'link_settings': {
-            'libraries': [ '<@(libchromiumcontent_libraries)' ]
+            'libraries': [
+              '<@(libchromiumcontent_libraries)',
+#              '<!(<(echo <@(libchromiumcontent_libraries)))',
+            ]
           },
         }],  # (Normal builds)
         # Linux specific link settings.
           'link_settings': {
             'ldflags': [
               '<!@(<(pkg-config) --libs-only-L --libs-only-other <(linux_system_libraries))',
+#              '<!(<(echo <!@(<(pkg-config) --libs-only-L --libs-only-other <(linux_system_libraries))))',
             ],
             'libraries': [
               '-lpthread',
               '<!@(<(pkg-config) --libs-only-l <(linux_system_libraries))',
+#              '<!(<(echo <!@(<(pkg-config) --libs-only-l <(linux_system_libraries))))',
             ],
           },
           'cflags': [
             '<!@(<(pkg-config) --cflags <(linux_system_libraries))',
+#            '<!(<(echo <(linux_system_libraries)))',
+#            '<!(<(echo <!@(<(pkg-config) --cflags <(linux_system_libraries))))',
             # Needed by using libgtkui:
             '-Wno-deprecated-register',
             '-Wno-sentinel',
index 064ae1a..49037bf 100644 (file)
               'USE_OPENSSL',
             ],
           }, {
-            'defines': [
-              'USE_X11',
-              # "use_nss_certs" is set to 1 in libchromiumcontent.
-              'USE_NSS_CERTS',
-              'USE_NSS',  # deprecated after Chrome 45.
+            'conditions': [
+              ['use_efl==1', {
+                'defines': [
+                  'USE_EFL',
+                  # "use_nss_certs" is set to 1 in libchromiumcontent.
+                  'USE_NSS_CERTS',
+                  'USE_NSS',  # deprecated after Chrome 45.
+                ],
+              }, {
+                'defines': [
+                  'USE_X11',
+                  # "use_nss_certs" is set to 1 in libchromiumcontent.
+                  'USE_NSS_CERTS',
+                  'USE_NSS',  # deprecated after Chrome 45.
+                ],
+              }],
             ],
           }],
           ['OS=="linux"', {
index 2978639..3ced740 100755 (executable)
@@ -18,17 +18,22 @@ def main():
       args.libcc_shared_library_path != None and
       args.libcc_static_library_path != None):
     pass
-  elif (args.libcc_source_path != None or
+  elif (args.libcc_chromium_efl_path == None and
+        args.libcc_source_path != None or
         args.libcc_shared_library_path != None or
         args.libcc_static_library_path != None):
     print "Error: All options of libchromiumcontent are required OR let " \
           "brightray choose it"
     sys.exit(0)
-  update_submodules()
+  if args.libcc_chromium_efl_path == None:
+    update_submodules()
+#  if args.libcc_chromium_efl_path != None:
+#    args.libcc_shared_library_path = args.libcc_chromium_efl_path
   setup_libchromiumcontent(args.dev, args.commit, args.target_arch, args.url,
                            args.libcc_source_path,
                            args.libcc_shared_library_path,
-                           args.libcc_static_library_path)
+                           args.libcc_static_library_path,
+                           args.libcc_chromium_efl_path)
 
 
 def parse_args():
@@ -54,6 +59,8 @@ def parse_args():
                         help='The static library path of libchromiumcontent. ' \
                         'NOTE: All options of libchromiumcontent are ' \
                         'required OR let brightray choose it')
+  parser.add_argument('--libcc_chromium_efl_path', required=False,
+                        help='The chromiunm-efl is linked to electron.')
   return parser.parse_args()
 
 
@@ -67,11 +74,14 @@ def update_submodules():
 def setup_libchromiumcontent(is_dev, commit, target_arch, url,
                              libcc_source_path,
                              libcc_shared_library_path,
-                             libcc_static_library_path):
+                             libcc_static_library_path,
+                             libcc_chromium_efl_path):
   target_dir = os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')
   download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script',
                           'download')
   args = ['-f', '-c', commit, '--target_arch', target_arch, url, target_dir]
+  if libcc_chromium_efl_path != None:
+    args += ['--libcc_chromium_efl_path', libcc_chromium_efl_path]
   if (libcc_source_path != None and
       libcc_shared_library_path != None and
       libcc_static_library_path != None):
index 84982ca..3780cb6 100755 (executable)
@@ -32,7 +32,8 @@ def main():
 
   for component in COMPONENTS:
     if args.component == 'all' or args.component == component:
-      if component == 'shared_library' and args.no_shared_library:
+#      if component == 'shared_library' and args.no_shared_library:
+      if component == 'static_library':
         continue
       out_dir = get_output_dir(SOURCE_ROOT, target_arch, component)
       target = 'chromiumcontent:chromiumcontent'
index aec75e5..24b5032 100755 (executable)
@@ -307,7 +307,8 @@ def main():
   os.makedirs(DIST_DIR)
 
   for component in COMPONENTS:
-    if args.component == 'all' or args.component == component:
+#    if args.component == 'all' or args.component == component:
+    if args.component != 'static_library':
       copy_binaries(target_arch, component, create_debug_archive)
       copy_generated_sources(target_arch, component)
       copy_locales(target_arch, component)
index 5fa3efb..c02e7d0 100755 (executable)
@@ -32,7 +32,12 @@ class ProgramError(Exception):
 def main():
   try:
     args = parse_args()
-    if (args.libcc_source_path != None and
+    if args.libcc_chromium_efl_path != None:
+      generate_filenames_gypi(os.path.join(args.path, 'filenames.gypi'),
+                              args.libcc_chromium_efl_path,
+                              os.path.join(args.libcc_chromium_efl_path, 'out.x64'),
+                              os.path.join(args.libcc_chromium_efl_path, 'out.x64'))
+    elif (args.libcc_source_path != None and
         args.libcc_shared_library_path != None and
         args.libcc_static_library_path != None):
       if (not os.path.isdir(args.libcc_source_path)):
@@ -92,6 +97,8 @@ def parse_args():
                         help='The shared library path of libchromiumcontent. NOTE: All options of libchromiumcontent are required OR let libchromiumcontent choose it')
   parser.add_argument('--libcc_static_library_path', required=False,
                         help='The static library path of libchromiumcontent. NOTE: All options of libchromiumcontent are required OR let libchromiumcontent choose it')
+  parser.add_argument('--libcc_chromium_efl_path', required=False,
+                        help='The chromium-efl is linked to electron')
   return parser.parse_args()
 
 
index 08e8cd4..85efd17 100755 (executable)
@@ -39,15 +39,18 @@ def main():
   else:
     print "Skipping Chromium Source Tarball Download"
 
-  if sys.platform == 'linux2':
+  if sys.platform == 'linux2' and not args.no_download:
     install_sysroot()
   elif sys.platform in ['win32', 'cygwin']:
     update_toolchain_json()
 
   target_arch = args.target_arch
-  return (apply_patches() or
-          copy_chromiumcontent_files() or
-          update_clang() or
+#  return (apply_patches() or
+#          copy_chromiumcontent_files() or
+#          update_clang() or
+#          update_gn() or
+#          run_gn(target_arch, args.defines))
+  return (copy_chromiumcontent_files() or
           update_gn() or
           run_gn(target_arch, args.defines))
 
@@ -193,6 +196,7 @@ def run_gn(target_arch, defines):
     gn = os.path.join(SRC_DIR, 'buildtools', 'win', 'gn.exe')
   elif sys.platform == 'linux2':
     gn = os.path.join(SRC_DIR, 'buildtools', 'linux64', 'gn')
+#    os.chmod(gn, 775)
   elif sys.platform == 'darwin':
     gn = os.path.join(SRC_DIR, 'buildtools', 'mac', 'gn')