Do not copy system libraries on Linux
authorCheng Zhao <zcbenz@gmail.com>
Fri, 11 Mar 2016 13:22:17 +0000 (22:22 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 11 Mar 2016 13:29:03 +0000 (22:29 +0900)
script/create-dist.py

index f3894eb4fa24cb6f62abfd42415a1bedbabbe0a9..e25845432c774c33bf718e56b9291293b7eec369 100755 (executable)
@@ -71,17 +71,11 @@ TARGET_DIRECTORIES = {
   ],
 }
 
-SYSTEM_LIBRARIES = [
-  'libgcrypt.so',
-]
-
 
 def main():
   rm_rf(DIST_DIR)
   os.makedirs(DIST_DIR)
 
-  target_arch = get_target_arch()
-
   force_build()
   create_symbols()
   copy_binaries()
@@ -91,8 +85,6 @@ def main():
 
   if PLATFORM == 'linux':
     strip_binaries()
-    if target_arch != 'arm':
-      copy_system_libraries()
 
   create_version()
   create_dist_zip()
@@ -144,21 +136,6 @@ def strip_binaries():
       execute([strip, os.path.join(DIST_DIR, binary)])
 
 
-def copy_system_libraries():
-  executable_path = os.path.join(OUT_DIR, PROJECT_NAME)  # our/R/electron
-  ldd = execute(['ldd', executable_path])
-  lib_re = re.compile('\t(.*) => (.+) \(.*\)$')
-  for line in ldd.splitlines():
-    m = lib_re.match(line)
-    if not m:
-      continue
-    for i, library in enumerate(SYSTEM_LIBRARIES):
-      real_library = m.group(1)
-      if real_library.startswith(library):
-        shutil.copyfile(m.group(2), os.path.join(DIST_DIR, real_library))
-        SYSTEM_LIBRARIES[i] = real_library
-
-
 def create_version():
   version_path = os.path.join(SOURCE_ROOT, 'dist', 'version')
   with open(version_path, 'w') as version_file:
@@ -185,8 +162,6 @@ def create_dist_zip():
   with scoped_cwd(DIST_DIR):
     files = TARGET_BINARIES[PLATFORM] +  ['LICENSE', 'LICENSES.chromium.html',
                                           'version']
-    if PLATFORM == 'linux':
-      files += [lib for lib in SYSTEM_LIBRARIES if os.path.exists(lib)]
     dirs = TARGET_DIRECTORIES[PLATFORM]
     make_zip(zip_file, files, dirs)