Review fixes

This commit is contained in:
Manish Goregaokar 2018-09-06 12:24:11 +05:30
parent f270f3798d
commit d3ece2bc49
3 changed files with 14 additions and 14 deletions

View file

@ -37,7 +37,7 @@ def install_trusty_deps(force):
'/usr/bin/g++-4.9']) '/usr/bin/g++-4.9'])
if clang: if clang:
run_as_root(["bash", "-c", 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -']) run_as_root(["bash", "-c", 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -'])
run_as_root(["apt-add-repository" "deb http://apt.llvm.org/trusty/ llvm-toolchain-xenial-4.0 main"], force) run_as_root(["apt-add-repository", "deb http://apt.llvm.org/trusty/ llvm-toolchain-xenial-4.0 main"], force)
run_as_root(["apt-get", "update"]) run_as_root(["apt-get", "update"])
run_as_root(["apt-get", "install", "clang-4.0"], force) run_as_root(["apt-get", "install", "clang-4.0"], force)
@ -94,9 +94,7 @@ def gstreamer(context, force=False):
cur = os.curdir cur = os.curdir
gstdir = os.path.join(cur, "support", "linux", "gstreamer") gstdir = os.path.join(cur, "support", "linux", "gstreamer")
if not os.path.isdir(os.path.join(gstdir, "gstreamer", "lib")): if not os.path.isdir(os.path.join(gstdir, "gstreamer", "lib")):
os.chdir(gstdir) subprocess.check_call(["bash", "gstreamer.sh"], cwd=gstdir)
subprocess.call(["bash", "gstreamer.sh"])
os.chdir(cur)
return True return True
return False return False
@ -328,6 +326,10 @@ def windows_msvc(context, force=False):
return 0 return 0
LINUX_SPECIFIC_BOOTSTRAPPERS = {
"salt": salt,
"gstreamer": gstreamer,
}
def bootstrap(context, force=False, specific=None): def bootstrap(context, force=False, specific=None):
'''Dispatches to the right bootstrapping function for the OS.''' '''Dispatches to the right bootstrapping function for the OS.'''
@ -346,12 +348,7 @@ def bootstrap(context, force=False, specific=None):
]: ]:
context.distro = distro context.distro = distro
context.distro_version = version context.distro_version = version
if specific == "salt": bootstrapper = LINUX_SPECIFIC_BOOTSTRAPPERS.get(specific, linux)
bootstrapper = salt
elif specific == "gstreamer":
bootstrapper = gstreamer
else:
bootstrapper = linux
else: else:
raise Exception("mach bootstrap does not support %s, please file a bug" % distro) raise Exception("mach bootstrap does not support %s, please file a bug" % distro)

View file

@ -348,6 +348,9 @@ 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_gstreamer_path(self):
return path.join(self.context.topdir, "support", "linux", "gstreamer", "gstreamer")
def get_binary_path(self, release, dev, android=False): def get_binary_path(self, release, dev, android=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.
@ -480,7 +483,7 @@ class CommandBase(object):
def needs_gstreamer_env(self, target): def needs_gstreamer_env(self, target):
if check_gstreamer_lib(): if check_gstreamer_lib():
return False return False
gstpath = path.join(self.context.topdir, "support", "linux", "gstreamer", "gstreamer") gstpath = self.get_gstreamer_path()
if sys.platform == "linux2": if sys.platform == "linux2":
if "x86_64" not in (target or host_triple()): if "x86_64" not in (target or host_triple()):
raise Exception("We don't currently support using local gstreamer builds \ raise Exception("We don't currently support using local gstreamer builds \
@ -500,7 +503,7 @@ class CommandBase(object):
"""Some commands, like test-wpt, don't use a full build env, """Some commands, like test-wpt, don't use a full build env,
but may still need dynamic search paths. This command sets that up""" but may still need dynamic search paths. This command sets that up"""
if self.needs_gstreamer_env(None): if self.needs_gstreamer_env(None):
gstpath = path.join(self.context.topdir, "support", "linux", "gstreamer", "gstreamer") gstpath = self.get_gstreamer_path()
os.environ["LD_LIBRARY_PATH"] = path.join(gstpath, "lib", "x86_64-linux-gnu") os.environ["LD_LIBRARY_PATH"] = path.join(gstpath, "lib", "x86_64-linux-gnu")
def build_env(self, hosts_file_path=None, target=None, is_build=False, test_unit=False): def build_env(self, hosts_file_path=None, target=None, is_build=False, test_unit=False):
@ -546,7 +549,7 @@ class CommandBase(object):
env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true" env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true"
if self.needs_gstreamer_env(target): if self.needs_gstreamer_env(target):
gstpath = path.join(self.context.topdir, "support", "linux", "gstreamer", "gstreamer") gstpath = self.get_gstreamer_path()
extra_path += [path.join(gstpath, "bin")] extra_path += [path.join(gstpath, "bin")]
libpath = path.join(gstpath, "lib", "x86_64-linux-gnu") libpath = path.join(gstpath, "lib", "x86_64-linux-gnu")
# we append in the reverse order so that system gstreamer libraries # we append in the reverse order so that system gstreamer libraries

View file

@ -6,7 +6,7 @@
set -o errexit set -o errexit
wget https://github.com/ferjm/gstreamer-1.14.1-ubuntu-trusty/raw/master/gstreamer.tar.gz -O gstreamer.tar.gz wget http://servo-deps.s3.amazonaws.com/gstreamer/gstreamer-x86_64-linux-gnu.tar.gz -O gstreamer.tar.gz
tar -zxf gstreamer.tar.gz tar -zxf gstreamer.tar.gz
rm gstreamer.tar.gz rm gstreamer.tar.gz
sed -i "s;prefix=/root/gstreamer;prefix=${PWD}/gstreamer;g" ${PWD}/gstreamer/lib/x86_64-linux-gnu/pkgconfig/*.pc sed -i "s;prefix=/root/gstreamer;prefix=${PWD}/gstreamer;g" ${PWD}/gstreamer/lib/x86_64-linux-gnu/pkgconfig/*.pc