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

Re: Ruby binding can't be built?

From: Fumitoshi UKAI <ukai_at_debian.or.jp>
Date: 2002-12-26 19:29:17 CET

At Thu, 26 Dec 2002 09:52:03 -0500,
Garrett Rooney wrote:

> >> I try to build ruby bindings, but failed.
> >> It seems that svn_client_propget() and svn_client_proplist()
> >> APIs has been changed that bindings/ruby/client.c expected.
> >> In subversion/include/svn_client.h
> >
> > I would be shocked if those were the only interfaces out of date in
> > the Ruby bindings. Prepare yourself for an uphill climb if your
> > planning to get those badboys into sync...
>
> actually, other than these two functions, i suspect that the bindings
> for libsvn_client will work, as i brought them up to date fairly
> recently. large parts of the rest don't build, but making things limp
> along again probably wouldn't be /too much/ work, just a "small matter
> of programming".
>
> the bindings really do need an active maintainer again though, as i
> don't really have any good reason to keep them up to date (i rarely use
> ruby, and my last round of hacking on them was a spur of the moment
> whim), so if anyone wants to start submitting patches to them, please
> feel free, i'd be happy to review and commit them.

Ok.

With this patch from trunk revision 4196, it can be built without any
warnings on debian/sid. It may be better to change Svn::Client#propget
and proplist from singleton_method to usual method to get auth_baton
and accept revision arg.

I check it can be loaded without errors, but not yet tried much operations.
Is there any good sample/test program or documentation?

Thanks,
Fumitoshi UKAI

Index: client.c
===================================================================
--- client.c (revision 4196)
+++ client.c (working copy)
@@ -27,11 +27,13 @@
 
 static svn_error_t *
 cl_log_message_func (const char **log_msg,
+ const char **tmp_file,
                      apr_array_header_t *commit_items,
                      void *baton,
                      apr_pool_t *pool)
 {
   *log_msg = apr_pstrdup (pool, baton);
+ *tmp_file = NULL;
 
   return SVN_NO_ERROR;
 }
@@ -555,6 +557,8 @@
 cl_propget (VALUE class, VALUE name, VALUE aTarget, VALUE recurse)
 {
   apr_hash_t *props;
+ svn_opt_revision_t *revision = NULL;
+ svn_client_auth_baton_t *auth_baton = NULL;
   apr_pool_t *pool;
   VALUE obj;
 
@@ -564,8 +568,9 @@
   pool = svn_pool_create (NULL);
 
   SVN_RB_ERR (svn_client_propget (&props, StringValuePtr (name),
- StringValuePtr (aTarget), RTEST (recurse),
- pool),
+ StringValuePtr (aTarget),
+ revision, auth_baton,
+ RTEST (recurse), pool),
               pool);
 
   obj = svn_ruby_strbuf_hash (props, pool);
@@ -577,6 +582,8 @@
 cl_proplist (VALUE class, VALUE aTarget, VALUE recurse)
 {
   apr_array_header_t *props;
+ svn_opt_revision_t *revision = NULL;
+ svn_client_auth_baton_t *auth_baton = NULL;
   apr_pool_t *pool;
 
   Check_Type (aTarget, T_STRING);
@@ -584,6 +591,7 @@
   pool = svn_pool_create (NULL);
 
   SVN_RB_ERR (svn_client_proplist (&props, StringValuePtr (aTarget),
+ revision, auth_baton,
                                    RTEST (recurse), pool),
               pool);
 
Index: extconf.rb
===================================================================
--- extconf.rb (revision 4196)
+++ extconf.rb (working copy)
@@ -3,6 +3,12 @@
 #
 # Options: --with-svn-dir=<path to svn install>
 #
+# When build in build tree,
+# % SVN_BUILD_DIR=$svn_build_dir ruby extconf.rb
+# % make
+# % make -n DESTDIR=$DESTDIR install | \
+# sed -e '$s/svn.so/.libs\/svn.so/' | sh
+#
 
 if /mswin32/ =~ PLATFORM then
   require 'env'
@@ -10,6 +16,11 @@
   require 'Env'
 end
 
+if ENV['SVN_BUILD_DIR']
+ require 'rbconfig'
+ Config::MAKEFILE_CONFIG['CC'] = 'libtool gcc'
+ Config::MAKEFILE_CONFIG['LDSHARED'] = 'libtool --mode=link gcc -shared'
+end
 require 'mkmf' # Here's the ruby module that does the grunt work
 
 dir_config('svn')
@@ -26,20 +37,37 @@
   'wc.o',
 ]
 
+if ENV['SVN_BUILD_DIR']
+ ENV['PATH'] = "#{ENV['SVN_BUILD_DIR']}:#{ENV['PATH']}"
+end
 $CFLAGS << ' -I. '
 
 $LDFLAGS << `apr-config --ldflags`.chop
 $LOCAL_LIBS << `apr-config --libs`.chop
+# XXX: libapr0_2.0.43-1.deb doesn't provides shlib dependencies
+$LOCAL_LIBS << ' -lgdbm'
+$LOCAL_LIBS << ' -lexpat'
+
 $CFLAGS << `apr-config --cflags`.chop
 $CFLAGS << `apr-config --includes`.chop
 
+if ENV['SVN_BUILD_DIR']
+ $LDFLAGS << " " + ['svn_subr','svn_delta', 'svn_client',
+ 'svn_wc', 'svn_ra', 'svn_fs', 'svn_repos'].collect {|c|
+ "-L#{ENV['SVN_BUILD_DIR']}/subversion/lib#{c}" }.join(" ")
+end
+
 $LDFLAGS << `svn-config --ldflags`.chop
 $CFLAGS << `svn-config --cflags`.chop
 $CFLAGS << `svn-config --includes`.chop
 
+if ENV['SVN_BUILD_DIR']
+ $CFLAGS << ' -I../../include'
+else
 # ick... svn-config doesn't seem to be adding in the directory the subversion
 # includes are in, so lets work around that for now.
-$CFLAGS << ' -I' + `svn-config --prefix`.chop + '/include/subversion-1'
+ $CFLAGS << ' -I' + `svn-config --prefix`.chop + '/include/subversion-1'
+end
 
 # Linux needs -lpthread.
 if PLATFORM =~ /linux/ && $CFLAGS =~ /-pthread/ then
@@ -48,8 +76,8 @@
 
 # Extra libraries needed to compile
 libraries = [
- ['apr-0', 'apr_initialize'],
- ['aprutil-0', 'apr_bucket_alloc'],
+ ['apr', 'apr_initialize'],
+ ['aprutil', 'apr_bucket_alloc'],
               ['svn_subr-1', 'svn_pool_create'],
               ['svn_delta-1', 'svn_txdelta_next_window'],
               ['svn_client-1', 'svn_client_commit'],

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Dec 26 19:30:04 2002

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.