Ticket #3064: 0001-Let-hulahop-know-about-xulrunner-path-via-envar-3064.patch

File 0001-Let-hulahop-know-about-xulrunner-path-via-envar-3064.patch, 2.2 KB (added by alsroot, 13 years ago)
  • configure.ac

    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]) 
    4343# to link to xpcom at build time. Which involves various hacks.
    4444LIBXUL_SDK_DIR=`$PKG_CONFIG --variable=sdkdir libxul`
    4545LIBXUL_DIR="`dirname $LIBXUL_SDK_DIR`/xulrunner-`basename $LIBXUL_SDK_DIR|sed -e 's/^.*-\(@<:@0-9.@:>@\+\)$/\1/'`"
     46# Fallback to xulrunner-sdk directory hierarchy
     47test -e $LIBXUL_DIR || LIBXUL_DIR=$LIBXUL_SDK_DIR/bin
    4648LIBXUL_LIBS="$LIBXUL_LIBS -L$LIBXUL_DIR -lpyxpcom"
    4749
    4850LIBXUL_CFLAGS=`$PKG_CONFIG --cflags --define-variable=includetype=unstable libxul`
  • python/config.py.in

    diff --git a/python/config.py.in b/python/config.py.in
    index f838575..428d752 100644
    a b  
    1 libxul_dir = '@LIBXUL_DIR@'
     1import os
     2
     3libxul_dir = os.environ.get('LIBXUL_DIR', '@LIBXUL_DIR@')
  • src/hulahop.cpp

    diff --git a/src/hulahop.cpp b/src/hulahop.cpp
    index 01a9886..5904e07 100644
    a b gboolean 
    5151hulahop_startup()
    5252{
    5353    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;
    5459
    5560    setup_plugin_path();
    5661
    5762    hulahop_add_components_path(LIB_DIR"/components");
    5863
    5964    nsCOMPtr<nsILocalFile> greDir;
    60     rv = NS_NewNativeLocalFile(nsCString(LIBXUL_DIR), PR_TRUE,
     65    rv = NS_NewNativeLocalFile(nsCString(libxul_dir), PR_TRUE,
    6166                               getter_AddRefs(greDir));
    6267    NS_ENSURE_SUCCESS(rv, FALSE);
    6368
    6469    nsCOMPtr<nsILocalFile> binDir;
    65     rv = NS_NewNativeLocalFile(nsCString(LIBXUL_DIR), PR_TRUE,
     70    rv = NS_NewNativeLocalFile(nsCString(libxul_dir), PR_TRUE,
    6671                               getter_AddRefs(binDir));
    6772    NS_ENSURE_SUCCESS(rv, FALSE);
    6873