* * *

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-10-20  Andreas Rottmann  <a.rottmann@gmx.at>
+
+	* gir/Makefile.am (girepository): New target. This target creates
+	a symbolic link that is needed so that the tests using the
+	repository work when the typelibs are not installed.
+	* tests/repository/Makefile.am (TESTS_ENVIRONMENT): Set
+	XDG_DATA_DIRS, so tests work when the typelibs are not installed.
+
+	* tests/scanner/Makefile.am (%.typelib): Set PYTHONPATH
+	appropriatly when invoking the scanner.
+	* tests/types/Makefile.am (%typelib): Likewise.
+
 2008-10-19  Colin Walters  <walters@verbum.org>
 
 	* giscanner/girparser.py: Parse array length= to ensure
diff --git a/gir/Makefile.am b/gir/Makefile.am
--- a/gir/Makefile.am
+++ b/gir/Makefile.am
@@ -119,6 +119,11 @@
 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
 	$(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
 
+girepository: Makefile
+	rm -f girepository && ln -s . girepository
+CLEANFILES += girepository
+nodist_noinst_DATA = girepository
+
 typelibsdir = $(datadir)/girepository
 typelibs_DATA = GLib-2.0.typelib GModule-2.0.typelib GObject-2.0.typelib Gio-2.0.typelib
 CLEANFILES += $(typelibs_DATA)
diff --git a/tests/types/Makefile.am b/tests/types/Makefile.am
--- a/tests/types/Makefile.am
+++ b/tests/types/Makefile.am
@@ -41,4 +41,4 @@
 
 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
 	$(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
-	$(SCANNER) --typelib-xml $< > $<.tmp && mv $<.tmp $<.txml
+	PYTHONPATH=$(top_builddir):$$PYTHONPATH $(SCANNER) --typelib-xml $< > $<.tmp && mv $<.tmp $<.txml
