aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2018-09-03 13:34:24 +0530
committerManish Goregaokar <manishsmail@gmail.com>2018-09-11 19:34:38 +0530
commiteba68a1a4947b29bcc58fbc502cb70dcc0ac71c0 (patch)
tree12efbf2822d90075c282a8a575a36f2e205bc2a7
parent1913ac706cef91125fa8e50629548826c60a66d3 (diff)
downloadservo-eba68a1a4947b29bcc58fbc502cb70dcc0ac71c0.tar.gz
servo-eba68a1a4947b29bcc58fbc502cb70dcc0ac71c0.zip
Add mach bootstrap-gstreamer
-rw-r--r--README.md1
-rw-r--r--python/servo/bootstrap.py11
-rw-r--r--python/servo/bootstrap_commands.py9
-rw-r--r--servo-tidy.toml1
-rw-r--r--support/linux/gstreamer/gstreamer.sh14
5 files changed, 30 insertions, 6 deletions
diff --git a/README.md b/README.md
index 54d8c8fc793..07c0883b69f 100644
--- a/README.md
+++ b/README.md
@@ -91,6 +91,7 @@ sudo apt install git curl autoconf libx11-dev \
```
If you using a version prior to **Ubuntu 17.04** or **Debian Sid**, replace `libssl1.0-dev` with `libssl-dev`.
+Additionally, you'll need a local copy of GStreamer with a version later than 12.0. You can place it in `support/linux/gstreamer/gstreamer`, or run `./mach bootstrap-gstreamer` to set it up.
If you are using **Ubuntu 16.04** run `export HARFBUZZ_SYS_NO_PKG_CONFIG=1` before building to avoid an error with harfbuzz.
diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py
index 7bfa80bd8f4..d6d9dc1d1e6 100644
--- a/python/servo/bootstrap.py
+++ b/python/servo/bootstrap.py
@@ -18,8 +18,8 @@ from servo.util import extract, download_file, host_triple
def check_gstreamer_lib():
- subprocess.call(["pkg-config", "gstreamer-1.0 >= 1.12"],
- stdout=PIPE, stderr=PIPE) == 0
+ return subprocess.call(["pkg-config", "gstreamer-1.0 >= 1.12"],
+ stdout=PIPE, stderr=PIPE) == 0
def run_as_root(command):
if os.geteuid() != 0:
@@ -56,7 +56,12 @@ def install_salt_dependencies(context, force):
install_linux_deps(context, pkgs_apt, pkgs_dnf, force)
def gstreamer(context, force=False):
- pass
+ cur = os.curdir
+ gstdir = os.path.join(cur, "support", "linux", "gstreamer")
+ if not os.path.isdir(os.path.join(gstdir, "gstreamer", "lib")):
+ os.chdir(gstdir)
+ subprocess.call(["bash", "gstreamer.sh"])
+ os.chdir(cur)
def linux(context, force=False):
# Please keep these in sync with the packages in README.md
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index 66508c5b959..84978737b64 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -64,6 +64,15 @@ class MachCommands(CommandBase):
def bootstrap_salt(self, force=False):
return bootstrap.bootstrap(self.context, force=force, specific="salt")
+ @Command('bootstrap-gstreamer',
+ description='Set up a local copy of the gstreamer libraries (linux only).',
+ category='bootstrap')
+ @CommandArgument('--force', '-f',
+ action='store_true',
+ help='Boostrap without confirmation')
+ def bootstrap_gstreamer(self, force=False):
+ return bootstrap.bootstrap(self.context, force=force, specific="gstreamer")
+
@Command('bootstrap-android',
description='Install the Android SDK and NDK.',
category='bootstrap')
diff --git a/servo-tidy.toml b/servo-tidy.toml
index 2645cf31588..bf1dd489553 100644
--- a/servo-tidy.toml
+++ b/servo-tidy.toml
@@ -65,6 +65,7 @@ files = [
"./resources/hsts_preload.json",
"./tests/wpt/metadata/MANIFEST.json",
"./support/android/openssl.sh",
+ "./support/linux/gstreamer/gstreamer.sh",
# Upstream code from Khronos/WebGL uses tabs for indentation
"./tests/wpt/webgl/tests",
# Our import script is not currently respecting the lint.
diff --git a/support/linux/gstreamer/gstreamer.sh b/support/linux/gstreamer/gstreamer.sh
index 436f926b535..8b18babc9ec 100644
--- a/support/linux/gstreamer/gstreamer.sh
+++ b/support/linux/gstreamer/gstreamer.sh
@@ -1,4 +1,12 @@
-wget https://github.com/ferjm/gstreamer-1.14.1-ubuntu-trusty/raw/master/gstreamer.tar.gz
-tar -zxvf gstreamer.tar.gz
+#!/usr/bin/env bash
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+set -o errexit
+
+wget https://github.com/ferjm/gstreamer-1.14.1-ubuntu-trusty/raw/master/gstreamer.tar.gz -O gstreamer.tar.gz
+tar -zxf 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