Revision: 896 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=896&view=rev Author: frlan Date: 2009-08-13 20:24:06 +0000 (Thu, 13 Aug 2009)
Log Message: ----------- GeanyLaTeX: Use waf instead of autotools for compiling plugin
Modified Paths: -------------- trunk/geanylatex/ChangeLog trunk/geanylatex/doc/geanylatex.tex trunk/geanylatex/src/geanylatex.h
Added Paths: ----------- trunk/geanylatex/waf trunk/geanylatex/wscript
Removed Paths: ------------- trunk/geanylatex/Makefile.am trunk/geanylatex/autogen.sh trunk/geanylatex/configure.in trunk/geanylatex/indent-all.sh trunk/geanylatex/makefile.win32 trunk/geanylatex/src/Makefile.am
Modified: trunk/geanylatex/ChangeLog =================================================================== --- trunk/geanylatex/ChangeLog 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/ChangeLog 2009-08-13 20:24:06 UTC (rev 896) @@ -1,3 +1,8 @@ +2009-08-13 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * Switch to waf and remove autotools build environment. Still experimental. + + 2009-07-13 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* Correct a tooltip by removing unneeded \t from it.
Deleted: trunk/geanylatex/Makefile.am =================================================================== --- trunk/geanylatex/Makefile.am 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/Makefile.am 2009-08-13 20:24:06 UTC (rev 896) @@ -1,21 +0,0 @@ -SUBDIRS = src po - -EXTRA_DIST = \ - autogen.sh \ - makefile.win32 \ - po/LINGUAS \ - doc/geanylatex.tex \ - doc/geanylatex.pdf \ - doc/geanylatex.html \ - $(srcdir)/doc/img/* - -dist-bzip2: distdir - BZIP2=$(BZIP2_ENV) $(AMTAR) --bzip2 -chof $(distdir).tar.bz2 $(distdir) - -rm -rf $(distdir) - -sign: - if test -f $(PACKAGE)-$(VERSION).tar.gz; then \ - gpg --detach-sign --digest-algo SHA512 $(PACKAGE)-$(VERSION).tar.gz; fi - if test -f $(PACKAGE)-$(VERSION).tar.bz2; then \ - gpg --detach-sign --digest-algo SHA512 $(PACKAGE)-$(VERSION).tar.bz2; fi -
Deleted: trunk/geanylatex/autogen.sh =================================================================== --- trunk/geanylatex/autogen.sh 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/autogen.sh 2009-08-13 20:24:06 UTC (rev 896) @@ -1,159 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -DIE=0 - -if [ -n "$GNOME2_DIR" ]; then - ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" - LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" - PATH="$GNOME2_DIR/bin:$PATH" - export PATH - export LD_LIBRARY_PATH -fi - -(test -f $srcdir/configure.in) || { - echo -n "**Error**: Directory "`$srcdir'" does not look like the" - echo " top-level package directory" - exit 1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have `autoconf' installed." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && { - (intltoolize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have `intltool' installed." - echo "You can get it from:" - echo " ftp://ftp.gnome.org/pub/GNOME/" - DIE=1 - } -} - -(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.in >/dev/null) && { - (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have `xml-i18n-toolize' installed." - echo "You can get it from:" - echo " ftp://ftp.gnome.org/pub/GNOME/" - DIE=1 - } -} - -(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && { - (libtool --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have `libtool' installed." - echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" - DIE=1 - } -} - -(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && { - (grep "sed.*POTFILES" $srcdir/configure.in) > /dev/null || \ - (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have `glib' installed." - echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" - DIE=1 - } -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have `automake' installed." - echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" - DIE=1 - NO_AUTOMAKE=yes -} - - -# if no automake, don't bother testing for aclocal -test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: Missing `aclocal'. The version of `automake'" - echo "installed doesn't appear recent enough." - echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "**Warning**: I am going to run `configure' with no arguments." - echo "If you wish to pass any to it, please specify them on the" - echo `$0'" command line." - echo -fi - -case $CC in -xlc ) - am_opt=--include-deps;; -esac - -for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.in -print` -do - dr=`dirname $coin` - if test -f $dr/NO-AUTO-GEN; then - echo skipping $dr -- flagged as no auto-gen - else - echo processing $dr - ( cd $dr - - aclocalinclude="$ACLOCAL_FLAGS" - - if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then - echo "Creating $dr/aclocal.m4 ..." - test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 - echo "Running glib-gettextize... Ignore non-fatal messages." - echo "no" | glib-gettextize --force --copy - echo "Making $dr/aclocal.m4 writable ..." - test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 - fi - if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then - echo "Running intltoolize..." - intltoolize --copy --force --automake - fi - if grep "^AM_PROG_XML_I18N_TOOLS" configure.in >/dev/null; then - echo "Running xml-i18n-toolize..." - xml-i18n-toolize --copy --force --automake - fi - if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then - if test -z "$NO_LIBTOOLIZE" ; then - echo "Running libtoolize..." - libtoolize --force --copy - fi - fi - echo "Running aclocal $aclocalinclude ..." - aclocal $aclocalinclude - if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then - echo "Running autoheader..." - autoheader - fi - echo "Running automake --gnu $am_opt ..." - automake --add-missing --gnu $am_opt - echo "Running autoconf ..." - autoconf - ) - fi -done - -conf_flags="--enable-maintainer-mode" - -if test x$NOCONFIGURE = x; then - echo Running $srcdir/configure $conf_flags "$@" ... - $srcdir/configure $conf_flags "$@" \ - && echo Now type `make' to compile. || exit 1 -else - echo Skipping configure process. -fi
Deleted: trunk/geanylatex/configure.in =================================================================== --- trunk/geanylatex/configure.in 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/configure.in 2009-08-13 20:24:06 UTC (rev 896) @@ -1,61 +0,0 @@ -# Process this file with autoconf to produce a configure script. - -AC_INIT(configure.in) -AM_INIT_AUTOMAKE(geanylatex, 0.4) - -AM_CONFIG_HEADER(config.h) - -AC_PROG_CC - -AC_DISABLE_STATIC -AM_PROG_LIBTOOL -LIBTOOL="$LIBTOOL --silent" - -AC_PROG_INSTALL - -# checking for Geany -PKG_CHECK_MODULES(GEANY, [geany >= 0.17]) -AC_SUBST(GTK_CFLAGS) -AC_SUBST(GTK_LIBS) - -GEANY_VERSION=`$PKG_CONFIG --modversion geany` -GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0` - -# i18n -GETTEXT_PACKAGE=geanylatex -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) - -ALL_LINGUAS="`sed -e '/^#/d' $srcdir/po/LINGUAS`" # take all languages found in file po/LINGUAS - -AM_GLIB_GNU_GETTEXT -# workaround for intltool bug (http://bugzilla.gnome.org/show_bug.cgi?id=490845) -if test "x$MSGFMT" = "xno"; then - AC_MSG_ERROR([msgfmt not found. Please install the gettext package.]) -fi - -# intltool hack to define install_sh on Debian/Ubuntu systems -if test "x$install_sh" = "x"; then - install_sh="`pwd`/install-sh" - AC_SUBST(install_sh) -fi - -# get the plugin installed at the correct location for Geany -# TODO find a way to NOT override --libdir command line option if given -libdir="`$PKG_CONFIG --variable=libdir geany`/geany" - - -AC_OUTPUT([ -Makefile -src/Makefile -po/Makefile.in -]) - -echo "----------------------------------------" -echo "Install geanylatex plugin binary in : ${libdir}" -echo "Install geanylatex in : ${prefix}" -echo "Using Geany version : ${GEANY_VERSION}" -echo "Using GTK version : ${GTK_VERSION}" -echo "" -echo "Configuration is done OK." -echo ""
Modified: trunk/geanylatex/doc/geanylatex.tex =================================================================== --- trunk/geanylatex/doc/geanylatex.tex 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/doc/geanylatex.tex 2009-08-13 20:24:06 UTC (rev 896) @@ -99,6 +99,7 @@ \texttt{description} \item Some general bugfixes and improvments. As always, see ChangeLog or svn log. + \item Switch to waf for building the plugin \end{itemize}
\subsection*{GeanyLaTeX{} 0.4 -- 2009-05-26} @@ -130,8 +131,8 @@ or geany-devel. Please note that in order to compile and use this plugin, you need Geany 0.17 or later (Geany Plugin API v147 or higher).
-Furthermore you need, of course, a C compiler and the Make tool. The -GNU versions of these tools are recommended. Also there should be a +Furthermore you need, of course, a C compiler and python installed. The +GNU version of the C compiler is recommended. Also there should be a working \LaTeX-environment on your System.
There is no special need in RAM or CPU so the plugin should compile and @@ -147,13 +148,13 @@
\begin{figure}[h!] \begin{lstlisting} -$ ./configure -$ make -$ make install %$ +$ ./waf configure +$ ./waf build +$ ./waf install %$ \end{lstlisting} \end{figure}
-For more configuration details run \texttt{./configure --help} +For more configuration details run \texttt{./waf --help}
By default the plugin is getting installed into the lib subfolder of your found Geany installation. So if you have installed Geany to
Deleted: trunk/geanylatex/indent-all.sh =================================================================== --- trunk/geanylatex/indent-all.sh 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/indent-all.sh 2009-08-13 20:24:06 UTC (rev 896) @@ -1,4 +0,0 @@ -#!/bin/sh -indent -bli0 -i8 -cli8 -npcs -l100 *.c -rm *~ -
Deleted: trunk/geanylatex/makefile.win32 =================================================================== --- trunk/geanylatex/makefile.win32 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/makefile.win32 2009-08-13 20:24:06 UTC (rev 896) @@ -1,60 +0,0 @@ -# -# localwin32.mk is an optional file to override make variables. -# Use localwin32.mk instead of editing variables as it is included in sub -# makefiles. -# localwin32.mk to set PREFIX instead of the default C:\libs -# For MSYS use localwin32.mk to set CP and RM. -# By default this will work in a Windows command prompt. - -CC = gcc -CP = copy -RM = del -PREFIX = C:\libs - -GEANY_SRC = c:\geany_svn -TARGET = geanylatex.dll -.SUFFIXES: .c .o --include localwin32.mk - - -OBJS = geanylatex.o -INCLUDEDIRS= -I. \ - -I$(GEANY_SRC) \ - -I$(GEANY_SRC)\src \ - -I$(GEANY_SRC)\plugins \ - -I$(GEANY_SRC)\tagmanager\include \ - -I$(GEANY_SRC)\scintilla\include \ - -I$(PREFIX)/include/gtk-2.0 \ - -I$(PREFIX)/lib/gtk-2.0/include \ - -I$(PREFIX)/include/atk-1.0 \ - -I$(PREFIX)/include/pango-1.0 \ - -I$(PREFIX)/include/cairo \ - -I$(PREFIX)/include/glib-2.0 \ - -I$(PREFIX)/lib/glib-2.0/include \ - -I$(PREFIX)/include/gettext \ - -I$(PREFIX)/include \ - -I$(ASPELL_PREFIX)/interfaces/cc - -ALL_GTK_LIBS= \ - -L"$(PREFIX)/lib" \ - -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \ - -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv -CCFLAGS=-Wall -O2 -mms-bitfields -DHAVE_CONFIG_H - - -all: $(TARGET) - -deps.mak: - $(CC) -MM $(CCFLAGS) $(INCLUDEDIRS) src/*.c >deps.mak - -spellcheck.o: - $(CC) $(CCFLAGS) $(INCLUDEDIRS) -c $< - -$(TARGET): deps.mak $(OBJS) - $(CC) -shared $(OBJS) $(ALL_GTK_LIBS) -o $(TARGET) - -clean: - -$(RM) deps.mak *.o *.dll - -# Generate header dependencies with "make deps.mak" -include deps.mak
Deleted: trunk/geanylatex/src/Makefile.am =================================================================== --- trunk/geanylatex/src/Makefile.am 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/src/Makefile.am 2009-08-13 20:24:06 UTC (rev 896) @@ -1,7 +0,0 @@ -lib_LTLIBRARIES = geanylatex.la -geanylatex_la_SOURCES = geanylatex.c geanylatex.h datatypes.h latexencodings.c latexencodings.h letters.c letters.h bibtex.h bibtex.c bibtexlabels.c reftex.c reftex.h latexutils.c latexutils.h formatutils.c formatutils.h formatpatterns.c latexenvironments.h latexenvironments.c latexkeybindings.h latexkeybindings.c latexstructure.h latexstructure.c - -geanylatex_la_LDFLAGS = -module -avoid-version -geanylatex_la_LIBADD = @GEANY_LIBS@ $(INTLLIBS) - -AM_CFLAGS = @GEANY_CFLAGS@ -DLOCALEDIR=""$(localedir)""
Modified: trunk/geanylatex/src/geanylatex.h =================================================================== --- trunk/geanylatex/src/geanylatex.h 2009-08-13 10:47:14 UTC (rev 895) +++ trunk/geanylatex/src/geanylatex.h 2009-08-13 20:24:06 UTC (rev 896) @@ -25,7 +25,7 @@ #ifndef GEANYLATEX_H #define GEANYLATEX_H
-#include <geanyplugin.h> +#include "geanyplugin.h" #include <gtk/gtk.h> #include "datatypes.h" #include "letters.h"
Added: trunk/geanylatex/waf =================================================================== --- trunk/geanylatex/waf (rev 0) +++ trunk/geanylatex/waf 2009-08-13 20:24:06 UTC (rev 896) @@ -0,0 +1,153 @@ +#!/usr/bin/env python +# encoding: utf-8 +# Thomas Nagy, 2005-2009 + +""" +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 ImportError("Waf requires Python >= 2.3") + +if 'PSYCOWAF' in os.environ: + try:import psyco;psyco.full() + except:pass + +VERSION="1.5.7" +REVISION="8edda22ed216daab7aed3d430dc291cf" +INSTALL='' +C1='#+' +C2='#)' +cwd = os.getcwd() +join = os.path.join + +WAF='waf' +def b(x): + return x + +if sys.hexversion>0x300000f: + WAF='waf3' + def b(x): + return x.encode() + +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 == b('#==>\n'): + txt = f.readline() + if not txt: err(c % 1) + if f.readline()!=b('#<==\n'): err(c % 2) + break + if not txt: err(c % 3) + txt = txt[1:-1].replace(b(C1), b('\n')).replace(b(C2), b('\r')) + + 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() + + try: + t = tarfile.open(tmp) + for x in t: t.extract(x) + t.close() + except: + os.chdir(cwd) + try: shutil.rmtree(dir) + except OSError: pass + err("Waf cannot be unpacked, check that bzip2 support is present") + + os.chmod(join('wafadmin','Tools'), 493) + + os.unlink(tmp) + + if sys.hexversion>0x300000f: + sys.path = [join(dir, 'wafadmin')] + sys.path + import py3kfixes + py3kfixes.fixdir(dir) + + 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/%s-%s-%s/" % (WAF, VERSION, REVISION) + for i in [INSTALL,'/usr','/usr/local','/opt']: + w = test(i+dir) + if w: return w + + #waf-local + s = '.%s-%s-%s' + if sys.platform == 'win32': s = s[1:] + dir = join(base, s % (WAF, VERSION, REVISION)) + w = test(dir) + if w: return w + + #unpack + unpack_wafdir(dir) + return dir + +wafdir = find_lib() +w = join(wafdir, 'wafadmin') +t = join(w, 'Tools') +sys.path = [w, t] + sys.path + +import Scripting +Scripting.prepare(t, cwd, VERSION, wafdir) +sys.exit(0) + +#==>
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.