summaryrefslogtreecommitdiff
path: root/subversion/bindings/swig/INSTALL
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/bindings/swig/INSTALL')
-rw-r--r--subversion/bindings/swig/INSTALL112
1 files changed, 83 insertions, 29 deletions
diff --git a/subversion/bindings/swig/INSTALL b/subversion/bindings/swig/INSTALL
index 751a5c4..207b73f 100644
--- a/subversion/bindings/swig/INSTALL
+++ b/subversion/bindings/swig/INSTALL
@@ -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; however,
+ SWIG Python bindings for different versions of Python cannot be
+ simultaneously installed in the same environment, because they need to
+ install mutually incompatible C shared libraries under the same name. The
+ distribution tarballs are shipped with SWIG-generated C source files for
+ Python 3.x.
(N.B. As discussed below, they will not compile in Debug mode on Windows.)
@@ -64,15 +69,36 @@ STATUS OF THE SWIG BINDINGS
BUILDING SWIG BINDINGS FOR SVN ON UNIX
-Step 1: Install a suitable version of SWIG (which is
- currently SWIG version 1.3.24 or later).
-
- * Perhaps your distribution packages a suitable version - if it does
- install it, and skip to the last bullet point in this section.
+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; if you want to generate the SWIG
+ language bindings C source files by yourself; or if you want to build
+ Python 2.x bindings (since the SWIG-generated C source files in the
+ distribution tarballs target Python 3.x).
+
+ * We currently support SWIG versions 2.0.0 and later, with the
+ following notes:
+ - SWIG 1.3.24 and later 1.3.x may work, but we do not test these
+ versions on our latest source code.
+ - For Python 2 bindings, SWIG 4.0.0 or later is not supported.
+ - For Python 3 bindings, SWIG 3.0.10 or later is required.
+ - Note that SWIG 3.0.9 has some trouble with Python support.
+ (See https://sourceforge.net/p/swig/news/2016/06/swig-3010-released/)
+ - For Perl 5.16 and later, SWIG 2.0.8 or later is required.
+ - For Ruby bindings, SWIG 3.0.8 is not supported.
+
+ * Perhaps your distribution packages a suitable version of SWIG.
+ If so, install it and skip to the last bullet point of this
+ section.
* Go to http://www.swig.org/, download the source tarball, and unpack.
- * In the SWIG-1.3.xx directory, run ./configure.
+ * In the swig-x.y.z, directory, run ./configure (where x.y.z is
+ SWIG version, e.g., 3.0.12).
If you plan to build the Python bindings, and have a system
with more than one version of Python installed, you may need
@@ -95,8 +121,21 @@ Step 1: Install a suitable version of SWIG (which is
Run 'make && make install'
* To verify you have SWIG installed correctly, run "swig -version"
- from the command line. SWIG should report that it is version 1.3.24
- or newer.
+ from the command line. SWIG should report that it is one of the
+ suitable versions mentioned above.
+
+
+Step 1a: Install py3c library if building Python SWIG bindings.
+
+ * Check your distribution packages first for a suitable version, and
+ if found install from there.
+
+ * To install from source, download the latest release from
+ https://github.com/encukou/py3c.
+
+ * This is a header-only library, so no configuring or compiling is
+ necessary, simply 'make install'.
+
Step 2: Build and Install Subversion.
@@ -109,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:
@@ -121,17 +160,24 @@ Step 3: Install Specific Language Bindings
* Python
- 1. Run 'make swig-py' from the top of the Subversion build tree,
+ 1. (Optional) If you want to build Python bindings for a version of
+ Python than other than that the prebuilt bindings C sources target
+ (e.g., if you use the 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.
@@ -145,14 +191,14 @@ Step 3: Install Specific Language Bindings
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
@@ -170,7 +216,7 @@ Step 3: Install Specific Language Bindings
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.
@@ -182,9 +228,9 @@ Step 3: Install Specific Language Bindings
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'
@@ -194,21 +240,21 @@ Step 3: Install Specific Language Bindings
* 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
@@ -226,6 +272,9 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOWS
http://www.python.org/
http://www.activestate.com/ActivePerl/
+ 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
@@ -242,6 +291,11 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOWS
> 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"
+
4. If you haven't already built Subversion, you should do so now.
Instructions are in the main INSTALL file.
@@ -324,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.
@@ -361,7 +415,7 @@ USING SWIG BINDINGS
sample/demo programs found in tools/examples/ in the Subversion
source code tree. Additionally, there are several third-party
tools that make use of these bindings, including ViewVC
- (http://viewvc.tigris.org/) and Trac (http://trac.edgewall.org/).
+ (http://www.viewvc.org/) and Trac (https://trac.edgewall.org/).
* Perl