[Xfce4-commits] <gigolo:master> Drop Waf build system support and just use autotools

Enrico Tröger noreply at xfce.org
Fri Nov 2 17:06:01 CET 2012


Updating branch refs/heads/master
         to ee529bd9394ddb0d210c7477e9ed794eb825ab7f (commit)
       from c80f3c0d55d7cec4c591ce8c98f05f19c8c3c48c (commit)

commit ee529bd9394ddb0d210c7477e9ed794eb825ab7f
Author: Enrico Tröger <enrico at xfce.org>
Date:   Fri Nov 2 17:01:28 2012 +0100

    Drop Waf build system support and just use autotools
    
    Let's call this 'happy distro packagers day'...

 README    |   24 ++-----
 configure |  103 --------------------------
 waf       |  Bin 76329 -> 0 bytes
 wscript   |  237 -------------------------------------------------------------
 4 files changed, 5 insertions(+), 359 deletions(-)

diff --git a/README b/README
index 3fc03a4..9947523 100644
--- a/README
+++ b/README
@@ -22,7 +22,6 @@ For compiling Gigolo, you will need the GTK (>= 2.12.0) libraries
 and header files. You will also need its dependency libraries and header
 files, such as Pango, Cairo, Glib and ATK. All these files are available at
 http://www.gtk.org.
-You also need Python for the included Waf build system.
 
 Furthermore you need, of course, a C compiler as well as the intltool package.
 
@@ -34,27 +33,16 @@ building the code is easy:
 
 Run the following commands::
 
-    $ ./waf configure
-    $ ./waf build
+    $ ./configure
+    $ make
     (maybe as root)
-    % ./waf install
+    % make install
 
-To get a list of available options to customize your build, enable debugging
-or to use a different installation prefix, run::
-
-    $ ./waf help
-
-
-Alternative installation using autotools
-````````````````````````````````````````
-
-You can use the usual autotools chain to configure, compile and install
-the sources by running::
+If there is no configure script, you probably need to run::
 
     $ ./autogen.sh
 
-in the source directory.
-This is mainly intended for distro packagers and people with special needs.
+in the source directory before
 
 
 Usage
@@ -83,8 +71,6 @@ Gigolo is distributed under the terms of the GNU General Public License
 as published by the Free Software Foundation; version 2 of the license.
 A copy of this license can be found in the file COPYING included with
 the source code of this program.
-The included Waf build system ("waf") is licensed under the
-New BSD License (http://www.opensource.org/licenses/bsd-license.php).
 
 
 Ideas, questions, patches and bug reports
diff --git a/configure b/configure
deleted file mode 100755
index 929335c..0000000
--- a/configure
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/sh
-
-# waf configure wrapper
-
-EXIT_FAILURE=1
-
-
-# Checks for Python interpreter. Honours $PYTHON if set. Stores path to
-# interpreter in $PYTHON.
-checkPython()
-{
-	if [ -z "$PYTHON" ] ; then
-		PYTHON="python"
-	fi
-	printf "Checking for Python\t\t\t : "
-	("$PYTHON" --version) < /dev/null > /dev/null 2>&1 || {
-		printf "not found!\n"
-		echo "Please make sure that the Python interpreter is available in your PATH"
-		echo "or invoke configure using the PYTHON flag, e.g."
-		echo "$ PYTHON=/usr/local/bin/python ./waf configure "$@
-		echo "Alternatively, you can run ./autogen.sh to use the autotools chain"
-		echo "to build and install the sources."
-		exit $EXIT_FAILURE
-	}
-	printf "ok\n"
-}
-
-# Generates a Makefile.
-generateMakefile()
-{
-	cat > Makefile << EOF
-#!/usr/bin/make -f
-# Waf Makefile wrapper
-
-all:
-	@./waf build
-
-all-debug:
-	@./waf -v build
-
-all-progress:
-	@./waf -p build
-
-install:
-	@if test -n "\$(DESTDIR)"; then \\
-		./waf install --destdir="\$(DESTDIR)"; \\
-	else \\
-		./waf install; \\
-	fi;
-
-uninstall:
-	@if test -n "\$(DESTDIR)"; then \\
-		./waf uninstall --destdir="\$(DESTDIR)"; \\
-	else \\
-		./waf uninstall; \\
-	fi;
-
-clean:
-	@./waf clean
-
-distclean:
-	@./waf distclean
-	@-rm -rf _build_
-	@-rm -f Makefile
-
-distcheck:
-	@./waf distcheck
-
-check:
-	@./waf check
-
-dist:
-	@./waf dist
-
-sign:
-	@./waf --sign
-
-.PHONY: clean dist distclean check uninstall install all
-
-EOF
-
-	cat > src/Makefile << EOF
-#!/usr/bin/make -f
-# Waf Makefile wrapper
-
-all:
-	cd .. && ./waf build
-
-all-debug:
-	cd .. && ./waf -v build
-
-clean:
-	cd .. && ./waf clean
-
-EOF
-}
-
-checkPython $@
-generateMakefile
-
-./waf configure $@
-
-exit $?
diff --git a/waf b/waf
deleted file mode 100755
index 95ffdf3..0000000
Binary files a/waf and /dev/null differ
diff --git a/wscript b/wscript
deleted file mode 100644
index b7fa147..0000000
--- a/wscript
+++ /dev/null
@@ -1,237 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# WAF build script
-#
-# Copyright 2008-2011 Enrico Tröger <enrico(at)xfce(dot)org>
-#
-# This program 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; version 2 of the License.
-#
-# This program 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 General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-
-import os
-from waflib import Logs, Options, Scripting
-from waflib.TaskGen import feature
-
-
-APPNAME = 'gigolo'
-VERSION = '0.4.1'
-LINGUAS_FILE = 'po/LINGUAS'
-
-top = '.'
-out = '_build_'
-
-
-sources = ['src/compat.c', 'src/window.c', 'src/bookmark.c', 'src/settings.c',
-           'src/menubuttonaction.c', 'src/mountoperation.c', 'src/bookmarkdialog.c',
-           'src/bookmarkeditdialog.c', 'src/preferencesdialog.c', 'src/backendgvfs.c',
-           'src/common.c', 'src/mountdialog.c', 'src/browsenetworkpanel.c',
-           'src/singleinstance.c', 'src/bookmarkpanel.c']
-
-
-
-def configure(conf):
-    conf.load('compiler_c intltool gnu_dirs waf_unit_test')
-
-    conf.check_cfg(package='gtk+-2.0', atleast_version='2.12.0', uselib_store='GTK',
-        mandatory=True, args='--cflags --libs')
-    conf.check_cfg(package='gio-2.0', atleast_version='2.16.0', uselib_store='GIO',
-        mandatory=True, args='--cflags --libs')
-    conf.check_cfg(package='x11', uselib_store='X11', mandatory=True, args='--libs')
-
-    gtk_version = conf.check_cfg(modversion='gtk+-2.0', uselib_store='GTK')
-    gio_version = conf.check_cfg(modversion='gio-2.0', uselib_store='GIO')
-
-    conf.define('GETTEXT_PACKAGE', APPNAME, 1)
-    conf.define('PACKAGE', APPNAME, 1)
-    conf.define('VERSION', VERSION, 1)
-
-    conf.write_config_header('config.h', remove=False)
-
-    if 'LINGUAS' in os.environ:
-        conf.env['LINGUAS'] = os.environ['LINGUAS']
-
-    # debug flags
-    if conf.options.debug:
-        conf.env.append_value('CCFLAGS', '-g -O0 -DDEBUG '.split())
-
-    Logs.pprint('BLUE', 'Summary:')
-    conf.msg('Install Gigolo ' + VERSION + ' in', conf.env['PREFIX'])
-    conf.msg('Using GTK version', gtk_version or 'Unknown')
-    conf.msg('Using GIO version', gio_version or 'Unknown')
-    conf.msg('Compiling with debugging support', conf.options.debug and 'yes' or 'no')
-
-
-def options(opt):
-    opt.load('compiler_cc intltool gnu_dirs waf_unit_test')
-
-    opt.add_option('--enable-debug', action='store_true', default=False,
-        help='enable debug mode [default: No]', dest='debug')
-
-
-def _remove_linguas_file():
-    try:
-        os.unlink(LINGUAS_FILE)
-    except OSError:
-        pass
-
-
- at feature('linguas')
-def write_linguas_file(self):
-    if os.path.exists(LINGUAS_FILE):
-        return
-    linguas = ''
-    if 'LINGUAS' in self.env:
-        files = self.env['LINGUAS']
-        for po_filename in files.split(' '):
-            if os.path.exists ('po/%s.po' % po_filename):
-                linguas += '%s ' % po_filename
-    else:
-        files = os.listdir('%s/po' % self.path.abspath())
-        files.sort()
-        for filename in files:
-            if filename.endswith('.po'):
-                linguas += '%s ' % filename[:-3]
-    file_h = open(LINGUAS_FILE, 'w')
-    file_h.write('# This file is autogenerated. Do not edit.\n%s\n' % linguas)
-    file_h.close()
-
-
-def distclean(ctx):
-    Scripting.distclean(ctx)
-    _remove_linguas_file()
-
-
-def build(bld):
-    if bld.cmd == 'clean':
-        _remove_linguas_file()
-
-    bld.new_task_gen(
-        features        = 'c cstlib',
-        name            = 'gigolo_lib',
-        target          = 'gigolo_lib',
-        source          = sources,
-        includes        = '.',
-        uselib          = ['GTK', 'GIO'],
-        install_path    = None)
-
-    bld.new_task_gen(
-        features        = 'c cprogram',
-        name            = 'gigolo',
-        target          = 'gigolo',
-        source          = 'src/main.c',
-        includes        = '.',
-        use             = ['GTK', 'GIO', 'X11', 'gigolo_lib'])
-
-    # tests
-    bld(
-        features        = 'c cprogram test',
-        source          = 'tests/uri_parsing.c',
-        target          = 'test-uri-parsing',
-        includes        = ['.', 'src'],
-        use             = ['GTK', 'GIO', 'X11', 'gigolo_lib'],
-        install_path    = None)
-    bld.add_post_fun(_unit_test_summary)
-
-    # Translations
-    bld.new_task_gen(
-        features        = ['linguas', 'intltool_po'],
-        podir           = 'po',
-        install_path    = '${LOCALEDIR}',
-        appname         = 'gigolo')
-
-    # gigolo.desktop
-    bld.new_task_gen(
-        features        = 'intltool_in',
-        source          = 'gigolo.desktop.in',
-        flags           = ['-d', '-q', '-u', '-c'],
-        install_path    = '${DATADIR}/applications',
-        after           = 'intltool_po')
-
-    # gigolo.1
-    bld.new_task_gen(
-        features        = 'subst',
-        source          = 'gigolo.1.in',
-        target          = 'gigolo.1',
-        dct            = {'VERSION' : VERSION},
-        install_path    = '${MANDIR}/man1')
-
-    # Docs
-    bld.install_files('${DOCDIR}', 'AUTHORS ChangeLog COPYING README NEWS TODO')
-
-
-def _unit_test_summary(ctx):
-    lst = getattr(ctx, 'utest_results', [])
-    if lst:
-        Logs.pprint('CYAN', 'Execution summary:')
-
-        total = len(lst)
-        tfail = len([x for x in lst if x[1]])
-
-        Logs.pprint('CYAN', '  Passed tests: %d/%d' % (total-tfail, total))
-        for (filename, code, stdout, stderr) in lst:
-            if not code:
-                Logs.pprint('CYAN', '    %s' % filename)
-
-        Logs.pprint('CYAN', '  Failed tests: %d/%d' % (tfail, total))
-        for (filename, code, stdout, stderr) in lst:
-            if code:
-                Logs.pprint('CYAN', '%s:' % filename)
-                Logs.pprint('RED', '%s' % stdout)
-
-
-def updatepo(ctx):
-    """update the message catalogs for internationalization"""
-    potfile = '%s.pot' % APPNAME
-    os.chdir('%s/po' % top)
-    try:
-        try:
-            old_size = os.stat(potfile).st_size
-        except OSError:
-            old_size = 0
-        ctx.exec_command('intltool-update --pot -g %s' % APPNAME)
-        size_new = os.stat(potfile).st_size
-        if size_new != old_size:
-            Logs.pprint('CYAN', 'Updated POT file.')
-            Logs.pprint('CYAN', 'Updating translations')
-            ret = ctx.exec_command('intltool-update -r -g %s' % APPNAME)
-            if ret != 0:
-                Logs.pprint('RED', 'Updating translations failed')
-        else:
-            Logs.pprint('CYAN', 'POT file is up to date.')
-    except OSError:
-        Logs.pprint('RED', 'Failed to generate pot file.')
-
-
-def dist(ctx):
-    ctx.base_path = ctx.path
-    ctx.excl = ctx.get_excl() + 'gigolo-%s.tar.bz2.sig module.xml RUN .gitignore .intlcache' % VERSION
-
-
-def sign(ctx):
-    """sign the source tarball for distribution"""
-    from hashlib import md5
-    filename = '%s-%s.tar.bz2' % (APPNAME, VERSION)
-    md5_hash = md5()
-    read_bytes = 100000
-    archive_file = file(filename,'rb')
-    while read_bytes:
-        read_string = archive_file.read(read_bytes)
-        md5_hash.update(read_string)
-        read_bytes = len(read_string)
-    archive_file.close()
-
-    ctx.cmd_and_log('gpg --detach-sign --digest-algo SHA512 %s' % filename)
-    Logs.pprint('GREEN', 'MD5 sum: %s %s' % (filename, md5_hash.hexdigest()))
-


More information about the Xfce4-commits mailing list