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

[PATCH] Re: RFC: /usr/lib/svn-python/ ---> /usr/lib/python2.?/site-packages/

From: Peter Samuelson <peter_at_p12n.org>
Date: Thu, 8 May 2008 10:40:32 -0500

[Max Bowsher]
> The major motivation for this is that the built bindings are specific
> to the used minor version of Python.

Speaking of which, libsvn_swig_py is specific to the minor version, and
at least in Debian/Ubuntu, we install that to the system lib dir. Thus
Matthias Klose wrote the following patch. It adds the variables PYVER
and PYTHON_INCLUDES to the Makefile so they can be specified from the
command line without rerunning configure.

It may not be in perfect shape, but this is what we're using in
Debian/Ubuntu so you might take it into consideration for your 1.6.x
work.

-- 
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/
[[[
Facilitate building bindings for multiple Python versions on a
single system, without reconfiguring the source or using different
installation paths.
* Makefile.in, build/ac-macros/swig.m4 (SVN_FIND_SWIG):
  Split PYTHON_INCLUDES out of SWIG_PY_INCLUDES, so it can be easily
  overridden at compile time.
* build.conf: rename libsvn_swig_py to libsvn_swig_py$(PYVER) so that
  multiple Python versions can be made to coexist on a system.
Patch by: Matthias Klose <doko_at_debian.org>
]]]
Index: Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -108,6 +108,7 @@
 APACHE_LDFLAGS = @APACHE_LDFLAGS@
 
 SWIG = @SWIG@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
 SWIG_PY_INCLUDES = @SWIG_PY_INCLUDES@ -I$(SWIG_SRC_DIR)/python/libsvn_swig_py
 SWIG_PY_COMPILE = @SWIG_PY_COMPILE@
 SWIG_PY_LINK = @SWIG_PY_LINK@
Index: build/ac-macros/swig.m4
--- a/build/ac-macros/swig.m4
+++ b/build/ac-macros/swig.m4
@@ -93,7 +93,8 @@
     AC_CACHE_CHECK([for Python includes], [ac_cv_python_includes],[
       ac_cv_python_includes="`$PYTHON ${abs_srcdir}/build/get-py-info.py --includes`"
     ])
-    SWIG_PY_INCLUDES="\$(SWIG_INCLUDES) $ac_cv_python_includes"
+    PYTHON_INCLUDES="$ac_cv_python_includes"
+    SWIG_PY_INCLUDES="\$(SWIG_INCLUDES) \$(PYTHON_INCLUDES)"
 
     if test "$ac_cv_python_includes" = "none"; then
       AC_MSG_WARN([python bindings cannot be built without distutils module])
@@ -222,6 +223,7 @@
       AC_MSG_RESULT([$SWIG_RB_TEST_VERBOSE])
   fi
   AC_SUBST(SWIG)
+  AC_SUBST(PYTHON_INCLUDES)
   AC_SUBST(SWIG_PY_INCLUDES)
   AC_SUBST(SWIG_PY_COMPILE)
   AC_SUBST(SWIG_PY_LINK)
Index: build.conf
--- a/build.conf
+++ b/build.conf
@@ -348,7 +348,7 @@
 type = swig
 path = subversion/bindings/swig
 sources = svn_client.i
-libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
+libs = libsvn_swig_py$(PYVER) libsvn_swig_perl libsvn_swig_ruby
        libsvn_client libsvn_subr apr
 nonlibs = swig_core
 description = Subversion client library bindings
@@ -357,7 +357,7 @@
 type = swig
 path = subversion/bindings/swig
 sources = svn_delta.i
-libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
+libs = libsvn_swig_py$(PYVER) libsvn_swig_perl libsvn_swig_ruby
        libsvn_delta libsvn_subr
 nonlibs = swig_core
 description = Subversion delta library bindings
@@ -366,7 +366,7 @@
 type = swig
 path = subversion/bindings/swig
 sources = svn_fs.i
-libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
+libs = libsvn_swig_py$(PYVER) libsvn_swig_perl libsvn_swig_ruby
        libsvn_fs libsvn_subr
 nonlibs = swig_core
 description = Subversion FS library bindings
@@ -375,7 +375,7 @@
 type = swig
 path = subversion/bindings/swig
 sources = svn_ra.i
-libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
+libs = libsvn_swig_py$(PYVER) libsvn_swig_perl libsvn_swig_ruby
        libsvn_ra libsvn_subr
 nonlibs = swig_core
 description = Subversion RA library bindings
@@ -384,7 +384,7 @@
 type = swig
 path = subversion/bindings/swig
 sources = svn_repos.i
-libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
+libs = libsvn_swig_py$(PYVER) libsvn_swig_perl libsvn_swig_ruby
        libsvn_repos libsvn_subr
 nonlibs = swig_core
 description = Subversion repository library bindings
@@ -393,7 +393,7 @@
 type = swig
 path = subversion/bindings/swig
 sources = svn_wc.i
-libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
+libs = libsvn_swig_py$(PYVER) libsvn_swig_perl libsvn_swig_ruby
        libsvn_wc libsvn_subr
 nonlibs = swig_core
 description = Subversion WC library bindings
@@ -402,13 +402,13 @@
 type = swig
 path = subversion/bindings/swig
 sources = core.i
-libs = libsvn_swig_py libsvn_swig_perl libsvn_swig_ruby
+libs = libsvn_swig_py$(PYVER) libsvn_swig_perl libsvn_swig_ruby
        libsvn_delta libsvn_diff libsvn_subr apr
 description = Subversion core library bindings
 include-runtime = yes
 
 # SWIG utility library for Python modules
-[libsvn_swig_py]
+[libsvn_swig_py$(PYVER)]
 type = swig_lib
 lang = python
 path = subversion/bindings/swig/python/libsvn_swig_py
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-08 17:40:47 CEST

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