mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-15 06:52:34 +02:00
Add universal binary check
This commit is contained in:
parent
4849905a4a
commit
17c6bd891c
@ -14,7 +14,7 @@ from typing import Tuple
|
||||
from pathlib import Path
|
||||
import macos_sign
|
||||
import build_godot
|
||||
from util import sha256, cd_repo_root_path, repo_root_path, zipdir, run, get_vs_env_dict, get_latest_git_tag, parse_semver, semver_to_string
|
||||
from util import sha256, cd_repo_root_path, repo_root_path, zipdir, run, get_vs_env_dict, get_latest_git_tag, parse_semver, semver_to_string, check_universal_binary
|
||||
from sys import stdout
|
||||
|
||||
stdout.reconfigure(encoding='utf-8')
|
||||
@ -219,6 +219,8 @@ def package(build_config: BuildConfig):
|
||||
run(cmd=cmd_raw.format(qt_bin_path=qt_bin_path, repo_root_path=source_path,
|
||||
build_bin_dir=build_bin_dir, app="ScreenPlayWidget"), cwd=cwd)
|
||||
|
||||
check_universal_binary()
|
||||
|
||||
if platform.system() == "Windows":
|
||||
print("Executing deploy commands...")
|
||||
run(build_config.package_command.format(
|
||||
@ -303,6 +305,7 @@ def package(build_config: BuildConfig):
|
||||
file.unlink()
|
||||
|
||||
|
||||
|
||||
def build_installer(build_config: BuildConfig, build_result: BuildResult):
|
||||
os.chdir(build_result.build)
|
||||
print("Running cpack at: ", os.getcwd())
|
||||
|
@ -178,3 +178,38 @@ def unzip(zip_path: str, destination_path: str, specific_file: str = None):
|
||||
zip_ref.extract(specific_file, path=destination_path)
|
||||
else:
|
||||
zip_ref.extractall(path=destination_path)
|
||||
|
||||
|
||||
def listfiles(path):
|
||||
files = []
|
||||
extensions = ('.dylib', '.so','')
|
||||
ignored = ('qmldir')
|
||||
print(f"WALK: {path}")
|
||||
for dirName, subdirList, fileList in os.walk(path):
|
||||
dir = dirName.replace(path, '')
|
||||
for fname in fileList:
|
||||
if Path(fname).suffix in extensions and not fname in ignored:
|
||||
file = path + os.path.join(dir, fname)
|
||||
if(os.path.isfile(file)):
|
||||
files.append(file)
|
||||
if os.path.islink(file):
|
||||
print(f"Warning: file {file} is a symlink!")
|
||||
print("Symlink target: ", os.readlink(file))
|
||||
return files
|
||||
|
||||
|
||||
def check_universal_binary():
|
||||
dir = 'build-64-osx-universal-release/bin/ScreenPlay.app/Contents'
|
||||
path = Path.joinpath(repo_root_path(), dir).absolute()
|
||||
print(f"Checking files at: {path}")
|
||||
files = listfiles(str(path))
|
||||
none_fat_found = False
|
||||
for file in files:
|
||||
out = run_and_capture_output(f"lipo -info {file}")
|
||||
if out.startswith('Non-fat'):
|
||||
print(out)
|
||||
none_fat_found = True
|
||||
if none_fat_found:
|
||||
print("✅ All files are a universal binaries")
|
||||
else:
|
||||
print("❌ None universal binaries found")
|
Loading…
Reference in New Issue
Block a user