[Xfce4-commits] [panel-plugins/xfce4-generic-slider] 01/01: Revamp of the build system

noreply at xfce.org noreply at xfce.org
Sat Dec 23 23:29:59 CET 2017


This is an automated email from the git hooks/post-receive script.

s   k   u   n   n   y   k       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-generic-slider.

commit 51e1b50587127e9daa01cd3a1529d53ce243a6f3
Author: Romain B <skunnyk at alteroot.org>
Date:   Sat Dec 23 23:15:20 2017 +0100

    Revamp of the build system
    
    - Use standard xfce-dev-tools
    - Use autotools
    - At least now the plugin can be built on all platforms without hacks.
    - Build as a lib and not as an external plugin !
    - Also fix implicit declaration of function ‘xfce_titled_dialog_new_with_buttons’
    - The plugin can be translated (even if there is nothing to translate yet)
    - There is still bugs of course.
---
 .gitignore                                        |  29 ++++++
 AUTHORS                                           |   0
 ChangeLog                                         |   4 -
 INSTALL                                           |  14 ---
 Makefile                                          |  32 -------
 Makefile.am                                       |  39 ++++++++
 NEWS                                              |   0
 README                                            |   0
 autogen.sh                                        |  35 +++++++
 configure.ac.in                                   | 108 ++++++++++++++++++++++
 generic-slider.desktop                            |   7 --
 panel-plugin/Makefile.am                          |  53 +++++++++++
 generic-slider.c => panel-plugin/generic-slider.c |   3 +-
 panel-plugin/generic-slider.desktop.in            |  10 ++
 po/POTFILES.in                                    |   2 +
 15 files changed, 278 insertions(+), 58 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..27bdee9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,29 @@
+*.gmo
+*.la
+*.lo
+*.swp
+*.tar.*
+.deps
+.libs
+ChangeLog
+INSTALL
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+compile
+config*
+depcomp
+install-sh
+intltool*
+libtool
+ltmain.sh
+missing
+mkinstalldirs
+panel-plugin/*.desktop
+panel-plugin/*.desktop.in
+po/.intltool-merge-cache
+po/Makefile.in.in
+po/POTFILES
+stamp-*
+m4
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..e69de29
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index 5339561..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-Date: 2009-08-11
-Source: xfce4-generic-slider-plugin-0.1
-Initial release.
-Connor Behan <connor.behan at users.sf.net>
\ No newline at end of file
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index e579a1f..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,14 +0,0 @@
-Prerequisites
-=============
-
-  Xfce-generic-slider-plugin requires the Xfce panel and probably nothing else.
-
-Simple install procedure
-========================
-
-  To compile xfce-generic-slider-plugin, you should read over the Makefile to be sure it's correct for your system.
-  Specifically change PREFIX if you want it installed in /usr/local instead of /usr. Then make sure the plugin binary
-  and its desktop file are going to the right place. If you installed your other Xfce plugins with a package manager
-  use the package manager to query the file lists for them to find out where plugins and plugin desktop files should
-  go. If you compiled your other Xfce plugins from source, I certainly hope you already know. Once that's done, run
-  make, then run make install as root.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 1d832c2..0000000
--- a/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-CC = gcc
-MAKE = make
-INSTALL = install
-SED = sed
-RM = rm
-CD = cd
-PKG_CONFIG = pkg-config
-DESTDIR =
-
-PREFIX = /usr
-PLUGINDIR = $(PREFIX)/lib/xfce4/panel-plugins
-PLUGINDESKTOPDIR = $(PREFIX)/share/xfce4/panel-plugins
-
-LIBXFCE4PANEL_CFLAGS = `$(PKG_CONFIG) --cflags libxfce4panel-1.0 libxfce4ui-1 libxfce4util-1.0`
-LIBXFCE4PANEL_LIBS = `$(PKG_CONFIG) --libs libxfce4panel-1.0 libxfce4ui-1 libxfce4util-1.0`
-
-all: generic-slider.c
-	$(CC) $(CFLAGS) $(LIBXFCE4PANEL_CFLAGS) -c generic-slider.c
-	$(CC) $(CFLAGS) -o xfce4-generic-slider-plugin generic-slider.o $(LIBXFCE4PANEL_LIBS)
-
-clean:
-	$(RM) -f *.o
-	$(RM) -f xfce4-generic-slider-plugin
-
-install:
-	$(SED) -i -e "s|@PLUGINDIR@|$(PLUGINDIR)|g" generic-slider.desktop
-	$(INSTALL) -Dm644 generic-slider.desktop $(DESTDIR)$(PLUGINDESKTOPDIR)/generic-slider.desktop
-	$(INSTALL) -Dm755 xfce4-generic-slider-plugin $(DESTDIR)$(PLUGINDIR)/xfce4-generic-slider-plugin
-
-uninstall:
-	$(RM) -f $(DESTDIR)$(PLUGINDESKTOPDIR)/generic-slider.desktop
-	$(RM) -f $(DESTDIR)$(PLUGINDIR)/xfce4-generic-slider-plugin
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..7b1be01
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,39 @@
+ at SET_MAKE@
+
+AUTOMAKE_OPTIONS = subdir-objects
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+
+SUBDIRS =	\
+	panel-plugin \
+	po
+
+distclean-local:
+	rm -rf *.cache *~
+
+distuninstallcheck_listfiles =                                          \
+        find . -type f -print | grep -v ./share/icons/hicolor/icon-theme.cache
+
+rpm: dist
+	rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz
+	@rm -f $(PACKAGE)-$(VERSION).tar.gz
+
+.PHONY: ChangeLog
+
+ChangeLog: Makefile
+	(GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp \
+	&& mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) \
+	|| (touch ChangeLog; echo 'Git directory not found: installing possibly empty changelog.' >&2)
+
+dist-hook: ChangeLog
+
+EXTRA_DIST = \
+	intltool-extract.in \
+	intltool-merge.in \
+	intltool-update.in
+
+DISTCLEANFILES = \
+	intltool-extract \
+	intltool-merge \
+	intltool-update
+
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..a600069
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Copyright (c) 2002-2017 The Xfce development team. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Written for Xfce by Benedikt Meurer <benny at xfce.org>.
+#
+
+(type xdt-autogen) >/dev/null 2>&1 || {
+  cat >&2 <<EOF
+autogen.sh: You don't seem to have the Xfce development tools installed on
+            your system, which are required to build this software.
+            Please install the xfce4-dev-tools package first, it is available
+            from https://www.xfce.org/.
+EOF
+  exit 1
+}
+
+test -d m4 || mkdir m4
+
+XDT_AUTOGEN_REQUIRED_VERSION="4.9.1" \
+exec xdt-autogen $@
diff --git a/configure.ac.in b/configure.ac.in
new file mode 100644
index 0000000..8eecaec
--- /dev/null
+++ b/configure.ac.in
@@ -0,0 +1,108 @@
+dnl $Id$
+dnl
+dnl xfce4-generic-slider - A sample plugin for the Xfce panel
+dnl
+dnl 2017 John Doo <john at foo.org>
+dnl
+
+dnl ***************************
+dnl *** Version information ***
+dnl ***************************
+m4_define([sample_version_major], [0])
+m4_define([sample_version_minor], [0])
+m4_define([sample_version_micro], [1])
+m4_define([sample_version_nano],  []) dnl leave this empty to have no nano version
+m4_define([sample_version_build], [@REVISION@])
+m4_define([sample_version_tag], [])
+m4_define([sample_version], [sample_version_major().sample_version_minor().sample_version_micro()ifelse(sample_version_nano(), [], [], [.sample_version_nano()])ifelse(sample_version_tag(), [git], [sample_version_tag()-sample_version_build()], [sample_version_tag()])])
+
+AC_CONFIG_MACRO_DIR([m4])
+dnl ***************************
+dnl *** Initialize autoconf ***
+dnl ***************************
+AC_COPYRIGHT([Copyright (C) 2017
+        The Xfce development team. All rights reserved.])
+AC_INIT([xfce4-generic-slider], [sample_version], [https://bugzilla.xfce.org/], [xfce4-generic-slider])
+AC_PREREQ([2.50])
+AC_REVISION([xfce4_panel_version_build])
+
+dnl ***************************
+dnl *** Initialize automake ***
+dnl ***************************
+AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-bzip2 tar-ustar])
+AC_CONFIG_HEADER([config.h])
+AM_MAINTAINER_MODE()
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+dnl **************************
+dnl *** Initialize libtool ***
+dnl **************************
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
+
+dnl ********************************
+dnl *** Check for basic programs ***
+dnl ********************************
+AC_PROG_CC()
+AC_PROG_CC_C_O()
+AC_PROG_LD()
+AC_PROG_INSTALL()
+IT_PROG_INTLTOOL([0.35.0])
+
+dnl **********************************
+dnl *** Check for standard headers ***
+dnl **********************************
+AC_HEADER_STDC()
+AC_CHECK_HEADERS([stdlib.h unistd.h locale.h stdio.h errno.h time.h string.h \
+                  math.h sys/types.h sys/wait.h memory.h signal.h sys/prctl.h \
+                  libintl.h])
+AC_CHECK_FUNCS([bind_textdomain_codeset])
+
+dnl ******************************
+dnl *** Check for i18n support ***
+dnl ******************************
+XDT_I18N([@LINGUAS@])
+
+dnl *******************************
+dnl *** Check for X11 installed ***
+dnl *******************************
+XDT_CHECK_LIBX11_REQUIRE()
+
+dnl ***********************************
+dnl *** Check for required packages ***
+dnl ***********************************
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.12.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.12.0])
+
+dnl ***********************************
+dnl *** Check for debugging support ***
+dnl ***********************************
+XDT_FEATURE_DEBUG()
+
+dnl *********************************
+dnl *** Substitute platform flags ***
+dnl *********************************
+AC_MSG_CHECKING([PLATFORM_CPPFLAGS])
+AC_MSG_RESULT([$PLATFORM_CPPFLAGS])
+AC_SUBST([PLATFORM_CPPFLAGS])
+AC_MSG_CHECKING([PLATFORM_CFLAGS])
+AC_MSG_RESULT([$PLATFORM_CFLAGS])
+AC_SUBST([PLATFORM_CFLAGS])
+AC_MSG_CHECKING([PLATFORM_LDFLAGS])
+AC_MSG_RESULT([$PLATFORM_LDFLAGS])
+AC_SUBST([PLATFORM_LDFLAGS])
+
+AC_OUTPUT([
+Makefile
+panel-plugin/Makefile
+po/Makefile.in
+])
+
+dnl ***************************
+dnl *** Print configuration ***
+dnl ***************************
+echo
+echo "Build Configuration:"
+echo
+echo "* Debug Support:    $enable_debug"
+echo
diff --git a/generic-slider.desktop b/generic-slider.desktop
deleted file mode 100644
index 593522e..0000000
--- a/generic-slider.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Xfce Panel]
-Type=X-XFCE-PanelPlugin
-Encoding=UTF-8
-Name=Generic Slider
-Comment=Passes a value to a command
-Icon=gtk-remove
-X-XFCE-Exec=@PLUGINDIR@/xfce4-generic-slider-plugin
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
new file mode 100644
index 0000000..476b48a
--- /dev/null
+++ b/panel-plugin/Makefile.am
@@ -0,0 +1,53 @@
+AM_CPPFLAGS = \
+	-I$(top_srcdir) \
+	-DG_LOG_DOMAIN=\"xfce4-generic-slider\" \
+	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
+	$(PLATFORM_CPPFLAGS)
+
+#
+# Sample plugin
+#
+plugin_LTLIBRARIES = \
+	libgeneric-slider.la
+
+plugindir = \
+	$(libdir)/xfce4/panel/plugins
+
+libgeneric_slider_la_SOURCES = \
+	generic-slider.c
+
+libgeneric_slider_la_CFLAGS = \
+	$(LIBXFCE4UTIL_CFLAGS) \
+	$(LIBXFCE4UI_CFLAGS) \
+	$(LIBXFCE4PANEL_CFLAGS) \
+	$(PLATFORM_CFLAGS)
+
+libgeneric_slider_la_LDFLAGS = \
+       -avoid-version \
+       -module \
+       -no-undefined \
+       -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+       $(PLATFORM_LDFLAGS)
+
+libgeneric_slider_la_LIBADD = \
+	$(LIBXFCE4UTIL_LIBS) \
+	$(LIBXFCE4UI_LIBS) \
+        $(LIBXFCE4PANEL_LIBS)
+
+#
+# Desktop file
+#
+desktopdir =								\
+	$(datadir)/xfce4/panel/plugins
+
+desktop_in_files = generic-slider.desktop.in
+
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+
+ at INTLTOOL_DESKTOP_RULE@
+
+EXTRA_DIST = $(desktop_in_files)
+
+DISTCLEANFILES = $(desktop_DATA)
+
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/generic-slider.c b/panel-plugin/generic-slider.c
similarity index 99%
rename from generic-slider.c
rename to panel-plugin/generic-slider.c
index 2d2ab6c..cbb3a91 100644
--- a/generic-slider.c
+++ b/panel-plugin/generic-slider.c
@@ -5,6 +5,7 @@
 #include <unistd.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 #include <libxfce4util/libxfce4util.h>
+#include <libxfce4ui/libxfce4ui.h>
 #define TIMEOUT 1000
 #define WIDTH 8
 
@@ -850,4 +851,4 @@ static void generic_slider_construct(XfcePanelPlugin *plugin) {
 	}
 }
 
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(generic_slider_construct);
+XFCE_PANEL_PLUGIN_REGISTER(generic_slider_construct);
diff --git a/panel-plugin/generic-slider.desktop.in b/panel-plugin/generic-slider.desktop.in
new file mode 100644
index 0000000..3395624
--- /dev/null
+++ b/panel-plugin/generic-slider.desktop.in
@@ -0,0 +1,10 @@
+[Xfce Panel]
+Type=X-XFCE-PanelPlugin
+Encoding=UTF-8
+_Name=Generic Slider
+_Comment=Passes a value to a command
+Icon=gtk-remove
+X-XFCE-Module=generic-slider
+X-XFCE-Internal=false
+X-XFCE-Unique=false
+X-XFCE-API=1.0
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..f637b0b
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,2 @@
+panel-plugin/generic-slider.desktop.in
+panel-plugin/generic-slider.c

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list