[gobject-introspection] Windows port: Make g-ir-annotiotion-tool, g-ir-doc-tool and g-ir-scanner 'relocatable' at runtime.
- From: Dieter Verfaillie <dieterv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Windows port: Make g-ir-annotiotion-tool, g-ir-doc-tool and g-ir-scanner 'relocatable' at runtime.
- Date: Wed, 7 Sep 2011 20:29:50 +0000 (UTC)
commit 0102c517c44d3e8fc3baf2394cb92281511941e3
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date: Mon Sep 5 21:49:05 2011 +0200
Windows port: Make g-ir-annotiotion-tool, g-ir-doc-tool and g-ir-scanner 'relocatable' at runtime.
https://bugzilla.gnome.org/show_bug.cgi?id=620566
tools/g-ir-annotation-tool.in | 15 ++++++++++++---
tools/g-ir-doc-tool.in | 13 +++++++++++--
tools/g-ir-scanner.in | 13 +++++++++++--
3 files changed, 34 insertions(+), 7 deletions(-)
---
diff --git a/tools/g-ir-annotation-tool.in b/tools/g-ir-annotation-tool.in
index 5668cbe..9ce008d 100755
--- a/tools/g-ir-annotation-tool.in
+++ b/tools/g-ir-annotation-tool.in
@@ -23,7 +23,12 @@ import os
import sys
import __builtin__
-__builtin__.__dict__['DATADIR'] = "@datarootdir@"
+if os.name == 'nt':
+ datadir = os.path.join(os.path.dirname(__file__), '..', 'share')
+else:
+ datadir = "@datarootdir@"
+
+__builtin__.__dict__['DATADIR'] = datadir
if 'GI_SCANNER_DEBUG' in os.environ:
def on_exception(exctype, value, tb):
@@ -32,13 +37,17 @@ if 'GI_SCANNER_DEBUG' in os.environ:
pdb.pm()
sys.excepthook = on_exception
-srcdir=os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None)
+srcdir = os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None)
if srcdir is not None:
path = srcdir
else:
# This is a private directory, we don't want to pollute the global
# namespace.
- path = os.path.join('@libdir@', 'gobject-introspection')
+ if os.name == 'nt':
+ # Makes g-ir-annotation-tool 'relocatable' at runtime on Windows.
+ path = os.path.join(os.path.dirname(__file__), '..', 'lib', 'gobject-introspection')
+ else:
+ path = os.path.join('@libdir@', 'gobject-introspection')
sys.path.insert(0, path)
from giscanner.annotationmain import annotation_main
diff --git a/tools/g-ir-doc-tool.in b/tools/g-ir-doc-tool.in
index 4a84afa..02db10c 100644
--- a/tools/g-ir-doc-tool.in
+++ b/tools/g-ir-doc-tool.in
@@ -23,7 +23,12 @@ import os
import sys
import __builtin__
-__builtin__.__dict__['DATADIR'] = "@datarootdir@"
+if os.name == 'nt':
+ datadir = os.path.join(os.path.dirname(__file__), '..', 'share')
+else:
+ datadir = "@datarootdir@"
+
+__builtin__.__dict__['DATADIR'] = datadir
if 'GI_SCANNER_DEBUG' in os.environ:
def on_exception(exctype, value, tb):
@@ -38,7 +43,11 @@ if srcdir is not None:
else:
# This is a private directory, we don't want to pollute the global
# namespace.
- path = os.path.join('@libdir@', 'gobject-introspection')
+ if os.name == 'nt':
+ # Makes g-ir-doc-tool 'relocatable' at runtime on Windows.
+ path = os.path.join(os.path.dirname(__file__), '..', 'lib', 'gobject-introspection')
+ else:
+ path = os.path.join('@libdir@', 'gobject-introspection')
sys.path.insert(0, path)
from giscanner.docmain import doc_main
diff --git a/tools/g-ir-scanner.in b/tools/g-ir-scanner.in
index f709683..9a1b2bf 100755
--- a/tools/g-ir-scanner.in
+++ b/tools/g-ir-scanner.in
@@ -23,7 +23,12 @@ import os
import sys
import __builtin__
-__builtin__.__dict__['DATADIR'] = "@datarootdir@"
+if os.name == 'nt':
+ datadir = os.path.join(os.path.dirname(__file__), '..', 'share')
+else:
+ datadir = "@datarootdir@"
+
+__builtin__.__dict__['DATADIR'] = datadir
if 'GI_SCANNER_DEBUG' in os.environ:
def on_exception(exctype, value, tb):
@@ -38,7 +43,11 @@ if srcdir is not None:
else:
# This is a private directory, we don't want to pollute the global
# namespace.
- path = os.path.join('@libdir@', 'gobject-introspection')
+ if os.name == 'nt':
+ # Makes g-ir-scanner 'relocatable' at runtime on Windows.
+ path = os.path.join(os.path.dirname(__file__), '..', 'lib', 'gobject-introspection')
+ else:
+ path = os.path.join('@libdir@', 'gobject-introspection')
sys.path.insert(0, path)
from giscanner.scannermain import scanner_main
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]