Author: futatuki
Date: Wed Apr  1 21:07:14 2020
New Revision: 1876016

URL: http://svn.apache.org/viewvc?rev=1876016&view=rev
Log:
Explain SWIG is needed for building Python 2 bindings.

Since Subversion distibution 1.14.0 and later will ship with SWIG Python
bindings *.c source code for Python 3, clarify *.c source files for Python 2
and Python 3 are different and incompatible, and describe how to clear
incompatible intermediate files.

* subversion/bindings/swig/INSTALL
 (STATUS OF THE SWIG BINDINGS):
  Add explanation about supported Python version and distribution tarball.
 (BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 1):
  Add new case that SWIG is needed for Python 2 bindings.
 (BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 2):
  Update Python and perl version in commadline example. 
 (BUILDING SWIG BINDINGS FOR SVN ON UNIX Step 3):
  Insert optional step to clear intermediate files previously generated.
 (everywhere) Strip trailing white space in the end of line.

Modified:
    subversion/trunk/subversion/bindings/swig/INSTALL

Modified: subversion/trunk/subversion/bindings/swig/INSTALL
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/INSTALL?rev=1876016&r1=1876015&r2=1876016&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/INSTALL (original)
+++ subversion/trunk/subversion/bindings/swig/INSTALL Wed Apr  1 21:07:14 2020
@@ -5,7 +5,12 @@ STATUS OF THE SWIG BINDINGS
 * Python
 
   The Python bindings are fairly well developed, although there are some
-  missing parts.
+  missing parts. We support both of Python 2.7 and Python 3.x, but you
+  can't install SWIG Python bindings for multiple version of Python
+  in the same environment, because they need to install mutually
+  incompatible C shared library in same name.  We are now shipping
+  distribution tarball with C source files for Python 3 bindings
+  generated by SWIG.
 
   (N.B. As discussed below, they will not compile in Debug mode on Windows.)
 
@@ -67,11 +72,13 @@ BUILDING SWIG BINDINGS FOR SVN ON UNIX
 Step 1: [Optional] Install a suitable version of SWIG
 
     * SWIG installation is optional.  You do not need to install SWIG
-      if you are using a Subversion distribution tarball because it
-      already contains the source files generated by SWIG.  You will
-      need a suitable version of SWIG if you are using a working copy
-      of Subversion's sources checked out from the repository, or if
-      you want to regenerate the SWIG language bindings.
+      if you are using a Subversion distribution tarball except Python
+      bindings for Python 2 because it already contains the source files
+      generated by SWIG.  The Python bindings source file in the distribution
+      tarball is only for Python 3.  You will need a suitable version of
+      SWIG if you are using a working copy of Subversion's sources checked
+      out from the repository, or if you want to generate the SWIG
+      language bindings C source files by yourself.
 
     * We currently support SWIG versions 2.0.0 and later, with the
       following notes:
@@ -128,7 +135,7 @@ Step 1a: Install py3c library if buildin
 
     * This is a header-only library, so no configuring or compiling is
       necessary, simply 'make install'.
-      
+
 
 Step 2:  Build and Install Subversion.
 
@@ -141,7 +148,7 @@ Step 2:  Build and Install Subversion.
   python executable you used to configure SWIG as above.  If it does not then
   you can specify the correct path by adding PYTHON=/path/to/python or
   PERL=/path/to/perl onto the command line for configure.  For example:
-       ./configure PYTHON=/usr/bin/python2.7 PERL=/usr/bin/perl5.8.0
+       ./configure PYTHON=/usr/bin/python3.7 PERL=/usr/bin/perl5.28.2
 
   If Subversion's ./configure finds a SWIG that it's happy with, then
   it will build special glue libraries to link svn to the swig bindings:
@@ -153,17 +160,24 @@ Step 3:  Install Specific Language Bindi
 
 *  Python
 
-   1.  Run 'make swig-py' from the top of the Subversion build tree,
+   1.  (Optional) If you want to build Python bindings for other version of
+       Python than target of previously built bindings C sources (e.g.
+       using Subversion distribution tarball but want to build Python 2
+       bindings), run 'make clean-swig-py' from the top of the Subversion
+       build tree, to ensure not to use incompatible version of bindings
+       source files.
+
+   2.  Run 'make swig-py' from the top of the Subversion build tree,
        to build the bindings.
 
        (This will invoke SWIG on the *.i files, resulting in a collection
        of .c source files.  It will then compile and link those .c files into
        Python libraries.)
 
-   2.  Run 'make check-swig-py' from the top of the Subversion build
-       tree, to test the bindings 
+   3.  Run 'make check-swig-py' from the top of the Subversion build
+       tree, to test the bindings
 
-   3.  Run 'make install-swig-py' (as root, typically)
+   4.  Run 'make install-swig-py' (as root, typically)
        from the top of the Subversion build tree.  This will copy
        your new Python libraries into the appropriate system location.
 
@@ -177,14 +191,14 @@ Step 3:  Install Specific Language Bindi
        example of doing this for building rpms looks like
        'make install-swig-py DESTDIR=$RPM_BUILD_ROOT/usr'.
 
-   4.  Make sure that whatever directory the bindings got installed in
+   5.  Make sure that whatever directory the bindings got installed in
        is in your Python search path.  That directory depends on how you
        installed; a typical location is /usr/local/lib/svn-python/.
 
        There are several ways to do this. See Python's documentation for
        'sys.path' and 'PYTHONPATH'. A nice way to do this is:
        $ echo /usr/local/lib/svn-python \
-           > /usr/lib/python2.x/site-packages/subversion.pth
+           > /usr/lib/python3.x/site-packages/subversion.pth
 
        You may also need to update your operating system's dynamic linker
        configuration to enable Python to load these new libraries. On some
@@ -202,7 +216,7 @@ Step 3:  Install Specific Language Bindi
    1.  Run `make swig-pl' from the top of the Subversion build tree.
 
    2.  Run `make check-swig-pl' from the top of the Subversion build
-       tree, to test the bindings 
+       tree, to test the bindings
 
    3.  to install run `make install-swig-pl' from the top of the
        Subversion build tree.
@@ -214,9 +228,9 @@ Step 3:  Install Specific Language Bindi
 
    2.  Run `make install-swig-pl-lib'
 
-   3.  cd subversion/bindings/swig/perl/native 
+   3.  cd subversion/bindings/swig/perl/native
 
-   4.  Run `perl Makefile.PL EXTRAOPTIONSHERE` 
+   4.  Run `perl Makefile.PL EXTRAOPTIONSHERE`
 
    5.  Run `make install'
 
@@ -226,21 +240,21 @@ Step 3:  Install Specific Language Bindi
 
 
 * Ruby
-  
+
    1. Run `make swig-rb' from the top of the Subversion build tree,
       to build the bindings.
 
    2. Run `make check-swig-rb' from the top of the Subversion build
       tree, to test the bindings.
 
-   3. To install, run `make install-swig-rb' from the top of the 
+   3. To install, run `make install-swig-rb' from the top of the
       Subversion build tree.
 
-   You can specify the ruby binary by passing RUBY=/path/to/ruby as part 
-   of the configure command in the top level of the Subversion source 
-   tree. Make sure that the Ruby version used is the same one that you 
-   configured SWIG to run against during the SWIG configure (see above). 
-   
+   You can specify the ruby binary by passing RUBY=/path/to/ruby as part
+   of the configure command in the top level of the Subversion source
+   tree. Make sure that the Ruby version used is the same one that you
+   configured SWIG to run against during the SWIG configure (see above).
+
 
 BUILDING SWIG BINDINGS FOR SVN ON WINDOWS
 
@@ -260,7 +274,7 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOW
 
        If you plan to build python bindings, you will also need to download and
        extract the py3c library from https://github.com/encukou/py3c/releases.
-       
+
        NOTE: Our Python SWIG bindings will currently NOT compile in Debug mode
              unless you have python24_d.lib (which binary distributions of
              Python do not contain).  Therefore, the Python bindings will only
@@ -276,9 +290,9 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOW
        Example:
 
         > gen-make.py <other options> --with-swig="C:\Program Files\SWIG-2.0.2"
-        
+
        If you are building python bindings, point to the py3c directory as 
well:
-       
+
         > gen-make.py <other options> --with-swig="C:\Program 
Files\SWIG-2.0.2" \
                                       --with-py3c="C:\SVN\py3c"
 
@@ -364,12 +378,12 @@ TESTING SWIG BINDINGS
 *  Perl
 
    The Perl bindings are using the standard module testing facilities
-   to do regression tests. Simply run 'make check-swig-pl' as described in 
+   to do regression tests. Simply run 'make check-swig-pl' as described in
    the install section.
 
 *  Ruby
 
-   To test the Ruby bindings, simply run `make check-swig-rb' as described 
+   To test the Ruby bindings, simply run `make check-swig-rb' as described
    in the install section.
 
 


Reply via email to