Mercurial > gub
changeset 4511:7642be552b8a
Add TargetBuild.install_config_script. Use it in curl, libxml2, raptor.
Also add some new packages.
author | Jan Nieuwenhuizen <janneke@gnu.org> |
---|---|
date | Sat, 25 Oct 2008 22:49:29 +0200 |
parents | ff2c9c9371f1 |
children | fba46cd3f450 |
files | gub/specs/cross/gcc-g++.py gub/specs/curl.py gub/specs/libgcrypt.py gub/specs/libpcre.py gub/specs/libxml2.py gub/specs/libxslt.py gub/specs/raptor.py gub/specs/rasqal.py gub/targetbuild.py patches/raptor-1.4.18-cross.patch |
diffstat | 10 files changed, 177 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gub/specs/cross/gcc-g++.py Sat Oct 25 22:49:29 2008 +0200 @@ -0,0 +1,7 @@ +from gub import gubb +from gub import mirrors + +class Gcc_gxx (gubb.NullBuildSpec): + def __init__ (self, settings): + gubb.NullBuildSpec.__init__ (self, settings) + self.with_tarball (mirror=mirrors.cygwin, version='3.4.4-3', format='bz2')
--- a/gub/specs/curl.py Sat Oct 25 22:42:48 2008 +0200 +++ b/gub/specs/curl.py Sat Oct 25 22:49:29 2008 +0200 @@ -1,3 +1,4 @@ +from gub import context from gub import targetbuild from gub import toolsbuild @@ -7,8 +8,11 @@ targetbuild.TargetBuild.install (self) self.system ('mkdir -p %(install_prefix)s%(cross_dir)s/bin') self.system ('cp %(install_prefix)s/bin/curl-config %(install_prefix)s%(cross_dir)s/bin/curl-config') - self.file_sub ([('%(system_prefix)s', '%(prefix_dir)s@g')] + self.file_sub ([('%(system_prefix)s', '%(prefix_dir)s')] , '%(install_prefix)s/bin/curl-config') + @context.subst_method + def config_script (self): + return 'curl-config' class Curl__tools (toolsbuild.ToolsBuild): source = Curl.source
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gub/specs/libgcrypt.py Sat Oct 25 22:49:29 2008 +0200 @@ -0,0 +1,5 @@ +from gub import targetbuild + +# hmmrg, no libgcrypt.so in here... +class Libgcrypt (targetbuild.TargetBuild): + source = 'ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.9.tar.bz2'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gub/specs/libpcre.py Sat Oct 25 22:49:29 2008 +0200 @@ -0,0 +1,6 @@ +from gub import targetbuild + +class Libpcre (targetbuild.TargetBuild): + source = 'http://surfnet.dl.sourceforge.net/sourceforge/prce/pcre-7.8.tar.bz2' + def name (self): + return 'libpcre'
--- a/gub/specs/libxml2.py Sat Oct 25 22:42:48 2008 +0200 +++ b/gub/specs/libxml2.py Sat Oct 25 22:49:29 2008 +0200 @@ -1,8 +1,14 @@ -from gub import mirrors +from gub import context +from gub import misc from gub import targetbuild class Libxml2 (targetbuild.TargetBuild): - source = mirrors.with_tarball (name='libxml2', mirror=mirrors.gnome_218, version='2.6.27') + source = 'http://ftp.gnome.org/pub/GNOME/platform/2.18/2.18.1/sources/libxml2-2.6.27.tar.gz' def configure_command (self): return (targetbuild.TargetBuild.configure_command (self) - + ' --without-python') + + misc.join_lines (''' +--without-python +''')) + @context.subst_method + def config_script (self): + return 'xml2-config'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gub/specs/libxslt.py Sat Oct 25 22:49:29 2008 +0200 @@ -0,0 +1,41 @@ +from gub import context +from gub import loggedos +from gub import misc +from gub import targetbuild + +class Libxslt (targetbuild.TargetBuild): + source = 'http://xmlsoft.org/sources/libxslt-1.1.24.tar.gz' + def patch (self): + self.system ('rm -f %(srcdir)s/libxslt/xsltconfig.h') + def get_build_dependencies (self): + return ['libxml2-devel', 'zlib-devel'] + def configure_command (self): + return (targetbuild.TargetBuild.configure_command (self) + + misc.join_lines (''' +--without-python +--without-crypto +''')) + @context.subst_method + def config_script (self): + return 'xslt-config' + +class Libxslt__mingw (Libxslt): + def autoconf (self): + #update libtool so that it will install a dll + self.runner._execute (commands.ForcedAutogenMagic (self)) + def configure (self): + Libxslt.configure (self) + def fix_allow_undefined (logger, file): + loggedos.file_sub (logger, + [ + # libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 shared libraries + ('^(allow_undefined_flag=.*)unsupported', '\\1'), + # libtool: install: error: cannot install `libexslt.la' to a directory not ending in /home/janneke/vc/gub/target/mingw/build/libxslt-1.1.24/libexslt/.libs + (r'if test "\$inst_prefix_dir" = "\$destdir";', 'if false;'),], + file) + self.map_locate (fix_allow_undefined, '%(builddir)s', 'libtool') + def configure_command (self): + return (Libxslt.configure_command (self) + + misc.join_lines (''' +--without-plugins +'''))
--- a/gub/specs/raptor.py Sat Oct 25 22:42:48 2008 +0200 +++ b/gub/specs/raptor.py Sat Oct 25 22:49:29 2008 +0200 @@ -1,26 +1,17 @@ from gub import commands +from gub import context +from gub import misc from gub import targetbuild class Raptor (targetbuild.TargetBuild): source = 'http://download.librdf.org/source/raptor-1.4.18.tar.gz' patches = ['raptor-1.4.18-cross.patch'] def get_build_dependencies (self): - return ['expat-devel', 'libxml2-devel', 'tools::autoconf', 'tools::automake', 'tools::libtool'] + return ['curl-devel', 'expat-devel', 'libxml2-devel', 'libxslt-devel', 'tools::flex', 'tools::autoconf', 'tools::automake', 'tools::libtool', 'tools::gtk_doc'] def autoupdate (self): self.file_sub ([('( |-I|-L)/usr', r'\1%(system_prefix)s')] , '%(srcdir)s/configure.ac') self.runner._execute (commands.ForcedAutogenMagic (self)) - return -# self.system ('cd %(srcdir)s && bash ./autogen.sh --help') - self.system (''' -#cd %(srcdir)s && libtoolize -#cd %(srcdir)s && gtkdocize -cd %(srcdir)s && aclocal -cd %(srcdir)s && autoheader -cd %(srcdir)s && autoconf -cd %(srcdir)s && automake --force --foreign --copy --add-missing -''') - def config_cache_overrides (self, str): return str + ''' ac_cv_vsnprint_result_c99=1 @@ -28,3 +19,24 @@ ac_cv_expat_xml_parsercreate=yes ac_cv_expat_initial_utf8_bom=yes ''' + def configure_command (self): + return (targetbuild.TargetBuild.configure_command (self) + + misc.join_lines (''' +--enable-maintainer-mode +''')) + @context.subst_method + def config_script (self): + return 'raptor-config' + +class Raptor__mingw (Raptor): + patches = Raptor.patches + def makeflags (self): +# return '''CFLAGS='-Dstrtok_r\(s,d,p\)=strtok\(s,d\)' ''' + return '''CFLAGS="-D'strtok_r(s,d,p)=strtok(s,d)'" ''' + def configure_command (self): + return (targetbuild.TargetBuild.configure_command (self) + + misc.join_lines (''' +--enable-maintainer-mode +--enable-parsers="grddl rdfxml ntriples turtle trig guess rss-tag-soup rdfa n3" +''')) +#--enable-parsers="grddl rdfxml ntriples turtle trig guess rss-tag-soup rdfa n3"
--- a/gub/specs/rasqal.py Sat Oct 25 22:42:48 2008 +0200 +++ b/gub/specs/rasqal.py Sat Oct 25 22:49:29 2008 +0200 @@ -3,4 +3,4 @@ class Rasqal (targetbuild.TargetBuild): source = 'http://download.librdf.org/source/rasqal-0.9.16.tar.gz' def get_build_dependencies (self): - return ['raptor-devel'] + return ['raptor-devel', 'libpcre-devel']
--- a/gub/targetbuild.py Sat Oct 25 22:42:48 2008 +0200 +++ b/gub/targetbuild.py Sat Oct 25 22:49:29 2008 +0200 @@ -33,6 +33,23 @@ def install (self): self.pre_install_libtool_fixup () build.UnixBuild.install (self) + if self.config_script (): + self.install_config_script () + + @context.subst_method + def config_script (self): + return '' + + def install_config_script (self): + self.system ('mkdir -p %(install_prefix)s%(cross_dir)s/bin') + self.system ('cp %(install_prefix)s/bin/%(config_script)s %(install_prefix)s%(cross_dir)s/bin/%(config_script)s') + self.file_sub ([('^prefix=/usr/*\s*$', 'prefix=%(system_prefix)s'), + ('( |-I)/usr/include', r'\1%(system_prefix)s/include'), + ('( |-L)/usr/lib/* ', r'\1%(system_prefix)s/lib'), + ('^includedir=/usr/include/*\s*$', 'includedir=%(system_prefix)s/include'), + ('^libdir=/usr/lib/*\s*$', 'libdir=%(system_prefix)s/lib'),], + '%(install_prefix)s%(cross_dir)s/bin/%(config_script)s', + must_succeed=1) def pre_install_libtool_fixup (self): ## Workaround for libtool bug. libtool inserts -L/usr/lib
--- a/patches/raptor-1.4.18-cross.patch Sat Oct 25 22:42:48 2008 +0200 +++ b/patches/raptor-1.4.18-cross.patch Sat Oct 25 22:49:29 2008 +0200 @@ -47,3 +47,65 @@ else AC_MSG_RESULT(no) +--- raptor-1.4.18/librdfa/curie.c.orig 2008-10-25 14:20:31.000000000 +0200 ++++ raptor-1.4.18/librdfa/curie.c 2008-06-14 07:33:37.000000000 +0200 +@@ -122,7 +122,7 @@ char* rdfa_resolve_uri(rdfacontext* cont + { + // if we have a relative URI, chop off the name of the file + // and replace it with the relative pathname +- char* end_index = rindex(context->base, '/'); ++ char* end_index = strrchr(context->base, '/'); + + if(end_index != NULL) + { +@@ -130,7 +130,7 @@ char* rdfa_resolve_uri(rdfacontext* cont + char* end_index2; + + tmpstr = rdfa_replace_string(tmpstr, context->base); +- end_index2= rindex(tmpstr, '/'); ++ end_index2= strrchr(tmpstr, '/'); + end_index2++; + *end_index2 = '\0'; + +--- raptor-1.4.18/librdfa/rdfa.c.orig 2008-10-25 14:21:02.000000000 +0200 ++++ raptor-1.4.18/librdfa/rdfa.c 2008-10-25 14:21:57.000000000 +0200 +@@ -163,7 +163,7 @@ static size_t rdfa_init_base( + { + char* href_start = strstr(base_start, "href="); + char* uri_start = href_start + 6; +- char* uri_end = index(uri_start, '"'); ++ char* uri_end = strchr(uri_start, '"'); + + if((uri_start != NULL) && (uri_end != NULL)) + { +@@ -898,8 +898,8 @@ static void XMLCALL + if(context->xml_literal != NULL) + { + // get the data between the first tag and the last tag +- content_start = index(context->xml_literal, '>'); +- content_end = rindex(context->xml_literal, '<'); ++ content_start = strchr(context->xml_literal, '>'); ++ content_end = strrchr(context->xml_literal, '<'); + + if((content_start != NULL) && (content_end != NULL)) + { +--- raptor-1.4.18/librdfa/triple.c.orig 2008-10-25 14:22:07.000000000 +0200 ++++ raptor-1.4.18/librdfa/triple.c 2008-10-25 14:22:44.000000000 +0200 +@@ -437,7 +437,7 @@ void rdfa_complete_object_literal_triple + current_object_literal = context->content; + type = RDF_TYPE_PLAIN_LITERAL; + } +- else if(index(context->xml_literal, '<') == NULL) ++ else if(strchr(context->xml_literal, '<') == NULL) + { + current_object_literal = context->plain_literal; + type = RDF_TYPE_PLAIN_LITERAL; +@@ -467,7 +467,7 @@ void rdfa_complete_object_literal_triple + // [current element], i.e., not including the element itself, and + // giving it a datatype of rdf:XMLLiteral. + if((current_object_literal == NULL) && +- (index(context->xml_literal, '<') != NULL) && ++ (strchr(context->xml_literal, '<') != NULL) && + ((context->datatype == NULL) || + (strcmp(context->datatype, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral") == 0)))