[anjuta-extras] fixed #579867 – git anjuta-extras doesn't have scripts/



commit df54efe3cd6dbf831e6dd3a96936c988aa43a7be
Author: Massimo Cora <mcora src gnome org>
Date:   Fri Apr 24 21:12:17 2009 +0200

    fixed #579867 â?? git anjuta-extras doesn't have scripts/
    
    added scripts/ directory instead of using svn:external or git submodule.
---
 scripts/Makefile.am             |   13 ++++
 scripts/anjuta_project.template |  120 +++++++++++++++++++++++++++++++++++++++
 scripts/build-schemas.mk        |   42 ++++++++++++++
 scripts/builder2schema.pl       |   70 +++++++++++++++++++++++
 scripts/glade2schema.pl         |   70 +++++++++++++++++++++++
 5 files changed, 315 insertions(+), 0 deletions(-)

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 0000000..f14b8cb
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1,13 @@
+anjuta_datadir = $(anjuta_data_dir)
+
+anjuta_data_DATA = anjuta_project.template
+
+EXTRA_DIST = $(anjuta_data_DATA)
+
+# Distribute but don't install glade2schema.pl
+dist-hook:
+	cp $(srcdir)/glade2schema.pl $(distdir)
+	chmod +x $(distdir)/glade2schema.pl
+	cp $(srcdir)/builder2schema.pl $(distdir)
+	chmod +x $(distdir)/builder2schema.pl
+-include $(top_srcdir)/git.mk
diff --git a/scripts/anjuta_project.template b/scripts/anjuta_project.template
new file mode 100644
index 0000000..a4a3c8c
--- /dev/null
+++ b/scripts/anjuta_project.template
@@ -0,0 +1,120 @@
+'#' Anjuta Version ${AN_ANJUTA_VERSION:-"0.1.8"}
+Compatibility Level: ${AN_ANJUTA_COMPATIBLITY:-"1"}
+
+'<'PROJECT_DESCRIPTION_START'>'
+${AN_PROJECT_DESCRIPTION:-"Some description"}'<'PROJECT_DESCRIPTION_END'>'
+'<'CONFIG_PROGS_START'>'
+'<'CONFIG_PROGS_END'>'
+'<'CONFIG_LIBS_START'>'
+'<'CONFIG_LIBS_END'>'
+'<'CONFIG_HEADERS_START'>'
+'<'CONFIG_HEADERS_END'>'
+'<'CONFIG_CHARACTERISTICS_START'>'
+'<'CONFIG_CHARACTERISTICS_END'>'
+'<'CONFIG_LIB_FUNCS_START'>'
+'<'CONFIG_LIB_FUNCS_END'>'
+'<'CONFIG_ADDITIONAL_START'>'
+'<'CONFIG_ADDITIONAL_END'>'
+'<'CONFIG_FILES_START'>'
+'<'CONFIG_FILES_END'>'
+'<'MAKEFILE_AM_START'>'
+'<'MAKEFILE_AM_END'>'
+
+props.file.type=project
+
+anjuta.version=${AN_ANJUTA_VERSION:-"0.1.8"}
+anjuta.compatibility.level=${AN_ANJUTA_COMPATIBILITY:-"1"}
+
+project.name=${AN_PROJECT_NAME:-"unknown"}
+project.type=${AN_PROJECT_TYPE:-"GENERIC"}
+project.target.type=${AN_PROJECT_TARGET_TYPE:="EXECUTABLE"}
+project.version=${AN_PROJECT_VERSION:-"0.1"}
+project.author=${AN_PROJECT_AUTHOR:-"$(whoami)"}
+project.source.target=${AN_PROJECT_TARGET:-"unknown"}
+
+'#' List of modules '('directory or files')' to be excluded from
+'#' symbol browsing and project listing.
+project.excluded.modules=intl
+
+project.has.gettext=${AN_HAVE_GETTEXT:-"0"}
+
+project.programming.language=${AN_PROJECT_LANGUAGE:-"C"}
+
+project.menu.entry=${AN_PROJECT_MENU_ENTRY:-"Unknown"}
+project.menu.group=${AN_PROJECT_MENU_GROUP:-"Application"}
+project.menu.comment=${AN_PROJECT_MENU_COMMENT:="No comment"}
+project.menu.icon=${AN_PROJECT_MENU_ICON:-"unknown_icon.xpm"}
+project.menu.need.terminal=${AN_PROJECT_NEED_TERMINAL:-"0"}
+
+project.configure.options=
+
+anjuta.program.arguments=
+
+'#' This project has been blocked from overwriting the build files.
+'#' To unblock it, set it to 0, but at the same time, please make
+'#' sure to edit it properly.
+project.config.blocked=1
+
+project.config.disable.overwriting=1 1 1 1 1 1 1 1 1 
+project.config.extra.modules.before=
+project.config.extra.modules.after=
+
+module.include.name=${AN_PROJECT_INCLUDE_DIR:-"."}
+module.include.type=
+module.include.expanded=0
+module.include.files=${AN_HEADER_FILES}
+
+module.source.name=${AN_PROJECT_SRC_DIR:-"."}
+module.source.type=
+module.source.expanded=1
+module.source.files=${AN_SOURCE_FILES}
+
+module.pixmap.name=${AN_PROJECT_PIXMAP_DIR:-"."}
+module.pixmap.type=
+module.pixmap.expanded=0
+module.pixmap.files=${AN_PIXMAP_FILES}
+
+module.data.name=${AN_PROJECT_DATA_DIR:-"."}
+module.data.type=
+module.data.expanded=0
+module.data.files=${AN_DATA_FILES}
+
+module.help.name=${AN_PROJECT_HELP_DIR:-"."}
+module.help.type=
+module.help.expanded=0
+module.help.files=${AN_HELP_FILES}
+
+module.doc.name=${AN_PROJECT_DOC_DIR:-"."}
+module.doc.type=
+module.doc.expanded=0
+module.doc.files=${AN_DOC_FILES}
+
+module.po.expanded=0
+module.po.files=${AN_PO_FILES}
+
+compiler.options.supports=
+
+compiler.options.include.paths=${AN_INCLUDE_PATHS:-". .."}
+
+compiler.options.library.paths=${AN_LIBRARY_PATHS}
+
+compiler.options.libraries=${AN_LIBRARIES}
+
+compiler.options.libraries.selected=${AN_NUM_LIBRARIES:-"0"}
+
+compiler.options.defines=${AN_DEFINES:-"HAVE_CONFIG_H"}
+
+compiler.options.warning.buttons=0 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 
+
+compiler.options.optimize.buttons=0 0 1 0 
+
+compiler.options.other.buttons=1 0 
+
+compiler.options.other.c.flags=${AN_CFLAGS}
+
+compiler.options.other.l.flags=${AN_LDFLAGS}
+
+compiler.options.other.l.libs=${AN_LDADD}
+
+project.source.paths=${AN_SRC_PATHS}
+
diff --git a/scripts/build-schemas.mk b/scripts/build-schemas.mk
new file mode 100644
index 0000000..6fa5ed2
--- /dev/null
+++ b/scripts/build-schemas.mk
@@ -0,0 +1,42 @@
+# Targets for handing glade-to-GConf schema conversion for prefs keys
+
+prefs_glade_schemasdir = @GCONF_SCHEMA_FILE_DIR@
+prefs_glade_schemas = $(prefs_glade_files:.glade=.schemas)
+prefs_glade_schemas_DATA = $(prefs_glade_schemas)
+
+%.schemas: %.glade
+	$(top_srcdir)/scripts/glade2schema.pl $(srcdir)/$(?) > $(@)
+
+prefs_ui_schemasdir = @GCONF_SCHEMA_FILE_DIR@
+prefs_ui_schemas = $(prefs_ui_files:.ui=.schemas)
+prefs_ui_schemas_DATA = $(prefs_ui_schemas)
+
+%.schemas: %.ui
+	$(top_srcdir)/scripts/builder2schema.pl $(srcdir)/$(?) > $(@)
+
+if GCONF_SCHEMAS_INSTALL
+install-data-local: $(prefs_glade_schemas) $(prefs_ui_schemas)
+	        for p in $(prefs_glade_schemas) ; do \
+	            GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p ; \
+	        done 
+	        for p in $(prefs_ui_schemas) ; do \
+	            GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $$p ; \
+	        done
+		@killall -1 gconfd-2 || true
+
+uninstall-local: $(prefs_glade_schemas) $(prefs_ui_schemas)
+	        for p in $(prefs_glade_schemas) ; do \
+	            GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $$p ; \
+	        done
+	        for p in $(prefs_ui_schemas) ; do \
+	            GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $$p ; \
+	        done
+		@killall -1 gconfd-2 || true
+
+else
+install-data-local:
+
+uninstall-local:
+endif
+
+CLEANFILES = $(prefs_glade_schemas)
diff --git a/scripts/builder2schema.pl b/scripts/builder2schema.pl
new file mode 100755
index 0000000..f9f9dad
--- /dev/null
+++ b/scripts/builder2schema.pl
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+
+use XML::Parser;
+
+%datatypes = (
+	"bool" => "bool",
+	"int" => "int",
+	"string" => "string",
+	"text" => "string",
+	"float" => "float",
+	"color" => "string",
+	"font" => "string",
+	"folder" => "string",
+	"file" => "string"
+);
+
+%boolean = (
+	0 => "FALSE",
+	1 => "TRUE"
+);
+
+$schema_path = "/schemas/apps/anjuta/preferences/";
+$key_path ="/apps/anjuta/preferences/";
+
+my $parser = new XML::Parser(Style => "Stream");
+print "<gconfschemafile>\n";
+print "\t<schemalist>\n";
+
+$parser->parsefile($ARGV[0]);
+
+print "\t</schemalist>\n";
+print "</gconfschemafile>\n";
+
+sub StartTag {
+	my $parser = shift;
+	my $key = shift;
+	if ($key =~ /object/) {
+		my $k = $_{"id"};
+		if ($k =~ /(preferences_color|entry|font|spin|text|toggle|menu|folder|file):(.*):(.*):(\d):(.*)/) {	
+			
+			my $type = $2;
+			my $default = $3;
+			my $flags = $4;
+			my $propkey = $5;
+			
+			
+			if ($type =~ /bool/) {
+				$default = $boolean{$default};
+			}
+			
+			
+			
+			print "\t\t<schema>\n";
+			print "\t\t\t<key>$schema_path$propkey</key>\n";
+			print "\t\t\t<applyto>$key_path$propkey</applyto>\n";
+			print "\t\t\t<owner>anjuta</owner>\n";
+			print "\t\t\t<type>$datatypes{$type}</type>\n";
+			print "\t\t\t<default>$default</default>\n";
+			
+			# Hack to keep gconftool happy
+			print "\t\t\t<locale name=\"C\" />\n";
+			
+			print "\t\t</schema>\n\n";
+		}
+	}
+}
+
+sub EndTag {}
+
+sub Text {}
diff --git a/scripts/glade2schema.pl b/scripts/glade2schema.pl
new file mode 100755
index 0000000..16ce86e
--- /dev/null
+++ b/scripts/glade2schema.pl
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+
+use XML::Parser;
+
+%datatypes = (
+	"bool" => "bool",
+	"int" => "int",
+	"string" => "string",
+	"text" => "string",
+	"float" => "float",
+	"color" => "string",
+	"font" => "string",
+	"folder" => "string",
+	"file" => "string"
+);
+
+%boolean = (
+	0 => "FALSE",
+	1 => "TRUE"
+);
+
+$schema_path = "/schemas/apps/anjuta/preferences/";
+$key_path ="/apps/anjuta/preferences/";
+
+my $parser = new XML::Parser(Style => "Stream");
+print "<gconfschemafile>\n";
+print "\t<schemalist>\n";
+
+$parser->parsefile($ARGV[0]);
+
+print "\t</schemalist>\n";
+print "</gconfschemafile>\n";
+
+sub StartTag {
+	my $parser = shift;
+	my $key = shift;
+	if ($key =~ /widget/) {
+		my $k = $_{"id"};
+		if ($k =~ /(preferences_color|entry|font|spin|text|toggle|menu|folder|file):(.*):(.*):(\d):(.*)/) {	
+			
+			my $type = $2;
+			my $default = $3;
+			my $flags = $4;
+			my $propkey = $5;
+			
+			
+			if ($type =~ /bool/) {
+				$default = $boolean{$default};
+			}
+			
+			
+			
+			print "\t\t<schema>\n";
+			print "\t\t\t<key>$schema_path$propkey</key>\n";
+			print "\t\t\t<applyto>$key_path$propkey</applyto>\n";
+			print "\t\t\t<owner>anjuta</owner>\n";
+			print "\t\t\t<type>$datatypes{$type}</type>\n";
+			print "\t\t\t<default>$default</default>\n";
+			
+			# Hack to keep gconftool happy
+			print "\t\t\t<locale name=\"C\" />\n";
+			
+			print "\t\t</schema>\n\n";
+		}
+	}
+}
+
+sub EndTag {}
+
+sub Text {}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]