[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Build perl (ruby, pyhon, javahl) bindings with SYSTEM (installed) SVN libraries?

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: Wed, 30 Jan 2008 14:34:50 -0800

Lev Serebryakov <lev_at_serebryakov.spb.ru> writes:

> Hello, Subversion.
>
> It is possible to build any bindings with INSTALLED subversion
> libraries, without rebuilding them from source tree?
> I.e. I have subversion without bindings already installed (on
> UNIX-like system), with all headers, etc. And I want to ADD bindings
> to this installation. If I unpack & configure sources and then run:

I maintain Subversion for pkgsrc (similar to FreeBSD ports, and
originally a derivation thereof), and have a patch to gen-make to
make this possible. I've intended to post it here and hopefully
commit it forever, but I just haven't gotten around to it.
Guess you're finally forcing me into it :)

You do this ot build against installed libs:

./gen-make.py [--release] --installed-libs libsvn_client,libsvn_delta,libsvn_diff,libsvn_fs,libsvn_ra,libsvn_repos,libsvn_subr,libsvn_wc

This is all against 1.4. If I can get a +1 from another
committer, I'll update it to trunk, write a log message, commit
it, and backport to the shiny new 1.5 branch.

(Ignore the INSTALLDIRS part of the Makefile.in patch)

$NetBSD: patch-ad,v 1.13 2006/09/11 04:14:31 epg Exp $

--- Makefile.in.orig 2006-01-24 21:57:24.000000000 -0500
+++ Makefile.in
@@ -627,10 +627,9 @@ $(SWIG_PL_DIR)/native/Makefile.PL: $(SWI
         ./config.status subversion/bindings/swig/perl/native/Makefile.PL
 
 $(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL
- cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL
+ cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL INSTALLDIRS=vendor
 
-swig-pl_DEPS = autogen-swig-pl libsvn_client libsvn_delta libsvn_diff \
- libsvn_fs libsvn_ra libsvn_repos libsvn_subr libsvn_wc libsvn_swig_perl \
+swig-pl_DEPS = autogen-swig-pl libsvn_swig_perl \
   $(SWIG_PL_DIR)/native/Makefile
 swig-pl: $(swig-pl_DEPS)
         if test "$(SWIG_PL_DIR)" != "$(SWIG_PL_SRC_DIR)"; then \

$NetBSD: patch-ag,v 1.9 2006/09/11 04:14:31 epg Exp $

--- subversion/bindings/swig/perl/native/Makefile.PL.in.orig 2005-11-16 09:19:09.000000000 -0500
+++ subversion/bindings/swig/perl/native/Makefile.PL.in
@@ -44,7 +44,7 @@ my %config = (
                  " -I$svnlib_builddir",
                  " -I$swig_srcdir -g"),
     OBJECT => q/$(O_FILES)/,
- LIBS => [join(' ', $apr_ldflags,
+ LIBS => [join(' ', $ENV{'LDFLAGS'}, $apr_ldflags,
                   (map {$_ = abs_path($_); "-L$_"} @ldpaths),
                   @ldmodules, '-lsvn_swig_perl-1',
                   `$swig -perl -ldflags`)],

$NetBSD: patch-ah,v 1.4 2006/09/11 04:14:31 epg Exp $

--- build/generator/gen_make.py.orig 2006-04-05 12:12:48.000000000 -0400
+++ build/generator/gen_make.py
@@ -5,6 +5,7 @@
 import os
 import sys
 import string
+import ConfigParser
 
 import gen_base
 import generator.swig.header_wrappers
@@ -53,6 +54,13 @@ class Generator(gen_base.GeneratorBase):
     install_deps = self.graph.get_deps(gen_base.DT_INSTALL)
     install_sources = self.graph.get_all_sources(gen_base.DT_INSTALL)
 
+ cp = ConfigParser.ConfigParser()
+ cp.read('gen-make.opts')
+ if cp.has_option('options', '--installed-libs'):
+ self.installed_libs = cp.get('options', '--installed-libs').split(',')
+ else:
+ self.installed_libs = []
+
     # ensure consistency between runs
     install_deps.sort()
     install_sources.sort(lambda s1, s2: cmp(s1.name, s2.name))
@@ -68,11 +76,17 @@ class Generator(gen_base.GeneratorBase):
 
         # construct a list of the other .la libs to link against
         retreat = build_path_retreat(target.path)
- deps = [ target.filename ]
- link = [ build_path_join(retreat, target.filename) ]
+ if target.name in self.installed_libs:
+ deps = []
+ link = [ '-l%s-%s' % (target.name[3:], self.version) ]
+ else:
+ deps = [ target.filename ]
+ link = [ build_path_join(retreat, target.filename) ]
         for source in self.graph.get_sources(gen_base.DT_LINK, target.name):
           if not isinstance(source, gen_base.TargetLib) or source.external_lib:
             continue
+ elif source.name in self.installed_libs:
+ continue
           deps.append(source.filename)
           link.append(build_path_join(retreat, source.filename))
 
@@ -216,6 +230,8 @@ class Generator(gen_base.GeneratorBase):
             # expeditiously. It is of questionable validity for a build
             # node to have external_project but not have external_lib.
             pass
+ elif link_dep.name in self.installed_libs:
+ libs.append('-l%s-%s' % (link_dep.name[3:], self.version))
           else:
             # append the output of the target to our stated dependencies
             if not self.assume_shared_libs:

$NetBSD: patch-ai,v 1.4 2006/09/11 04:14:31 epg Exp $

--- gen-make.py.orig 2006-04-16 06:26:16.000000000 -0400
+++ gen-make.py
@@ -91,6 +91,13 @@ def _usage_exit():
   print " increase the speed of frequent rebuilds."
   print " *** Do not use unless you understand the consequences. ***"
   print
+ print " UNIX-specific options:"
+ print
+ print " --installed-libs"
+ print " Comma-separated list of Subversion libraries to find"
+ print " pre-installed instead of building (probably only"
+ print " useful for packagers)"
+ print
   print " Windows-specific options:"
   print
   print " --with-apr=DIR"
@@ -195,6 +202,7 @@ if __name__ == '__main__':
                                 'enable-quantify',
                                 'enable-nls',
                                 'enable-bdb-in-apr-util',
+ 'installed-libs=',
                                 'vsnet-version=',
                                 ])
     if len(args) > 1:

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-30 23:35:05 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.