[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: 2003-01-07 19:40:45 CET

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
Received on Tue Jan 7 19:41:36 2003

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