[Xfce4-commits] <xfce4-vala:xfce-dev> Add examples directory

Mike Massonnet mmassonnet at xfce.org
Tue Sep 8 12:00:03 CEST 2009


Updating branch refs/heads/xfce-dev
         to 5ec935acd01bd901cfdee951efeb05fb7a1d879e (commit)
       from a99b7404b2f0bd01caf2c0e2638dbf76d6a31611 (commit)

commit 5ec935acd01bd901cfdee951efeb05fb7a1d879e
Author: Mike Massonnet <mike at debian.(none)>
Date:   Tue Sep 8 11:45:00 2009 +0200

    Add examples directory
    
    Moved tests/panel-plugin into examples/.
    Created an initial example for a autotools build.

 Makefile.am                                     |    6 ++
 examples/autotools/Makefile.am                  |    3 +
 examples/autotools/configure.in.in              |   72 +++++++++++++++++++++++
 examples/autotools/src/Makefile.am              |   60 +++++++++++++++++++
 {tests => examples}/panel-plugin/button.desktop |    0
 {tests => examples}/panel-plugin/button.vala    |    0
 6 files changed, 141 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e96762d..785acd9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,8 +58,14 @@ EXTRA_DIST =								\
 	INSTALL								\
 	NEWS								\
 	README								\
+	examples							\
 	packages							\
 	vapi								\
+	tests/$(LIBXFCE4UTIL).vala					\
+	tests/$(LIBXFCE4MENU).vala					\
+	tests/$(XFCONF).vala						\
+	tests/$(LIBXFCEGUI4).vala					\
+	tests/$(EXO).vala						\
 	$(NULL)
 
 CLEANFILES =								\
diff --git a/examples/autotools/Makefile.am b/examples/autotools/Makefile.am
new file mode 100644
index 0000000..cfdc0da
--- /dev/null
+++ b/examples/autotools/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS =								\
+	src
+
diff --git a/examples/autotools/configure.in.in b/examples/autotools/configure.in.in
new file mode 100644
index 0000000..033ba5d
--- /dev/null
+++ b/examples/autotools/configure.in.in
@@ -0,0 +1,72 @@
+dnl
+dnl product - Product short description
+dnl
+dnl 2009 Jack Sparr <got at noinet.com>
+dnl
+
+m4_define([product_version_major], [0])
+m4_define([product_version_minor], [0])
+m4_define([product_version_micro], [0])
+m4_define([product_version_nano], [])
+m4_define([product_version_build], [@REVISION@])
+m4_define([product_version_tag], [git]) # Leave empty for releases
+m4_define([product_version], [product_version_major().product_version_minor().product_version_micro()ifelse(product_version_nano(), [], [], [.product_version_nano()])ifelse(product_version_tag(), [git], [product_version_tag()-product_version_build()], [product_version_tag()])])
+
+AC_PREREQ([2.50])
+AC_INIT([Product], [product_version], [http://bugzilla.noinet.com/], [product],
+	[http://noinet.com/])
+AC_REVISION([product_version_build])
+AC_CANONICAL_TARGET()
+
+AM_INIT_AUTOMAKE([1.11 dist-bzip2])
+AM_CONFIG_HEADER([config.h])
+AM_MAINTAINER_MODE()
+
+dnl Check for basic programs
+AC_PROG_CC_C_O()
+AC_PROG_LD()
+AC_PROG_LIBTOOL()
+AC_PROG_INSTALL()
+AC_PROG_INTLTOOL()
+
+dnl Check for standard header files
+AC_HEADER_STDC()
+
+dnl Check for required packages
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
+
+dnl Check for valac
+if test "x$USE_MAINTAINER_MODE" = "xyes" ; then
+	AM_PROG_VALAC([0.7.1])
+	if test "x$VALAC" = "x" ; then
+		AC_MSG_WARN([Cannot find the "valac" compiler in your PATH])
+	fi
+	XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [0.1]) # 4.6
+fi
+
+dnl Translations
+XDT_I18N([@LINGUAS@])
+
+dnl Check for debugging support
+XDT_FEATURE_DEBUG()
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+])
+
+dnl ***************************
+dnl *** Print configuration ***
+dnl ***************************
+echo
+echo "Build Configuration:"
+echo
+echo "* Maintainer Mode:        $USE_MAINTAINER_MODE"
+if test "x$USE_MAINTAINER_MODE" = "xyes" ; then
+echo
+echo "    * Vala:               $VALAC"
+echo
+fi
+echo "* Debug Support:          $enable_debug"
+echo
+
diff --git a/examples/autotools/src/Makefile.am b/examples/autotools/src/Makefile.am
new file mode 100644
index 0000000..1a942e7
--- /dev/null
+++ b/examples/autotools/src/Makefile.am
@@ -0,0 +1,60 @@
+INCLUDES =								\
+	-I$(top_srcdir)							\
+	-DGETTEXT_PACKAGE=\""$(GETTEXT_PACKAGE)"\"			\
+	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\"
+
+#
+# Vala sources
+#
+
+product_VAPISOURCES =							\
+	config.vapi
+
+product_VALASOURCES =							\
+	obj1.vala							\
+	obj2.vala							\
+	main.vala
+
+product_VALABUILTSOURCES = $(product_VALASOURCES:.vala=.c)
+
+if MAINTAINER_MODE
+PACKAGES = --pkg=gtk+-2.0
+BUILT_SOURCES = vala.stamp
+vala.stamp: $(product_VALASOURCES)
+	$(VALAC) --vapidir=$(srcdir) --pkg=config $(PACKAGES) $^ -C -H product.h
+	touch $@
+endif
+
+#
+# Product
+#
+
+bin_PROGRAMS = product
+
+product_SOURCES =							\
+	source1.c							\
+	source1.h							\
+	source2.c							\
+	source2.h							\
+	$(product_VALABUILTSOURCES)
+
+product_CFLAGS =							\
+	@GTK_CFLAGS@
+
+product_LDADD =								\
+	@GTK_LIBS@
+
+#
+# Extra
+#
+
+EXTRA_DIST =								\
+	$(product_VAPISOURCES)						\
+	$(product_VALASOURCES)
+
+if MAINTAINER_MODE
+CLEANFILES =								\
+	$(BUILT_SOURCES)						\
+	$(product_VALABUILTSOURCES)
+endif
+
diff --git a/tests/panel-plugin/button.desktop b/examples/panel-plugin/button.desktop
similarity index 100%
rename from tests/panel-plugin/button.desktop
rename to examples/panel-plugin/button.desktop
diff --git a/tests/panel-plugin/button.vala b/examples/panel-plugin/button.vala
similarity index 100%
rename from tests/panel-plugin/button.vala
rename to examples/panel-plugin/button.vala



More information about the Xfce4-commits mailing list