SF.net SVN: geany: [2646] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Thu Jun 5 14:06:06 UTC 2008


Revision: 2646
          http://geany.svn.sourceforge.net/geany/?rev=2646&view=rev
Author:   eht16
Date:     2008-06-05 07:05:55 -0700 (Thu, 05 Jun 2008)

Log Message:
-----------
Add alternative build system: Waf.
Use wafinit.sh to create a Makefile and configure files.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/Makefile.am

Added Paths:
-----------
    trunk/scripts/wafinit.sh
    trunk/waf
    trunk/wscript

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-06-05 12:43:10 UTC (rev 2645)
+++ trunk/ChangeLog	2008-06-05 14:05:55 UTC (rev 2646)
@@ -1,3 +1,10 @@
+2008-06-05  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * Makefile.am, waf, wscript, scripts/wafinit.sh:
+   Add alternative build system: Waf.
+   Use wafinit.sh to create a Makefile and configure files.
+
+
 2008-06-05  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/document.c:

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2008-06-05 12:43:10 UTC (rev 2645)
+++ trunk/Makefile.am	2008-06-05 14:05:55 UTC (rev 2646)
@@ -22,6 +22,7 @@
 
 EXTRA_DIST = \
 	autogen.sh \
+	wscript \
 	geany.desktop.in \
 	geany.pc.in \
 	geany.spec \

Added: trunk/scripts/wafinit.sh
===================================================================
--- trunk/scripts/wafinit.sh	                        (rev 0)
+++ trunk/scripts/wafinit.sh	2008-06-05 14:05:55 UTC (rev 2646)
@@ -0,0 +1,53 @@
+#! /bin/sh
+#
+# This script creates a "configure" script and a Makefile to imitate autotools
+# but Waf is actually used to build
+
+WAF=`which waf`
+if [ "x$WAF" = "x" ]
+then
+    WAF="./waf"
+fi
+
+
+cat > Makefile << EOF
+
+.PHONY: build configure
+
+all: build
+
+build:
+	@$WAF build \$@
+
+install:
+	@$WAF install \$@
+
+uninstall:
+	@$WAF uninstall
+
+clean:
+	@$WAF clean
+
+distclean:
+	@$WAF distclean
+	@-rm -f Makefile
+
+htmldoc:
+	@$WAF --htmldoc
+
+apidoc:
+	@$WAF --apidoc
+
+configure:
+	@$WAF configure \$@
+
+EOF
+
+cat > configure << EOF
+#!/bin/sh
+
+$WAF configure \$@
+
+EOF
+
+chmod 755 configure


Property changes on: trunk/scripts/wafinit.sh
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: trunk/waf
===================================================================
--- trunk/waf	                        (rev 0)
+++ trunk/waf	2008-06-05 14:05:55 UTC (rev 2646)
@@ -0,0 +1,145 @@
+#! /usr/bin/env python
+# encoding: utf-8
+# Thomas Nagy, 2005-2008
+
+"""
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+"""
+
+import os, sys
+if sys.hexversion<0x203000f: raise "Waf requires Python >= 2.3"
+
+if 'PSYCOWAF' in os.environ:
+	try:import psyco;psyco.full()
+	except:pass
+
+VERSION="1.4.2"
+REVISION="fd1f2e9d93f8e1634be8fb448b10b939"
+INSTALL=sys.platform=='win32' and 'c:/temp' or '/usr/local'
+cwd = os.getcwd()
+join = os.path.join
+
+def decode(s):
+	p1 = len(s)
+	s += '!!!!!'
+	w1 = [256**(3-u) for u in xrange(4)]
+	w2 = [(u, 85**(4-u)) for u in xrange(5)]
+	tot = [sum([(ord(s[i+m])-33) * n for (m, n) in w2]) for i in xrange(0, p1, 5)]
+	return ''.join([chr((y/x) & 255) for y in tot for x in w1])
+
+def err(m):
+	print '\033[91mError: %s\033[0m' % m
+	sys.exit(1)
+
+def unpack_wafdir(dir):
+	f = open(sys.argv[0],'rb')
+	c = "corrupted waf (%d)"
+	while 1:
+		line = f.readline()
+		if not line: err("run waf-light from a folder containing wafadmin")
+		if line == '#==>\n':
+			txt = f.readline()
+			if not txt: err(c % 1)
+			if f.readline()!='#<==\n': err(c % 2)
+			break
+	if not txt: err(c % 3)
+	try: txt = decode(txt[1:-1].replace('z', '!!!!!'))
+	except: err(c % 4)
+
+	import shutil, tarfile
+	try: shutil.rmtree(dir)
+	except OSError: pass
+	try: os.makedirs(join(dir, 'wafadmin', 'Tools'))
+	except OSError: err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
+
+	os.chdir(dir)
+	tmp = 't.tbz2'
+	t = open(tmp,'wb')
+	t.write(txt)
+	t.close()
+
+	t = tarfile.open(tmp)
+	for x in t: t.extract(x)
+	t.close()
+
+	os.chmod(join('wafadmin','Tools'), 0755)
+
+	os.unlink(tmp)
+	os.chdir(cwd)
+
+def test(dir):
+	try: os.stat(join(dir, 'wafadmin')); return os.path.abspath(dir)
+	except OSError: pass
+
+def find_lib():
+	name = sys.argv[0]
+	base = os.path.dirname(os.path.abspath(name))
+
+	#devs use $WAFDIR
+	w=test(os.environ.get('WAFDIR', ''))
+	if w: return w
+
+	#waf-light
+	if name.endswith('waf-light'):
+		w = test(base)
+		if w: return w
+		err("waf-light requires wafadmin -> export WAFDIR=/folder")
+
+	dir = "/lib/waf-%s-%s/" % (VERSION, REVISION)
+	for i in [INSTALL,'/usr','/usr/local','/opt']:
+		w = test(i+dir)
+		if w: return w
+
+	#waf-local
+	s = '.waf-%s-%s'
+	if sys.platform == 'win32': s = s[1:]
+	dir = join(base, s % (VERSION, REVISION))
+	w = test(dir)
+	if w: return w
+
+	#unpack
+	unpack_wafdir(dir)
+	return dir
+
+wafdir = find_lib()
+if "-vv" in sys.argv: print "wafdir is %s" % wafdir
+
+w = join(wafdir, 'wafadmin')
+t = join(w, 'Tools')
+sys.path = [w, t] + sys.path
+
+import Scripting, Params
+Params.g_tooldir = [t]
+Params.g_cwd_launch = cwd
+
+if Params.g_version != VERSION:
+	err('Version mismatch: waf %s <> wafadmin %s (wafdir %s)' % (VERSION, Params.g_version, wafdir))
+Scripting.prepare()
+
+#==>

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list