[pitivi] build: Pass all the GST_ and GTK_ environment variables
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] build: Pass all the GST_ and GTK_ environment variables
- Date: Wed, 9 Nov 2016 13:13:42 +0000 (UTC)
commit 04e027b1e789e484b78eae4f2f137ca2e41bb493
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Oct 25 12:12:58 2016 +0200
build: Pass all the GST_ and GTK_ environment variables
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1426
build/flatpak/pitivi-flatpak | 67 +++++++++++++++++++-----------------------
1 files changed, 30 insertions(+), 37 deletions(-)
---
diff --git a/build/flatpak/pitivi-flatpak b/build/flatpak/pitivi-flatpak
index ddfa46c..fff787e 100755
--- a/build/flatpak/pitivi-flatpak
+++ b/build/flatpak/pitivi-flatpak
@@ -519,49 +519,42 @@ class PitiviFlatpak: # pylint: disable=too-many-instance-attributes
self.run_in_sandbox(*self.args, exit_on_failure=True)
def run_in_sandbox(self, *args, exit_on_failure=False, cwd=None):
- env_args = ["flatpak", "build", "--socket=x11",
- "--socket=session-bus", "--socket=pulseaudio",
- "--share=network", "--env=PITIVI_DEVELOPMENT=1",
- "--env=CC=ccache gcc",
- "--env=CXX=ccache g++"]
-
- for envvar in [
- "DISPLAY",
- "GST_CHECKS",
- "GST_DEBUG",
- "GST_DEBUG_DUMP_DOT_DIR",
- ("GST_ENCODING_TARGET_PATH",
- "/app/share/gstreamer-1.0/presets/:/app/share/pitivi/gstpresets/"),
- ("GST_PLUGIN_SYSTEM_PATH", "/app/lib/gstreamer-1.0/"),
- ("GST_PRESET_PATH",
- "/app/share/gstreamer-1.0/presets/:/app/share/pitivi/gstpresets/"),
- "GST_VALIDATE",
- "GST_VALIDATE_APPS_DIR",
- "GST_VALIDATE_LAUNCHER_DEBUG",
- "GTK_DEBUG",
- "GTK_THEME",
- "LANG",
- "PITIVI_DEBUG",
- "PITIVI_DEVELOPMENT"]:
- if not isinstance(envvar, str):
- value = envvar[1] + ":" + os.environ.get(envvar[0], "")
- envvar = envvar[0]
- else:
- value = os.environ.get(envvar)
-
- if value:
- env_args.append("--env=%s=%s" % (envvar, value))
-
- env_args.append(self.prefix)
+ flatpak_command = ["flatpak", "build", "--socket=x11",
+ "--socket=session-bus", "--socket=pulseaudio",
+ "--share=network", "--env=PITIVI_DEVELOPMENT=1",
+ "--env=CC=ccache gcc",
+ "--env=CXX=ccache g++"]
+
+ # The forwarded environment variables.
+ forwarded = {}
+ for envvar, value in os.environ.items():
+ if envvar.split("_")[0] in ("GST", "GTK", "PITIVI") or \
+ envvar in ["DISPLAY", "LANG"]:
+ forwarded[envvar] = value
+
+ prefixes = {
+ "GST_ENCODING_TARGET_PATH":
+ "/app/share/gstreamer-1.0/presets/:/app/share/pitivi/gstpresets/",
+ "GST_PLUGIN_SYSTEM_PATH": "/app/lib/gstreamer-1.0/",
+ "GST_PRESET_PATH":
+ "/app/share/gstreamer-1.0/presets/:/app/share/pitivi/gstpresets/"}
+ for envvar, path in prefixes.items():
+ value = forwarded.get(envvar, "")
+ forwarded[envvar] = "%s:%s" % (path, value)
+
+ for envvar, value in forwarded.items():
+ flatpak_command.append("--env=%s=%s" % (envvar, value))
+
+ flatpak_command.append(self.prefix)
if args:
- env_args.extend(args)
+ flatpak_command.extend(args)
else:
- env_args.append(os.path.join(self.scriptdir, "enter-env"))
+ flatpak_command.append(os.path.join(self.scriptdir, "enter-env"))
message("Running in sandbox: %s", ' '.join(args))
try:
- subprocess.check_call(env_args, cwd=cwd)
+ subprocess.check_call(flatpak_command, cwd=cwd)
except subprocess.CalledProcessError as e:
if exit_on_failure:
self.exit(e.returncode)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]