Commit 1f762ddf authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

use .deps files to satisfy dependencies, patch by Alberto Ruiz, fixes bug

2007-08-27  Juerg Billeter  <j@bitron.ch>

	* vapigen/valavapigen.vala: use .deps files to satisfy dependencies,
	  patch by Alberto Ruiz, fixes bug 470756

	* vapi/packages/clutter-0.3/clutter-0.3.deps,
	  vapi/packages/gnome-desktop-2.0/gnome-desktop-2.0.deps,
	  vapi/packages/gtksourceview-2.0/gtksourceview-2.0.deps,
	  vapi/packages/libglade-2.0/libglade-2.0.deps,
	  vapi/packages/libwnck-1.0/libwnck-1.0.deps: add missing dependencies

svn path=/trunk/; revision=509
parent 0f107b78
2007-08-27 Jürg Billeter <j@bitron.ch>
* vapigen/valavapigen.vala: use .deps files to satisfy dependencies,
patch by Alberto Ruiz, fixes bug 470756
* vapi/packages/clutter-0.3/clutter-0.3.deps,
vapi/packages/gnome-desktop-2.0/gnome-desktop-2.0.deps,
vapi/packages/gtksourceview-2.0/gtksourceview-2.0.deps,
vapi/packages/libglade-2.0/libglade-2.0.deps,
vapi/packages/libwnck-1.0/libwnck-1.0.deps: add missing dependencies
2007-08-27 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* vapi/packages/pango/pango-custom.vala, vapi/pango.vala:
......
atk
cairo
gdk-2.0
pango
gtk+-2.0
......@@ -80,6 +80,11 @@ class Vala.VAPIGen {
}
private bool add_package (string! pkg) {
if (context.has_package (pkg)) {
// ignore multiple occurences of the same package
return true;
}
var package_path = get_package_path (pkg);
if (package_path == null) {
......@@ -91,6 +96,14 @@ class Vala.VAPIGen {
return true;
}
private static string[] get_packages_from_depsfile (string depsfile) {
string contents;
if (FileUtils.get_contents (depsfile, out contents)) {
return contents.strip ().split ("\n");
}
return null;
}
private int run () {
context = new CodeContext ();
......@@ -99,6 +112,25 @@ class Vala.VAPIGen {
Report.error (null, "glib-2.0 not found in specified Vala API directories");
}
/* load packages from .deps file */
foreach (string source in sources) {
if (!source.has_suffix (".gidl")) {
continue;
}
var depsfile = source.substring (0, source.len () - 4) + "deps";
if (!FileUtils.test (depsfile, FileTest.EXISTS)) continue;
string[] deps = get_packages_from_depsfile (depsfile);
foreach (string dep in deps) {
if (!add_package (dep)) {
Report.error (null, "%s not found in specified Vala API directories".printf (dep));
}
}
}
if (packages != null) {
foreach (string package in packages) {
if (!add_package (package)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment