diff --git a/components/constellation/Cargo.toml b/components/constellation/Cargo.toml index 2bb5bf03b95..b70bde4341e 100644 --- a/components/constellation/Cargo.toml +++ b/components/constellation/Cargo.toml @@ -45,5 +45,5 @@ webrender_api = { git = "https://github.com/servo/webrender" } webrender_traits = { path = "../webrender_traits" } webxr-api = { git = "https://github.com/servo/webxr", features = ["ipc"] } -[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_arch="arm"), not(target_arch="aarch64")))'.dependencies] +[target.'cfg(any(target_os="macos", all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_arch="arm"), not(target_arch="aarch64"))))'.dependencies] gaol = "0.2.1" diff --git a/components/constellation/sandboxing.rs b/components/constellation/sandboxing.rs index 9905253965b..0e7858eb468 100644 --- a/components/constellation/sandboxing.rs +++ b/components/constellation/sandboxing.rs @@ -4,12 +4,15 @@ use crate::pipeline::UnprivilegedPipelineContent; use crate::serviceworker::ServiceWorkerUnprivilegedContent; -#[cfg(all( - not(target_os = "windows"), - not(target_os = "ios"), - not(target_os = "android"), - not(target_arch = "arm"), - not(target_arch = "aarch64") +#[cfg(any( + target_os = "macos", + all( + not(target_os = "windows"), + not(target_os = "ios"), + not(target_os = "android"), + not(target_arch = "arm"), + not(target_arch = "aarch64") + ) ))] use gaol::profile::{Operation, PathPattern, Profile}; use ipc_channel::Error; @@ -120,7 +123,9 @@ pub fn content_process_sandbox_profile() -> Profile { target_os = "ios", target_os = "android", target_arch = "arm", - target_arch = "aarch64", + + // exclude apple arm devices + all(target_arch = "aarch64", not(target_os = "macos")) ))] pub fn content_process_sandbox_profile() { error!("Sandboxed multiprocess is not supported on this platform."); diff --git a/python/servo/gstreamer.py b/python/servo/gstreamer.py index 5a810711770..612697ffef6 100644 --- a/python/servo/gstreamer.py +++ b/python/servo/gstreamer.py @@ -9,6 +9,7 @@ import os import sys +import platform GSTREAMER_DYLIBS = [ ("gstapp", "gst-plugins-base"), @@ -117,35 +118,34 @@ def windows_plugins(uwp): return [x + ".dll" for x in dlls] -def macos_libnice(): - return os.path.join('/', 'usr', 'local', 'opt', 'libnice', 'lib') +def macos_lib_dir(): + # homebrew use /opt/homebrew on macos ARM, use /usr/local on Intel + if platform.machine() == 'arm64': + return os.path.join('/', 'opt', 'homebrew', 'lib') + return os.path.join('/', 'usr', 'local', 'lib') def macos_dylibs(): return [ os.path.join( - "/usr/local/opt", - path, - "lib", + macos_lib_dir(), "lib" + name + "-1.0.0.dylib" ) for name, path in GSTREAMER_DYLIBS ] + [ - os.path.join(macos_libnice(), "libnice.dylib"), - os.path.join(macos_libnice(), "libnice.10.dylib"), + os.path.join(macos_lib_dir(), "libnice.dylib"), + os.path.join(macos_lib_dir(), "libnice.10.dylib"), ] def macos_plugins(): return [ os.path.join( - "/usr/local/opt", - path, - "lib", - "gstreamer-1.0", + macos_lib_dir(), + 'gstreamer-1.0', "lib" + name + ".dylib" ) for name, path in GSTREAMER_PLUGINS + MACOS_PLUGINS ] + [ - os.path.join(macos_libnice(), "gstreamer-1.0", "libgstnice.dylib"), + os.path.join(macos_lib_dir(), "gstreamer-1.0", "libgstnice.dylib"), ]