You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Fumitoshi UKAI <uk...@debian.or.jp> on 2002/12/26 08:17:58 UTC

Ruby binding can't be built?

Hi,

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

svn_error_t *
svn_client_propget (apr_hash_t **props,
                    const char *propname,
                    const char *target,
                    const svn_opt_revision_t *revision,
                    svn_client_auth_baton_t *auth_baton,
                    svn_boolean_t recurse,
                    apr_pool_t *pool);

and 

svn_error_t *
svn_client_proplist (apr_array_header_t **props,
                     const char *target, 
                     const svn_opt_revision_t *revision,
                     svn_client_auth_baton_t *auth_baton,
                     svn_boolean_t recurse,
                     apr_pool_t *pool);

But in bindings/ruby/client.c, it is written like this

  SVN_RB_ERR (svn_client_propget (&props, StringValuePtr (name),
                                  StringValuePtr (aTarget), RTEST (recurse),
                                  pool),
              pool);

and

  SVN_RB_ERR (svn_client_proplist (&props, StringValuePtr (aTarget),
                                   RTEST (recurse), pool),
              pool);

It misses passing revision and auth_baton.
How should we fix this? change ruby APIs SVN::Client#propget, proplist?

Thanks,
Fumitoshi UKAI

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Bob Gustafson <bo...@rcnChicago.com>.
On Thu, 26 Dec 2002 19:03:53 -0500 Garrett Rooney wrote:
>On Thursday, December 26, 2002, at 01:29 PM, Fumitoshi UKAI wrote:
>
>> 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?
>
>unfortunately, no.  this stuff could really use a good test suite and a
>heavy dose of documentation, but there currently isn't any.  again, if
>you write it, i'll commit it ;-)
>

I use Ruby more than Perl or shell scripts. Would be good to be able to use
svn from Ruby.  (Ruby is really great..)

Sample programs? Documentation? I'm still a newbie as far as svn is
concerned. I have a feel for the problem being solved, but not the
implementation as yet.

I'm in the background - cheering.

BobG

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Michael Wood <mw...@its.uct.ac.za>.
On Wed, Jan 08, 2003 at 12:20:33PM +0900, Fumitoshi UKAI wrote:
> At Tue, 7 Jan 2003 19:54:51 -0500,
> Garrett Rooney wrote:
[snip]
> > also, what did you use to generate the patch?  it seems like some weird 
> > mix between a unified diff and a context diff, and i couldn't get it to 
> > apply here.
> 
> I just use 'svn diff -x -u -x --show-c-function' in trunk dir.

I think the "-u" is ignored in that case.  Try this instead:
$ svn diff -x "-u --show-c-function"

If Garrett's version of patch still can't apply it, just do "svn diff"
without any args (which defaults to "-u" AFAIK.)

-- 
Michael Wood <mw...@its.uct.ac.za>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Fumitoshi UKAI <uk...@debian.or.jp>.
At Tue, 7 Jan 2003 19:54:51 -0500,
Garrett Rooney wrote:
> 
> On Tuesday, January 7, 2003, at 01:40 PM, Fumitoshi UKAI wrote:
> >
> >    * subversion/bindings/ruby/client.c
> >      (cl_log_message_func): add tmp_file arugments because it is
> >       svn_client_get_commit_log_t.
> >       It doesn't use tmp_file, so it sets NULL.
> >      (cl_propget): revision and auth_baton are required by
> >       svn_client_propget().
> >      (cl_proplist): revision and auth_baton are required by
> >       svn_client_proplist().
> 
> i'm about to apply these changes.
> 
> >    * subversion/bindings/ruby/extconf.rb
> >      add comments how to build in build tree.
> >      hack to use libtool in case ruby binding built in build tree.
> >      Some local libs (-lgdbm, -lexpat, -ldb-4) are required,
> >      but missing from apr-config.  Without this hack, have_library() 
> > failed.
> >      Add build tree to LDFLAGS to link library currently built.
> >      Add subversion/include to include path.
> >      library name fixes: s/apr-0/apr/, s/aprutil-0/aprutil/.
> >      Except classical apr path layout, no -0 suffix is used.
> >
> 
> i left the extconf.rb changes off, since most of them seem like hacks, 
> and even if we hack it to support building with the in-tree svn libs, 
> it didn't seem to work for the in-tree apr/aprutil.
> 
> also, what did you use to generate the patch?  it seems like some weird 
> mix between a unified diff and a context diff, and i couldn't get it to 
> apply here.

I just use 'svn diff -x -u -x --show-c-function' in trunk dir.

Regards,
Fumitoshi UKAI

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Fumitoshi UKAI <uk...@debian.or.jp>.
At Tue, 7 Jan 2003 21:02:57 +0000,
Thom May wrote:

> > > >     library name fixes: s/apr-0/apr/, s/aprutil-0/aprutil/.
> > > >     Except classical apr path layout, no -0 suffix is used.
> > > 
> > > this all looks fine from what i can see.  i'll take a closer look 
> > > tonight, when i'm in front of a machine, and i'll commit everything 
> > > except the s/apr-0/apr/ s/aprutil-0/aprutil/ part.  we build against the 
> > > stock apr/aprutil (at least theoretically).  if debian wants to change 
> > > the names of the libraries, they'll have to patch this locally.
> > 
> > Right. All platforms should use the -0 suffix; it was just an oversight that
> > the .layout didn't get changed to include it.
> > 
> > Thom: feel like tweaking config.layout?
> > 
> Yeah. Hadaka pointed this one out to me ages ago on irc, i fixed it in the
> packages (which are just waiting for 2.0.44) and then promptly forgot to do
> so in tree ;-)

I see that debian layout is changed in
http://cvs.apache.org/viewcvs.cgi/apr/config.layout and
http://cvs.apache.org/viewcvs.cgi/apr-util/config.layout
but why does other layouts, such as GNU, RedHat, SuSE or others still
remain not having libsuffix?

Regards,
Fumitoshi UKAI

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Thom May <th...@planetarytramp.net>.
* Greg Stein (gstein@lyra.org) wrote :
> On Tue, Jan 07, 2003 at 01:55:49PM -0500, Garrett Rooney wrote:
> > Fumitoshi UKAI wrote:
> >...
> > >     library name fixes: s/apr-0/apr/, s/aprutil-0/aprutil/.
> > >     Except classical apr path layout, no -0 suffix is used.
> > 
> > this all looks fine from what i can see.  i'll take a closer look 
> > tonight, when i'm in front of a machine, and i'll commit everything 
> > except the s/apr-0/apr/ s/aprutil-0/aprutil/ part.  we build against the 
> > stock apr/aprutil (at least theoretically).  if debian wants to change 
> > the names of the libraries, they'll have to patch this locally.
> 
> Right. All platforms should use the -0 suffix; it was just an oversight that
> the .layout didn't get changed to include it.
> 
> Thom: feel like tweaking config.layout?
> 
Yeah. Hadaka pointed this one out to me ages ago on irc, i fixed it in the
packages (which are just waiting for 2.0.44) and then promptly forgot to do
so in tree ;-)
Cheers,
-Thom

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Greg Stein <gs...@lyra.org>.
On Tue, Jan 07, 2003 at 01:55:49PM -0500, Garrett Rooney wrote:
> Fumitoshi UKAI wrote:
>...
> >     library name fixes: s/apr-0/apr/, s/aprutil-0/aprutil/.
> >     Except classical apr path layout, no -0 suffix is used.
> 
> this all looks fine from what i can see.  i'll take a closer look 
> tonight, when i'm in front of a machine, and i'll commit everything 
> except the s/apr-0/apr/ s/aprutil-0/aprutil/ part.  we build against the 
> stock apr/aprutil (at least theoretically).  if debian wants to change 
> the names of the libraries, they'll have to patch this locally.

Right. All platforms should use the -0 suffix; it was just an oversight that
the .layout didn't get changed to include it.

Thom: feel like tweaking config.layout?

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
Fumitoshi UKAI wrote:

>At Thu, 26 Dec 2002 19:03:53 -0500,
>Garrett Rooney wrote:
>
>  
>
>>>I check it can be loaded without errors, but not yet tried much 
>>>operations.
>>>Is there any good sample/test program or documentation?
>>>      
>>>
>>unfortunately, no.  this stuff could really use a good test suite and a 
>>heavy dose of documentation, but there currently isn't any.  again, if 
>>you write it, i'll commit it ;-)
>>    
>>
>
>Ok, I'll write it.
>  
>

i look forward to seeing them.

> 
>  
>
>  * subversion/bindings/ruby/client.c
>     (cl_log_message_func): add tmp_file arugments because it is
>      svn_client_get_commit_log_t.
>      It doesn't use tmp_file, so it sets NULL.
>     (cl_propget): revision and auth_baton are required by 
>      svn_client_propget().
>     (cl_proplist): revision and auth_baton are required by
>      svn_client_proplist().
>
>   * subversion/bindings/ruby/extconf.rb
>     add comments how to build in build tree.
>     hack to use libtool in case ruby binding built in build tree.
>     Some local libs (-lgdbm, -lexpat, -ldb-4) are required, 
>     but missing from apr-config.  Without this hack, have_library() failed.
>     Add build tree to LDFLAGS to link library currently built.
>     Add subversion/include to include path.
>     library name fixes: s/apr-0/apr/, s/aprutil-0/aprutil/.
>     Except classical apr path layout, no -0 suffix is used.
>

this all looks fine from what i can see.  i'll take a closer look 
tonight, when i'm in front of a machine, and i'll commit everything 
except the s/apr-0/apr/ s/aprutil-0/aprutil/ part.  we build against the 
stock apr/aprutil (at least theoretically).  if debian wants to change 
the names of the libraries, they'll have to patch this locally.

thanks a lot,

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Tuesday, January 7, 2003, at 01:40 PM, Fumitoshi UKAI wrote:
>
>    * subversion/bindings/ruby/client.c
>      (cl_log_message_func): add tmp_file arugments because it is
>       svn_client_get_commit_log_t.
>       It doesn't use tmp_file, so it sets NULL.
>      (cl_propget): revision and auth_baton are required by
>       svn_client_propget().
>      (cl_proplist): revision and auth_baton are required by
>       svn_client_proplist().

i'm about to apply these changes.

>    * subversion/bindings/ruby/extconf.rb
>      add comments how to build in build tree.
>      hack to use libtool in case ruby binding built in build tree.
>      Some local libs (-lgdbm, -lexpat, -ldb-4) are required,
>      but missing from apr-config.  Without this hack, have_library() 
> failed.
>      Add build tree to LDFLAGS to link library currently built.
>      Add subversion/include to include path.
>      library name fixes: s/apr-0/apr/, s/aprutil-0/aprutil/.
>      Except classical apr path layout, no -0 suffix is used.
>

i left the extconf.rb changes off, since most of them seem like hacks, 
and even if we hack it to support building with the in-tree svn libs, 
it didn't seem to work for the in-tree apr/aprutil.

also, what did you use to generate the patch?  it seems like some weird 
mix between a unified diff and a context diff, and i couldn't get it to 
apply here.

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by Fumitoshi UKAI <uk...@debian.or.jp>.
At Thu, 26 Dec 2002 19:03:53 -0500,
Garrett Rooney wrote:

> > I check it can be loaded without errors, but not yet tried much 
> > operations.
> > Is there any good sample/test program or documentation?
> 
> unfortunately, no.  this stuff could really use a good test suite and a 
> heavy dose of documentation, but there currently isn't any.  again, if 
> you write it, i'll commit it ;-)

Ok, I'll write it.
 
> some comments on the actual patch.  first, you should probably submit a 
> log entry with it (see the HACKING document for details), and you 
> shouldn't use tabs, just spaces (also in HACKING).  the code changes 
> look fine, at first glance (haven't had a chance to test yet), but some 
> of the extconf.rb stuff looks sketchy.  i don't like the idea of 
> forcing the use of gcc for the compiler like that, and the apr and 
> aprutil libs really are apr-0 and aprutil-0 (at least the ones from the 
> apache people are).  i assume from your comments that you're compiling 
> on a debian box?  you really should test this stuff with the bleeding 
> edge svn and apr/aprutil packages, as that's what it needs to build on. 

I just investigate it. debian uses debian layout (srclib/apr/config.layout) 
and debian layout doesn't have libsuffix (-${APR_MAJOR_VERSION}).  
Rather, only classical APR path layout has libsuffix.  
So APR_LIBNAME is replaced with just apr not apr-0, isn't it?

subversion_0.16.0-1.diff.gz also has a fix doing s/apr-0/apr/ against
subversion/bindings/swig/python/setup.py

Anyway, I'll build subversion 0.16.1 with the attached patch and build 
successful.

Thanks,
Fumitoshi UKAI

   * subversion/bindings/ruby/client.c
     (cl_log_message_func): add tmp_file arugments because it is
      svn_client_get_commit_log_t.
      It doesn't use tmp_file, so it sets NULL.
     (cl_propget): revision and auth_baton are required by 
      svn_client_propget().
     (cl_proplist): revision and auth_baton are required by
      svn_client_proplist().

   * subversion/bindings/ruby/extconf.rb
     add comments how to build in build tree.
     hack to use libtool in case ruby binding built in build tree.
     Some local libs (-lgdbm, -lexpat, -ldb-4) are required, 
     but missing from apr-config.  Without this hack, have_library() failed.
     Add build tree to LDFLAGS to link library currently built.
     Add subversion/include to include path.
     library name fixes: s/apr-0/apr/, s/aprutil-0/aprutil/.
     Except classical apr path layout, no -0 suffix is used.

Index: subversion/bindings/ruby/client.c
===================================================================
*** subversion/bindings/ruby/client.c	(revision 4280)
--- subversion/bindings/ruby/client.c	(working copy)
***************
*** 27,37 ****
--- 27,39 ----
  
  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;
  }
*************** static VALUE
*** 555,560 ****
--- 557,564 ----
  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;
  
*************** cl_propget (VALUE class, VALUE name, VAL
*** 564,571 ****
    pool = svn_pool_create (NULL);
  
    SVN_RB_ERR (svn_client_propget (&props, StringValuePtr (name),
!                                   StringValuePtr (aTarget), RTEST (recurse),
!                                   pool),
                pool);
  
    obj = svn_ruby_strbuf_hash (props, pool);
--- 568,576 ----
    pool = svn_pool_create (NULL);
  
    SVN_RB_ERR (svn_client_propget (&props, StringValuePtr (name),
!                                   StringValuePtr (aTarget), 
!                                   revision, auth_baton,
!                                   RTEST (recurse), pool),
                pool);
  
    obj = svn_ruby_strbuf_hash (props, pool);
*************** static VALUE
*** 577,582 ****
--- 582,589 ----
  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);
*************** cl_proplist (VALUE class, VALUE aTarget,
*** 584,589 ****
--- 591,597 ----
    pool = svn_pool_create (NULL);
  
    SVN_RB_ERR (svn_client_proplist (&props, StringValuePtr (aTarget),
+                                    revision, auth_baton,
                                     RTEST (recurse), pool),
                pool);
  
Index: subversion/bindings/ruby/extconf.rb
===================================================================
*** subversion/bindings/ruby/extconf.rb	(revision 4280)
--- subversion/bindings/ruby/extconf.rb	(working copy)
***************
*** 3,8 ****
--- 3,13 ----
  #
  # Options: --with-svn-dir=<path to svn install>
  #
+ # When build in build tree,
+ #  % SVN_BUILD_DIR=$svn_build_dir ruby extconf.rb
+ #  % make
+ #  % make DESTDIR=$DESTDIR install
+ # 
  
  if /mswin32/ =~ PLATFORM then
    require 'env'
*************** else
*** 10,16 ****
    require 'Env'
  end
  
! require 'mkmf'	# Here's the ruby module that does the grunt work
  
  dir_config('svn')
  
--- 15,26 ----
    require 'Env'
  end
  
! if ENV['SVN_BUILD_DIR']
!  require 'rbconfig'
!  Config::MAKEFILE_CONFIG['CC'] = 'libtool cc'
!  Config::MAKEFILE_CONFIG['LDSHARED'] = 'libtool --mode=link cc -shared'
! end
! require 'mkmf'  # Here's the ruby module that does the grunt work
  
  dir_config('svn')
  
*************** $objs = [
*** 26,45 ****
    'wc.o',
  ]
  
  $CFLAGS << ' -I. '
  
  $LDFLAGS << `apr-config --ldflags`.chop
  $LOCAL_LIBS << `apr-config --libs`.chop
  $CFLAGS << `apr-config --cflags`.chop
  $CFLAGS << `apr-config --includes`.chop
  
  $LDFLAGS << `svn-config --ldflags`.chop
  $CFLAGS << `svn-config --cflags`.chop
  $CFLAGS << `svn-config --includes`.chop
  
  # 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'
  
  # Linux needs -lpthread.
  if PLATFORM =~ /linux/ && $CFLAGS =~ /-pthread/ then
--- 36,74 ----
    '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'
+ # XXX: libaprutil doesn't provides shlib dependencies?
+ $LOCAL_LIBS << ' -ldb-4'
+ 
  $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'
! end
  
  # Linux needs -lpthread.
  if PLATFORM =~ /linux/ && $CFLAGS =~ /-pthread/ then
*************** end
*** 48,55 ****
  
  # Extra libraries needed to compile
  libraries = [
!               ['apr-0',        'apr_initialize'],
!               ['aprutil-0',    'apr_bucket_alloc'],
                ['svn_subr-1',   'svn_pool_create'],
                ['svn_delta-1',  'svn_txdelta_next_window'],
                ['svn_client-1', 'svn_client_commit'],
--- 77,84 ----
  
  # Extra libraries needed to compile
  libraries = [
!               ['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

Re: Ruby binding can't be built?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Thursday, December 26, 2002, at 01:29 PM, Fumitoshi UKAI wrote:

> 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.

honestly, i'd prefer to see two separate sets of methods, one for 
normal props and one for revision props.  stashing the revision in the 
object seems like a hack, and they really are different things.  now 
the auth_baton seems like something one might want to stash in the 
object, but if we split it out into separate revprop methods, then you 
only need it for those, in which case you might as well pass it in i 
suppose.

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

unfortunately, no.  this stuff could really use a good test suite and a 
heavy dose of documentation, but there currently isn't any.  again, if 
you write it, i'll commit it ;-)

some comments on the actual patch.  first, you should probably submit a 
log entry with it (see the HACKING document for details), and you 
shouldn't use tabs, just spaces (also in HACKING).  the code changes 
look fine, at first glance (haven't had a chance to test yet), but some 
of the extconf.rb stuff looks sketchy.  i don't like the idea of 
forcing the use of gcc for the compiler like that, and the apr and 
aprutil libs really are apr-0 and aprutil-0 (at least the ones from the 
apache people are).  i assume from your comments that you're compiling 
on a debian box?  you really should test this stuff with the bleeding 
edge svn and apr/aprutil packages, as that's what it needs to build on. 
  i think i like the stuff for building in the working copy though, i'll 
have to digest it a bit first though.

thanks,

-garrett

> 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

Re: Ruby binding can't be built?

Posted by Fumitoshi UKAI <uk...@debian.or.jp>.
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

Re: Ruby binding can't be built?

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Thursday, December 26, 2002, at 07:34 AM, cmpilato@collab.net wrote:

> Fumitoshi UKAI <uk...@debian.or.jp> writes:
>
>> Hi,
>>
>> 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.

-garrett


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Ruby binding can't be built?

Posted by cm...@collab.net.
Fumitoshi UKAI <uk...@debian.or.jp> writes:

> Hi,
> 
> 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...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org