mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Removed MagicLeap occurrences from Python files
This commit is contained in:
parent
05e1e0ea9e
commit
b25f9c2d75
5 changed files with 26 additions and 216 deletions
|
@ -70,7 +70,7 @@ class MachCommands(CommandBase):
|
||||||
@CommandBase.build_like_command_arguments
|
@CommandBase.build_like_command_arguments
|
||||||
def build(self, release=False, dev=False, jobs=None, params=None, media_stack=None,
|
def build(self, release=False, dev=False, jobs=None, params=None, media_stack=None,
|
||||||
no_package=False, verbose=False, very_verbose=False,
|
no_package=False, verbose=False, very_verbose=False,
|
||||||
target=None, android=False, magicleap=False, libsimpleservo=False,
|
target=None, android=False, libsimpleservo=False,
|
||||||
features=None, uwp=False, win_arm64=False, **kwargs):
|
features=None, uwp=False, win_arm64=False, **kwargs):
|
||||||
# Force the UWP-enabled target if the convenience UWP flags are passed.
|
# Force the UWP-enabled target if the convenience UWP flags are passed.
|
||||||
if uwp and not target:
|
if uwp and not target:
|
||||||
|
@ -82,7 +82,7 @@ class MachCommands(CommandBase):
|
||||||
opts = params or []
|
opts = params or []
|
||||||
features = features or []
|
features = features or []
|
||||||
|
|
||||||
target, android = self.pick_target_triple(target, android, magicleap)
|
target, android = self.pick_target_triple(target, android)
|
||||||
|
|
||||||
# Infer UWP build if only provided a target.
|
# Infer UWP build if only provided a target.
|
||||||
if not uwp:
|
if not uwp:
|
||||||
|
@ -96,9 +96,7 @@ class MachCommands(CommandBase):
|
||||||
if android:
|
if android:
|
||||||
target_path = path.join(target_path, "android")
|
target_path = path.join(target_path, "android")
|
||||||
base_path = path.join(target_path, target)
|
base_path = path.join(target_path, target)
|
||||||
elif magicleap:
|
|
||||||
target_path = path.join(target_path, "magicleap")
|
|
||||||
base_path = path.join(target_path, target)
|
|
||||||
release_path = path.join(base_path, "release", "servo")
|
release_path = path.join(base_path, "release", "servo")
|
||||||
dev_path = path.join(base_path, "debug", "servo")
|
dev_path = path.join(base_path, "debug", "servo")
|
||||||
|
|
||||||
|
@ -422,121 +420,6 @@ class MachCommands(CommandBase):
|
||||||
expr = "s#libdir=.*#libdir=%s#g" % gst_lib_path
|
expr = "s#libdir=.*#libdir=%s#g" % gst_lib_path
|
||||||
subprocess.call(["perl", "-i", "-pe", expr, pc])
|
subprocess.call(["perl", "-i", "-pe", expr, pc])
|
||||||
|
|
||||||
if magicleap:
|
|
||||||
if platform.system() not in ["Darwin"]:
|
|
||||||
raise Exception("Magic Leap builds are only supported on macOS. "
|
|
||||||
"If you only wish to test if your code builds, "
|
|
||||||
"run ./mach build -p libmlservo.")
|
|
||||||
|
|
||||||
ml_sdk = env.get("MAGICLEAP_SDK")
|
|
||||||
if not ml_sdk:
|
|
||||||
raise Exception("Magic Leap builds need the MAGICLEAP_SDK environment variable")
|
|
||||||
if not os.path.exists(ml_sdk):
|
|
||||||
raise Exception("Path specified by MAGICLEAP_SDK does not exist.")
|
|
||||||
|
|
||||||
ml_support = path.join(self.get_top_dir(), "support", "magicleap")
|
|
||||||
|
|
||||||
# We pretend to be an Android build
|
|
||||||
env.setdefault("ANDROID_VERSION", "21")
|
|
||||||
env.setdefault("ANDROID_NDK", env["MAGICLEAP_SDK"])
|
|
||||||
env.setdefault("ANDROID_NDK_VERSION", "16.0.0")
|
|
||||||
env.setdefault("ANDROID_PLATFORM_DIR", path.join(env["MAGICLEAP_SDK"], "lumin"))
|
|
||||||
env.setdefault("ANDROID_TOOLCHAIN_DIR", path.join(env["MAGICLEAP_SDK"], "tools", "toolchains"))
|
|
||||||
env.setdefault("ANDROID_CLANG", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "clang"))
|
|
||||||
|
|
||||||
# A random collection of search paths
|
|
||||||
env.setdefault("STLPORT_LIBS", " ".join([
|
|
||||||
"-L" + path.join(env["MAGICLEAP_SDK"], "lumin", "stl", "libc++-lumin", "lib"),
|
|
||||||
"-lc++"
|
|
||||||
]))
|
|
||||||
env.setdefault("STLPORT_CPPFLAGS", " ".join([
|
|
||||||
"-I" + path.join(env["MAGICLEAP_SDK"], "lumin", "stl", "libc++-lumin", "include")
|
|
||||||
]))
|
|
||||||
env.setdefault("CPPFLAGS", " ".join([
|
|
||||||
"--no-standard-includes",
|
|
||||||
"--sysroot=" + env["ANDROID_PLATFORM_DIR"],
|
|
||||||
"-I" + path.join(env["ANDROID_PLATFORM_DIR"], "usr", "include"),
|
|
||||||
"-isystem" + path.join(env["ANDROID_TOOLCHAIN_DIR"], "lib64", "clang", "3.8", "include"),
|
|
||||||
]))
|
|
||||||
env.setdefault("CFLAGS", " ".join([
|
|
||||||
env["CPPFLAGS"],
|
|
||||||
"-L" + path.join(env["ANDROID_TOOLCHAIN_DIR"], "lib", "gcc", target, "4.9.x"),
|
|
||||||
]))
|
|
||||||
env.setdefault("CXXFLAGS", " ".join([
|
|
||||||
# Sigh, Angle gets confused if there's another EGL around
|
|
||||||
"-I./gfx/angle/checkout/include",
|
|
||||||
env["STLPORT_CPPFLAGS"],
|
|
||||||
env["CFLAGS"]
|
|
||||||
]))
|
|
||||||
|
|
||||||
# The toolchain commands
|
|
||||||
env.setdefault("AR", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-ar"))
|
|
||||||
env.setdefault("AS", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-clang"))
|
|
||||||
env.setdefault("CC", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-clang"))
|
|
||||||
env.setdefault("CPP", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-clang -E"))
|
|
||||||
env.setdefault("CXX", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-clang++"))
|
|
||||||
env.setdefault("LD", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-ld"))
|
|
||||||
env.setdefault("OBJCOPY", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-objcopy"))
|
|
||||||
env.setdefault("OBJDUMP", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-objdump"))
|
|
||||||
env.setdefault("RANLIB", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-ranlib"))
|
|
||||||
env.setdefault("STRIP", path.join(env["ANDROID_TOOLCHAIN_DIR"], "bin", "aarch64-linux-android-strip"))
|
|
||||||
|
|
||||||
# Undo all of that when compiling build tools for the host
|
|
||||||
env.setdefault("HOST_CFLAGS", "")
|
|
||||||
env.setdefault("HOST_CXXFLAGS", "")
|
|
||||||
env.setdefault("HOST_CC", "/usr/local/opt/llvm/bin/clang")
|
|
||||||
env.setdefault("HOST_CXX", "/usr/local/opt/llvm/bin/clang++")
|
|
||||||
env.setdefault("HOST_LD", "ld")
|
|
||||||
|
|
||||||
# Some random build configurations
|
|
||||||
env.setdefault("HARFBUZZ_SYS_NO_PKG_CONFIG", "1")
|
|
||||||
env.setdefault("PKG_CONFIG_ALLOW_CROSS", "1")
|
|
||||||
env.setdefault("CMAKE_TOOLCHAIN_FILE", path.join(ml_support, "toolchain.cmake"))
|
|
||||||
env.setdefault("_LIBCPP_INLINE_VISIBILITY", "__attribute__((__always_inline__))")
|
|
||||||
|
|
||||||
# The Open SSL configuration
|
|
||||||
env.setdefault("OPENSSL_DIR", path.join(target_path, target, "native", "openssl"))
|
|
||||||
env.setdefault("OPENSSL_VERSION", "1.1.1d")
|
|
||||||
env.setdefault("OPENSSL_STATIC", "1")
|
|
||||||
|
|
||||||
# GStreamer configuration
|
|
||||||
env.setdefault("GSTREAMER_DIR", path.join(target_path, target, "native", "gstreamer-1.16.0"))
|
|
||||||
env.setdefault("GSTREAMER_URL", "https://servo-deps-2.s3.amazonaws.com/gstreamer/gstreamer-magicleap-1.16.0-20190823-104505.tgz")
|
|
||||||
env.setdefault("PKG_CONFIG_PATH", path.join(env["GSTREAMER_DIR"], "system", "lib64", "pkgconfig"))
|
|
||||||
|
|
||||||
# Override the linker set in .cargo/config
|
|
||||||
env.setdefault("CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER", path.join(ml_support, "fake-ld.sh"))
|
|
||||||
|
|
||||||
# Only build libmlservo
|
|
||||||
opts += ["--package", "libmlservo"]
|
|
||||||
|
|
||||||
# Download and build OpenSSL if necessary
|
|
||||||
status = call(path.join(ml_support, "openssl.sh"), env=env, verbose=verbose)
|
|
||||||
if status:
|
|
||||||
return status
|
|
||||||
|
|
||||||
# Download prebuilt Gstreamer if necessary
|
|
||||||
if not os.path.exists(path.join(env["GSTREAMER_DIR"], "system")):
|
|
||||||
if not os.path.exists(env["GSTREAMER_DIR"] + ".tgz"):
|
|
||||||
check_call([
|
|
||||||
'curl',
|
|
||||||
'-L',
|
|
||||||
'-f',
|
|
||||||
'-o', env["GSTREAMER_DIR"] + ".tgz",
|
|
||||||
env["GSTREAMER_URL"],
|
|
||||||
])
|
|
||||||
check_call([
|
|
||||||
'mkdir',
|
|
||||||
'-p',
|
|
||||||
env["GSTREAMER_DIR"],
|
|
||||||
])
|
|
||||||
check_call([
|
|
||||||
'tar',
|
|
||||||
'xzf',
|
|
||||||
env["GSTREAMER_DIR"] + ".tgz",
|
|
||||||
'-C', env["GSTREAMER_DIR"],
|
|
||||||
])
|
|
||||||
|
|
||||||
# https://internals.rust-lang.org/t/exploring-crate-graph-build-times-with-cargo-build-ztimings/10975
|
# https://internals.rust-lang.org/t/exploring-crate-graph-build-times-with-cargo-build-ztimings/10975
|
||||||
# Prepend so that e.g. `-Ztimings` (which means `-Ztimings=info,html`)
|
# Prepend so that e.g. `-Ztimings` (which means `-Ztimings=info,html`)
|
||||||
# given on the command line can override it
|
# given on the command line can override it
|
||||||
|
@ -553,7 +436,7 @@ class MachCommands(CommandBase):
|
||||||
|
|
||||||
status = self.run_cargo_build_like_command(
|
status = self.run_cargo_build_like_command(
|
||||||
"build", opts, env=env, verbose=verbose,
|
"build", opts, env=env, verbose=verbose,
|
||||||
target=target, android=android, magicleap=magicleap, libsimpleservo=libsimpleservo, uwp=uwp,
|
target=target, android=android, libsimpleservo=libsimpleservo, uwp=uwp,
|
||||||
features=features, **kwargs
|
features=features, **kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -356,17 +356,14 @@ class CommandBase(object):
|
||||||
build_type = "release" if release else "debug"
|
build_type = "release" if release else "debug"
|
||||||
return path.join(base_path, build_type, apk_name)
|
return path.join(base_path, build_type, apk_name)
|
||||||
|
|
||||||
def get_binary_path(self, release, dev, target=None, android=False, magicleap=False, simpleservo=False):
|
def get_binary_path(self, release, dev, target=None, android=False, simpleservo=False):
|
||||||
# TODO(autrilla): this function could still use work - it shouldn't
|
# TODO(autrilla): this function could still use work - it shouldn't
|
||||||
# handle quitting, or printing. It should return the path, or an error.
|
# handle quitting, or printing. It should return the path, or an error.
|
||||||
base_path = self.get_target_dir()
|
base_path = self.get_target_dir()
|
||||||
|
|
||||||
binary_name = "servo" + BIN_SUFFIX
|
binary_name = "servo" + BIN_SUFFIX
|
||||||
|
|
||||||
if magicleap:
|
if android:
|
||||||
base_path = path.join(base_path, "magicleap", "aarch64-linux-android")
|
|
||||||
binary_name = "libmlservo.a"
|
|
||||||
elif android:
|
|
||||||
base_path = path.join(base_path, "android", self.config["android"]["target"])
|
base_path = path.join(base_path, "android", self.config["android"]["target"])
|
||||||
simpleservo = True
|
simpleservo = True
|
||||||
elif target:
|
elif target:
|
||||||
|
@ -862,17 +859,13 @@ install them, let us know by filing a bug!")
|
||||||
decorated_function = decorator(decorated_function)
|
decorated_function = decorator(decorated_function)
|
||||||
return decorated_function
|
return decorated_function
|
||||||
|
|
||||||
def pick_target_triple(self, target, android, magicleap):
|
def pick_target_triple(self, target, android):
|
||||||
if android is None:
|
if android is None:
|
||||||
android = self.config["build"]["android"]
|
android = self.config["build"]["android"]
|
||||||
if target and android:
|
if target and android:
|
||||||
assert self.handle_android_target(target)
|
assert self.handle_android_target(target)
|
||||||
if android and not target:
|
if android and not target:
|
||||||
target = self.config["android"]["target"]
|
target = self.config["android"]["target"]
|
||||||
if magicleap and not target:
|
|
||||||
target = "aarch64-linux-android"
|
|
||||||
if target and not android and not magicleap:
|
|
||||||
android = self.handle_android_target(target)
|
|
||||||
return target, android
|
return target, android
|
||||||
|
|
||||||
# A guess about which platforms should use the gstreamer media stack
|
# A guess about which platforms should use the gstreamer media stack
|
||||||
|
@ -894,14 +887,14 @@ install them, let us know by filing a bug!")
|
||||||
def run_cargo_build_like_command(
|
def run_cargo_build_like_command(
|
||||||
self, command, cargo_args,
|
self, command, cargo_args,
|
||||||
env=None, verbose=False,
|
env=None, verbose=False,
|
||||||
target=None, android=False, magicleap=False, libsimpleservo=False,
|
target=None, android=False, libsimpleservo=False,
|
||||||
features=None, debug_mozjs=False, with_debug_assertions=False,
|
features=None, debug_mozjs=False, with_debug_assertions=False,
|
||||||
with_frame_pointer=False, without_wgl=False,
|
with_frame_pointer=False, without_wgl=False,
|
||||||
with_layout_2020=False, with_layout_2013=False,
|
with_layout_2020=False, with_layout_2013=False,
|
||||||
uwp=False, media_stack=None,
|
uwp=False, media_stack=None,
|
||||||
):
|
):
|
||||||
env = env or self.build_env()
|
env = env or self.build_env()
|
||||||
target, android = self.pick_target_triple(target, android, magicleap)
|
target, android = self.pick_target_triple(target, android)
|
||||||
|
|
||||||
args = []
|
args = []
|
||||||
if "--manifest-path" not in cargo_args:
|
if "--manifest-path" not in cargo_args:
|
||||||
|
@ -926,8 +919,6 @@ install them, let us know by filing a bug!")
|
||||||
if "-p" not in cargo_args: # We're building specific package, that may not have features
|
if "-p" not in cargo_args: # We're building specific package, that may not have features
|
||||||
if self.config["build"]["debug-mozjs"] or debug_mozjs:
|
if self.config["build"]["debug-mozjs"] or debug_mozjs:
|
||||||
features.append("debugmozjs")
|
features.append("debugmozjs")
|
||||||
if not magicleap:
|
|
||||||
features.append("native-bluetooth")
|
|
||||||
if uwp:
|
if uwp:
|
||||||
features.append("no-wgl")
|
features.append("no-wgl")
|
||||||
features.append("uwp")
|
features.append("uwp")
|
||||||
|
|
|
@ -36,13 +36,13 @@ class MachCommands(CommandBase):
|
||||||
help="Command-line arguments to be passed through to cargo check")
|
help="Command-line arguments to be passed through to cargo check")
|
||||||
@CommandBase.build_like_command_arguments
|
@CommandBase.build_like_command_arguments
|
||||||
def check(self, params, features=[], media_stack=None, target=None,
|
def check(self, params, features=[], media_stack=None, target=None,
|
||||||
android=False, magicleap=False, **kwargs):
|
android=False, **kwargs):
|
||||||
if not params:
|
if not params:
|
||||||
params = []
|
params = []
|
||||||
|
|
||||||
features = features or []
|
features = features or []
|
||||||
|
|
||||||
target, android = self.pick_target_triple(target, android, magicleap)
|
target, android = self.pick_target_triple(target, android)
|
||||||
|
|
||||||
features += self.pick_media_stack(media_stack, target)
|
features += self.pick_media_stack(media_stack, target)
|
||||||
|
|
||||||
|
@ -130,13 +130,13 @@ class MachCommands(CommandBase):
|
||||||
help="Command-line arguments to be passed through to cargo-fix")
|
help="Command-line arguments to be passed through to cargo-fix")
|
||||||
@CommandBase.build_like_command_arguments
|
@CommandBase.build_like_command_arguments
|
||||||
def cargo_fix(self, params, features=[], media_stack=None, target=None,
|
def cargo_fix(self, params, features=[], media_stack=None, target=None,
|
||||||
android=False, magicleap=False, **kwargs):
|
android=False, **kwargs):
|
||||||
if not params:
|
if not params:
|
||||||
params = []
|
params = []
|
||||||
|
|
||||||
features = features or []
|
features = features or []
|
||||||
|
|
||||||
target, android = self.pick_target_triple(target, android, magicleap)
|
target, android = self.pick_target_triple(target, android)
|
||||||
|
|
||||||
features += self.pick_media_stack(media_stack, target)
|
features += self.pick_media_stack(media_stack, target)
|
||||||
|
|
||||||
|
@ -154,13 +154,13 @@ class MachCommands(CommandBase):
|
||||||
help="Command-line arguments to be passed through to cargo-clippy")
|
help="Command-line arguments to be passed through to cargo-clippy")
|
||||||
@CommandBase.build_like_command_arguments
|
@CommandBase.build_like_command_arguments
|
||||||
def cargo_clippy(self, params, features=[], media_stack=None, target=None,
|
def cargo_clippy(self, params, features=[], media_stack=None, target=None,
|
||||||
android=False, magicleap=False, **kwargs):
|
android=False, **kwargs):
|
||||||
if not params:
|
if not params:
|
||||||
params = []
|
params = []
|
||||||
|
|
||||||
features = features or []
|
features = features or []
|
||||||
|
|
||||||
target, android = self.pick_target_triple(target, android, magicleap)
|
target, android = self.pick_target_triple(target, android)
|
||||||
|
|
||||||
features += self.pick_media_stack(media_stack, target)
|
features += self.pick_media_stack(media_stack, target)
|
||||||
|
|
||||||
|
|
|
@ -65,9 +65,6 @@ PACKAGES = {
|
||||||
'macbrew': [
|
'macbrew': [
|
||||||
'target/release/brew/servo.tar.gz',
|
'target/release/brew/servo.tar.gz',
|
||||||
],
|
],
|
||||||
'magicleap': [
|
|
||||||
'target/magicleap/aarch64-linux-android/release/Servo.mpk',
|
|
||||||
],
|
|
||||||
'maven': [
|
'maven': [
|
||||||
'target/android/gradle/servoview/maven/org/mozilla/servoview/servoview-armv7/',
|
'target/android/gradle/servoview/maven/org/mozilla/servoview/servoview-armv7/',
|
||||||
'target/android/gradle/servoview/maven/org/mozilla/servoview/servoview-x86/',
|
'target/android/gradle/servoview/maven/org/mozilla/servoview/servoview-x86/',
|
||||||
|
@ -129,10 +126,6 @@ class PackageCommands(CommandBase):
|
||||||
default=None,
|
default=None,
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Package Android')
|
help='Package Android')
|
||||||
@CommandArgument('--magicleap',
|
|
||||||
default=None,
|
|
||||||
action='store_true',
|
|
||||||
help='Package Magic Leap')
|
|
||||||
@CommandArgument('--target', '-t',
|
@CommandArgument('--target', '-t',
|
||||||
default=None,
|
default=None,
|
||||||
help='Package for given target platform')
|
help='Package for given target platform')
|
||||||
|
@ -148,7 +141,7 @@ class PackageCommands(CommandBase):
|
||||||
action='append',
|
action='append',
|
||||||
help='Create an APPX package')
|
help='Create an APPX package')
|
||||||
@CommandArgument('--ms-app-store', default=None, action='store_true')
|
@CommandArgument('--ms-app-store', default=None, action='store_true')
|
||||||
def package(self, release=False, dev=False, android=None, magicleap=None, debug=False,
|
def package(self, release=False, dev=False, android=None, debug=False,
|
||||||
debugger=None, target=None, flavor=None, maven=False, uwp=None, ms_app_store=False):
|
debugger=None, target=None, flavor=None, maven=False, uwp=None, ms_app_store=False):
|
||||||
if android is None:
|
if android is None:
|
||||||
android = self.config["build"]["android"]
|
android = self.config["build"]["android"]
|
||||||
|
@ -159,14 +152,10 @@ class PackageCommands(CommandBase):
|
||||||
android = self.handle_android_target(target)
|
android = self.handle_android_target(target)
|
||||||
else:
|
else:
|
||||||
target = self.config["android"]["target"]
|
target = self.config["android"]["target"]
|
||||||
if target and magicleap:
|
|
||||||
print("Please specify either --target or --magicleap.")
|
|
||||||
sys.exit(1)
|
|
||||||
if magicleap:
|
|
||||||
target = "aarch64-linux-android"
|
|
||||||
env = self.build_env(target=target)
|
env = self.build_env(target=target)
|
||||||
binary_path = self.get_binary_path(
|
binary_path = self.get_binary_path(
|
||||||
release, dev, target=target, android=android, magicleap=magicleap,
|
release, dev, target=target, android=android,
|
||||||
simpleservo=uwp is not None
|
simpleservo=uwp is not None
|
||||||
)
|
)
|
||||||
dir_to_root = self.get_top_dir()
|
dir_to_root = self.get_top_dir()
|
||||||
|
@ -174,40 +163,6 @@ class PackageCommands(CommandBase):
|
||||||
if uwp:
|
if uwp:
|
||||||
vs_info = self.vs_dirs()
|
vs_info = self.vs_dirs()
|
||||||
build_uwp(uwp, dev, vs_info['msbuild'], ms_app_store)
|
build_uwp(uwp, dev, vs_info['msbuild'], ms_app_store)
|
||||||
elif magicleap:
|
|
||||||
if platform.system() not in ["Darwin"]:
|
|
||||||
raise Exception("Magic Leap builds are only supported on macOS.")
|
|
||||||
if not env.get("MAGICLEAP_SDK"):
|
|
||||||
raise Exception("Magic Leap builds need the MAGICLEAP_SDK environment variable")
|
|
||||||
if not env.get("MLCERT"):
|
|
||||||
raise Exception("Magic Leap builds need the MLCERT environment variable")
|
|
||||||
# GStreamer configuration
|
|
||||||
env.setdefault("GSTREAMER_DIR", path.join(
|
|
||||||
self.get_target_dir(), "magicleap", target, "native", "gstreamer-1.16.0"
|
|
||||||
))
|
|
||||||
|
|
||||||
mabu = path.join(env.get("MAGICLEAP_SDK"), "mabu")
|
|
||||||
packages = [
|
|
||||||
"./support/magicleap/Servo.package",
|
|
||||||
]
|
|
||||||
if dev:
|
|
||||||
build_type = "lumin_debug"
|
|
||||||
else:
|
|
||||||
build_type = "lumin_release"
|
|
||||||
for package in packages:
|
|
||||||
argv = [
|
|
||||||
mabu,
|
|
||||||
"-o", target_dir,
|
|
||||||
"-t", build_type,
|
|
||||||
"-r",
|
|
||||||
"GSTREAMER_DIR=" + env["GSTREAMER_DIR"],
|
|
||||||
package
|
|
||||||
]
|
|
||||||
try:
|
|
||||||
subprocess.check_call(argv, env=env)
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
print("Packaging Magic Leap exited with return value %d" % e.returncode)
|
|
||||||
return e.returncode
|
|
||||||
elif android:
|
elif android:
|
||||||
android_target = self.config["android"]["target"]
|
android_target = self.config["android"]["target"]
|
||||||
if "aarch64" in android_target:
|
if "aarch64" in android_target:
|
||||||
|
@ -448,10 +403,6 @@ class PackageCommands(CommandBase):
|
||||||
@CommandArgument('--android',
|
@CommandArgument('--android',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Install on Android')
|
help='Install on Android')
|
||||||
@CommandArgument('--magicleap',
|
|
||||||
default=None,
|
|
||||||
action='store_true',
|
|
||||||
help='Install on Magic Leap')
|
|
||||||
@CommandArgument('--emulator',
|
@CommandArgument('--emulator',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='For Android, install to the only emulated device')
|
help='For Android, install to the only emulated device')
|
||||||
|
@ -461,43 +412,28 @@ class PackageCommands(CommandBase):
|
||||||
@CommandArgument('--target', '-t',
|
@CommandArgument('--target', '-t',
|
||||||
default=None,
|
default=None,
|
||||||
help='Install the given target platform')
|
help='Install the given target platform')
|
||||||
def install(self, release=False, dev=False, android=False, magicleap=False, emulator=False, usb=False, target=None):
|
def install(self, release=False, dev=False, android=False, emulator=False, usb=False, target=None):
|
||||||
if target and android:
|
if target and android:
|
||||||
print("Please specify either --target or --android.")
|
print("Please specify either --target or --android.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if not android:
|
if not android:
|
||||||
android = self.handle_android_target(target)
|
android = self.handle_android_target(target)
|
||||||
if target and magicleap:
|
|
||||||
print("Please specify either --target or --magicleap.")
|
|
||||||
sys.exit(1)
|
|
||||||
if magicleap:
|
|
||||||
target = "aarch64-linux-android"
|
|
||||||
env = self.build_env(target=target)
|
env = self.build_env(target=target)
|
||||||
try:
|
try:
|
||||||
binary_path = self.get_binary_path(release, dev, android=android, magicleap=magicleap)
|
binary_path = self.get_binary_path(release, dev, android=android)
|
||||||
except BuildNotFound:
|
except BuildNotFound:
|
||||||
print("Servo build not found. Building servo...")
|
print("Servo build not found. Building servo...")
|
||||||
result = Registrar.dispatch(
|
result = Registrar.dispatch(
|
||||||
"build", context=self.context, release=release, dev=dev, android=android, magicleap=magicleap,
|
"build", context=self.context, release=release, dev=dev, android=android,
|
||||||
)
|
)
|
||||||
if result:
|
if result:
|
||||||
return result
|
return result
|
||||||
try:
|
try:
|
||||||
binary_path = self.get_binary_path(release, dev, android=android, magicleap=magicleap)
|
binary_path = self.get_binary_path(release, dev, android=android)
|
||||||
except BuildNotFound:
|
except BuildNotFound:
|
||||||
print("Rebuilding Servo did not solve the missing build problem.")
|
print("Rebuilding Servo did not solve the missing build problem.")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if magicleap:
|
|
||||||
if not env.get("MAGICLEAP_SDK"):
|
|
||||||
raise Exception("Magic Leap installs need the MAGICLEAP_SDK environment variable")
|
|
||||||
mldb = path.join(env.get("MAGICLEAP_SDK"), "tools", "mldb", "mldb")
|
|
||||||
pkg_path = path.join(path.dirname(binary_path), "Servo.mpk")
|
|
||||||
exec_command = [
|
|
||||||
mldb,
|
|
||||||
"install", "-u",
|
|
||||||
pkg_path,
|
|
||||||
]
|
|
||||||
elif android:
|
elif android:
|
||||||
pkg_path = self.get_apk_path(release)
|
pkg_path = self.get_apk_path(release)
|
||||||
exec_command = [self.android_adb_path(env)]
|
exec_command = [self.android_adb_path(env)]
|
||||||
|
@ -516,7 +452,7 @@ class PackageCommands(CommandBase):
|
||||||
if not path.exists(pkg_path):
|
if not path.exists(pkg_path):
|
||||||
print("Servo package not found. Packaging servo...")
|
print("Servo package not found. Packaging servo...")
|
||||||
result = Registrar.dispatch(
|
result = Registrar.dispatch(
|
||||||
"package", context=self.context, release=release, dev=dev, android=android, magicleap=magicleap,
|
"package", context=self.context, release=release, dev=dev, android=android,
|
||||||
)
|
)
|
||||||
if result != 0:
|
if result != 0:
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -241,7 +241,7 @@ class PostBuildCommands(CommandBase):
|
||||||
'params', nargs='...',
|
'params', nargs='...',
|
||||||
help="Command-line arguments to be passed through to cargo doc")
|
help="Command-line arguments to be passed through to cargo doc")
|
||||||
@CommandBase.build_like_command_arguments
|
@CommandBase.build_like_command_arguments
|
||||||
def doc(self, params, features, target=None, android=False, magicleap=False,
|
def doc(self, params, features, target=None, android=False,
|
||||||
media_stack=None, **kwargs):
|
media_stack=None, **kwargs):
|
||||||
self.ensure_bootstrapped(rustup_components=["rust-docs"])
|
self.ensure_bootstrapped(rustup_components=["rust-docs"])
|
||||||
rustc_path = check_output(
|
rustc_path = check_output(
|
||||||
|
@ -272,7 +272,7 @@ class PostBuildCommands(CommandBase):
|
||||||
|
|
||||||
features = features or []
|
features = features or []
|
||||||
|
|
||||||
target, android = self.pick_target_triple(target, android, magicleap)
|
target, android = self.pick_target_triple(target, android)
|
||||||
|
|
||||||
features += self.pick_media_stack(media_stack, target)
|
features += self.pick_media_stack(media_stack, target)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue