From 0925e34d9ccc1be7e68fd409ce353942b5b74147 Mon Sep 17 00:00:00 2001
From: Aleksey Lim <alsroot@sugarlabs.org>
Date: Mon, 29 Aug 2011 11:10:56 +0000
Subject: [PATCH 1/2] Let hulahop know about xulrunner path via envar #3064
---
configure.ac | 2 ++
python/config.py.in | 4 +++-
src/hulahop.cpp | 9 +++++++--
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 41f618e..48971ab 100644
a
|
b
|
PKG_CHECK_MODULES([LIBXUL],[libxul]) |
43 | 43 | # to link to xpcom at build time. Which involves various hacks. |
44 | 44 | LIBXUL_SDK_DIR=`$PKG_CONFIG --variable=sdkdir libxul` |
45 | 45 | LIBXUL_DIR="`dirname $LIBXUL_SDK_DIR`/xulrunner-`basename $LIBXUL_SDK_DIR|sed -e 's/^.*-\(@<:@0-9.@:>@\+\)$/\1/'`" |
| 46 | # Fallback to xulrunner-sdk directory hierarchy |
| 47 | test -e $LIBXUL_DIR || LIBXUL_DIR=$LIBXUL_SDK_DIR/bin |
46 | 48 | LIBXUL_LIBS="$LIBXUL_LIBS -L$LIBXUL_DIR -lpyxpcom" |
47 | 49 | |
48 | 50 | LIBXUL_CFLAGS=`$PKG_CONFIG --cflags --define-variable=includetype=unstable libxul` |
diff --git a/python/config.py.in b/python/config.py.in
index f838575..428d752 100644
a
|
b
|
|
1 | | libxul_dir = '@LIBXUL_DIR@' |
| 1 | import os |
| 2 | |
| 3 | libxul_dir = os.environ.get('LIBXUL_DIR', '@LIBXUL_DIR@') |
diff --git a/src/hulahop.cpp b/src/hulahop.cpp
index 01a9886..5904e07 100644
a
|
b
|
gboolean |
51 | 51 | hulahop_startup() |
52 | 52 | { |
53 | 53 | nsresult rv; |
| 54 | const char *libxul_dir; |
| 55 | |
| 56 | libxul_dir = g_getenv ("LIBXUL_DIR"); |
| 57 | if (libxul_dir == NULL) |
| 58 | libxul_dir = LIBXUL_DIR; |
54 | 59 | |
55 | 60 | setup_plugin_path(); |
56 | 61 | |
57 | 62 | hulahop_add_components_path(LIB_DIR"/components"); |
58 | 63 | |
59 | 64 | nsCOMPtr<nsILocalFile> greDir; |
60 | | rv = NS_NewNativeLocalFile(nsCString(LIBXUL_DIR), PR_TRUE, |
| 65 | rv = NS_NewNativeLocalFile(nsCString(libxul_dir), PR_TRUE, |
61 | 66 | getter_AddRefs(greDir)); |
62 | 67 | NS_ENSURE_SUCCESS(rv, FALSE); |
63 | 68 | |
64 | 69 | nsCOMPtr<nsILocalFile> binDir; |
65 | | rv = NS_NewNativeLocalFile(nsCString(LIBXUL_DIR), PR_TRUE, |
| 70 | rv = NS_NewNativeLocalFile(nsCString(libxul_dir), PR_TRUE, |
66 | 71 | getter_AddRefs(binDir)); |
67 | 72 | NS_ENSURE_SUCCESS(rv, FALSE); |
68 | 73 | |