Skip to content

Commit

Permalink
[Tizen] Apply code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
JSUYA committed May 31, 2024
1 parent 566c0f1 commit 6b9e175
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 38 deletions.
9 changes: 3 additions & 6 deletions ci/tizen/check_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def check_symbol(sofile, allowlist):
sys.exit('{} is not a valid file.'.format(allowlist))

try:
symbols_raw = subprocess.check_output(
['nm', '-gDC', sofile]).decode('utf-8').splitlines()
symbols_raw = subprocess.check_output(['nm', '-gDC', sofile]).decode('utf-8').splitlines()
symbols = [Symbol.parse(line) for line in symbols_raw]
except subprocess.CalledProcessError as error:
sys.exit('nm failed: {}'.format(error))
Expand All @@ -60,10 +59,8 @@ def check_symbol(sofile, allowlist):

def main():
parser = argparse.ArgumentParser()
parser.add_argument('--allowlist', type=str, required=True,
help='Path to the allowlist file')
parser.add_argument('sofile', type=str, nargs='+',
help='Path to the .so file')
parser.add_argument('--allowlist', type=str, required=True, help='Path to the allowlist file')
parser.add_argument('sofile', type=str, nargs='+', help='Path to the .so file')
args = parser.parse_args()

for sofile in args.sofile:
Expand Down
54 changes: 27 additions & 27 deletions ci/tizen/generate_sysroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@
import urllib.request
from pathlib import Path


base_packages = [
'gcc',
'glibc',
'glibc-devel',
'libgcc',
'linux-glibc-devel',
'zlib-devel',
'gcc',
'glibc',
'glibc-devel',
'libgcc',
'linux-glibc-devel',
'zlib-devel',
]

unified_packages = [
'fontconfig',
'fontconfig-devel',
'freetype2-devel',
'libpng-devel',
'fontconfig',
'fontconfig-devel',
'freetype2-devel',
'libpng-devel',
]


Expand All @@ -42,16 +41,16 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
sys.exit('Unknown arch: ' + arch)

base_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/latest/repos/standard/packages'.format(
api_version,api_version)
api_version, api_version
)
unified_repo = 'http://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/latest/repos/standard/packages'.format(
api_version, api_version)
api_version, api_version
)

# Retrieve html documents.
documents = {}
for url in ['{}/{}'.format(base_repo, tizen_arch),
'{}/{}'.format(base_repo, 'noarch'),
'{}/{}'.format(unified_repo, tizen_arch),
'{}/{}'.format(unified_repo, 'noarch')]:
for url in ['{}/{}'.format(base_repo, tizen_arch), '{}/{}'.format(base_repo, 'noarch'),
'{}/{}'.format(unified_repo, tizen_arch), '{}/{}'.format(unified_repo, 'noarch')]:
request = urllib.request.Request(url)
with urllib.request.urlopen(request) as response:
documents[url] = response.read().decode('utf-8')
Expand Down Expand Up @@ -99,8 +98,7 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
libpath = sysroot / 'usr' / 'lib64'
else:
libpath = sysroot / 'usr' / 'lib'
subprocess.run('cp gcc/*/*/*.o gcc/*/*/*.a .',
shell=True, cwd=libpath, check=True)
subprocess.run('cp gcc/*/*/*.o gcc/*/*/*.a .', shell=True, cwd=libpath, check=True)

# Apply a patch if applicable.
patch = Path(__file__).parent / '{}.patch'.format(arch)
Expand All @@ -118,14 +116,16 @@ def main():

# Parse arguments.
parser = argparse.ArgumentParser(description='Tizen sysroot generator')
parser.add_argument('-o', '--out', metavar='PATH', type=str,
help='Path to the output directory')
parser.add_argument('-f', '--force', action='store_true',
help='Force re-downloading of packages')
parser.add_argument('-q', '--quiet', action='store_true',
help='Suppress log output')
parser.add_argument('--api-version', metavar='VER', default=5.5, type=float,
help='Target API version (defaults to 5.5)')
parser.add_argument('-o', '--out', metavar='PATH', type=str, help='Path to the output directory')
parser.add_argument('-f', '--force', action='store_true', help='Force re-downloading of packages')
parser.add_argument('-q', '--quiet', action='store_true', help='Suppress log output')
parser.add_argument(
'--api-version',
metavar='VER',
default=5.5,
type=float,
help='Target API version (defaults to 5.5)'
)
args = parser.parse_args()

if args.out:
Expand Down
8 changes: 3 additions & 5 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,7 @@ def to_gn_args(args):
else:
gn_args['skia_use_gl'] = args.target_os != 'fuchsia'

if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia',
'linux']:
if sys.platform == 'darwin' and args.target_os not in ['android', 'fuchsia', 'linux']:
# OpenGL is deprecated on macOS > 10.11.
# This is not necessarily needed but enabling this until we have a way to
# build a macOS metal only shell and a gl only shell.
Expand Down Expand Up @@ -804,9 +803,8 @@ def to_gn_args(args):
# gen_snapshot, but the build defines otherwise make it look like the build is
# for a host Windows build and make GN think we will be building ANGLE.
# Angle is not used on Mac hosts as there are no tests for the OpenGL backend.
if (is_host_build(args) and
gn_args['host_os'] != 'mac') or (args.target_os == 'linux' and
get_host_os() == 'win'):
if (is_host_build(args) and gn_args['host_os'] != 'mac') or (args.target_os == 'linux' and
get_host_os() == 'win'):
# Do not build unnecessary parts of the ANGLE tree.
gn_args['angle_build_all'] = False
gn_args['angle_has_astc_encoder'] = False
Expand Down

0 comments on commit 6b9e175

Please sign in to comment.