static void
gconf_configure (void)
{
  JBVariable *variable;

  jb_require_program("gconftool-2");

  if (! strcmp(jb_variable_get_string("gconf-config-source"), "autodetect"))
    {
      char *config_source;

      if (! jb_exec_expand(&config_source, NULL, "$gconftool-2 --get-default-source", NULL))
	jb_error("unable to detect the GConf configuration source address");

      jb_variable_set_string("gconf-config-source", config_source);
      g_free(config_source);
    }

  /* fix the default schemas dir on Ubuntu */
  variable = jb_variable_get_variable_or_error("gconf-schemas-dir");
  if (! variable->user_set)
    {
      static const char *ubuntu_dir = "$datadir/gconf/schemas";
      char *expanded;

      expanded = jb_variable_expand(ubuntu_dir, NULL);

      if (g_file_test(expanded, G_FILE_TEST_IS_DIR))
	jb_variable_set_string("gconf-schemas-dir", ubuntu_dir);

      g_free(expanded);
    }
}
static void
gnome_help_check_dir (const char *name,
		      const char *description,
		      const char *scrollkeeper_config_arg)
{
  const char *dir;
  char *result;

  dir = jb_variable_get_string(name);
  if (strcmp(dir, "autodetect"))
    return;

  jb_require_program("scrollkeeper-config");

  jb_message_checking("for the %s", description);

  if (jb_exec_expand(&result, NULL, "$scrollkeeper-config $arg",
		     "arg", scrollkeeper_config_arg,
		     NULL))
    {
      jb_message_result_string(result);
      jb_variable_set_string(name, result);
    }
  else
    {
      jb_message_result_string("not found");
      jb_error("unable to autodetect the %s", description);
    }

  g_free(result);
}
gboolean
jb_evolution_plugin_check (const char *minversion)
{
  char *packages;
  gboolean result;

  if (! minversion)
    minversion = "2.12";

  packages = g_strdup_printf("evolution-plugin-3.0 >= %s evolution-shell-3.0 libemail-engine", minversion);
  result = jb_check_packages("Evolution", "evolution-plugin", packages);
  g_free(packages);

  if (! result)
    return FALSE;

  if (! strcmp(jb_variable_get_string("evolution-plugin-dir"), "autodetect"))
    {
      char *plugindir;

      jb_message_checking("for the Evolution plugin directory");
      plugindir = jb_get_package_variable("evolution-plugin-3.0", "plugindir");
      jb_message_result_string(plugindir ? plugindir : "not found");

      if (! plugindir)
	return FALSE;

      jb_variable_set_string("evolution-plugin-dir", plugindir);
      g_free(plugindir);
    }

  return jb_check_packages("Evolution", "camel", "camel-1.2");
}
static void
gob2_configure (void)
{
  const char *minversion_string;
  Version minversion;
  char *error = NULL;

  minversion_string = jb_variable_get_string("gob2-minversion");
  if (! parse_version(minversion_string, &minversion))
    g_error("invalid gob2-minversion \"%s\"", minversion_string);

  if (jb_check_program("gob2"))
    {
      char *output;
      gboolean result = FALSE;

      jb_message_checking("for gob2 >= %s", minversion_string);

      if (jb_exec_expand(NULL, &output, "$gob2 --version", NULL))
	{
	  char *version_string;
	  Version version;

	  if (parse_gob2_version_output(output, &version_string, &version))
	    {
	      if (version_to_int(&version) >= version_to_int(&minversion))
		result = TRUE;
	      else
		error = g_strdup_printf("One or more .gob source files were modified but the version of gob2 (%s) is too old. Please install gob2 >= %s and run configure again.",
					version_string,
					minversion_string);
	    }
	  else
	    error = get_gob2_not_found_error(minversion_string);
	}
      else
	error = get_gob2_not_found_error(minversion_string);

      g_free(output);

      jb_message_result_bool(result);
    }
  else
    error = get_gob2_not_found_error(minversion_string);

  jb_variable_set_string("gob2-error", error);
  g_free(error);
}
Exemple #5
0
static void
report_invalid_prefix (void)
{
  const char *gnome_prefix;

  jb_check_gnome_prefix();

  gnome_prefix = jb_variable_get_string("gnome-prefix");
  if (*gnome_prefix == '\0')
    jb_warning_expand("$human-package must be installed in the same prefix as GNOME, but the GNOME prefix could not be found. $human-package might be inoperable.", NULL);
  else
    {
      char *prefix;

      prefix = jb_variable_expand("$prefix", NULL);
      if (strcmp(prefix, gnome_prefix))
	jb_warning_expand("the $human-package prefix ($prefix) is different from the GNOME prefix ($gnome-prefix). $human-package will be inoperable. Unless you know what you are doing, please run \"./jb configure prefix=$gnome-prefix\".", NULL);
      g_free(prefix);
    }
}