aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc
diff options
context:
space:
mode:
authorGravatar Mason Larobina <mason.larobina@gmail.com>2010-01-04 20:48:12 +0800
committerGravatar Mason Larobina <mason.larobina@gmail.com>2010-01-04 20:48:12 +0800
commit2912e4f5ff445e2e0417808fcdd92ccd9e379045 (patch)
tree50efea7e9a5efd9a55c46c3171422e3366ae1231 /misc
parent9dd1370d0b7cd876f004f7a822b0357039252184 (diff)
The sandbox/ directory is created when any sandbox make target is run.
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/env.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/misc/env.sh b/misc/env.sh
new file mode 100755
index 0000000..4eec525
--- /dev/null
+++ b/misc/env.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# This script is copied in to the sandbox/ directory during any sandbox make
+# target and is used to create an isolated environment for uzbl-core,
+# uzbl-browser and uzbl-tabbed to be run and tested.
+
+# It would be better to use something more flexible like $(dirname $0) but I
+# couldn't get to work nicely from the Makefile:
+# - Sourcing file gives $0 == /bin/sh
+# - Executing limits scope of variables too much (even with exporting)
+# Maybe we should spawn processes from here with an 'exec' at the end?
+
+# Re-define our home location inside the sandbox dir.
+export HOME=./sandbox/home
+
+# Export default XDG_{DATA,CACHE,..}_HOME locations inside the sandbox
+# directory according to defaults in the xdg specification.
+# <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>
+export XDG_DATA_HOME=$HOME/.local/share
+export XDG_CACHE_HOME=$HOME/.cache
+export XDG_CONFIG_HOME=$HOME/.config
+
+# Now update the path to include our sandbox bin directory.
+export PATH="./sandbox/usr/local/bin:$PATH"