~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/bindings/swig/INSTALL

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
                                                                -*-text-*-
 
2
 
 
3
STATUS OF THE SWIG BINDINGS
 
4
 
 
5
* Python
 
6
 
 
7
  The Python bindings are fairly well developed, although there are some
 
8
  missing parts, most notably, there is no useful wrapping of the svn_ra APIs.
 
9
 
 
10
* Perl
 
11
 
 
12
  The Perl bindings are complete, with the exception of SVN::Wc, on which
 
13
  very little work has been done.
 
14
 
 
15
* Ruby
 
16
 
 
17
  The Ruby bindings are a recent development, and are only partially
 
18
  implemented. The Ruby bindings API may change incompatibly as development
 
19
  proceeds. They require SWIG 1.3.24 or later.
 
20
 
 
21
 
 
22
BUILDING SWIG BINDINGS FOR SVN ON UNIX
 
23
 
 
24
 
 
25
Step 1:  Install a suitable version of SWIG (which is
 
26
         currently swig versions 1.3.19 - 1.3.21, or 1.3.24 or above).
 
27
 
 
28
    * Perhaps your distribution packages a suitable version - if it does
 
29
      install it, and skip to the last bullet point in this section.
 
30
 
 
31
    * Go to http://www.swig.org/, download the source tarball, and unpack.
 
32
 
 
33
    * In the SWIG-1.3.xx directory, run ./configure.
 
34
 
 
35
        If you plan to build the python bindings, and have a system
 
36
        with more than one version of python installed, you may need
 
37
        to pass
 
38
 
 
39
             --with-python=/path/to/correct/python/binary
 
40
 
 
41
        to the configure script.  You need Python 2.0 or above.
 
42
 
 
43
        If you plan to build the perl bindings, and have a system
 
44
        with more than one version of perl installed, you may need
 
45
        to pass
 
46
 
 
47
             --with-perl5=/path/to/correct/perl/binary
 
48
 
 
49
        to the configure script.  You need Perl 5.8.0 or above.
 
50
 
 
51
    * Build and install.
 
52
 
 
53
        For SWIG 1.3.24 or above:
 
54
          Run 'make && make install'
 
55
 
 
56
        For SWIG 1.3.19 - 1.3.21:
 
57
          Run 'make && make runtime && make install && make install-runtime'
 
58
 
 
59
    * To verify you have SWIG installed correctly, check that these things
 
60
      were created, assuming your $PREFIX was /usr/local:
 
61
 
 
62
        For SWIG 1.3.24 or above:
 
63
          - /usr/local/bin/swig
 
64
          - /usr/local/share/swig/1.3.xx/ (containing lots of .i files)
 
65
 
 
66
        For SWIG 1.3.19 - 1.3.21:
 
67
          - /usr/local/bin/swig
 
68
          - /usr/local/lib/swig1.3/ (containing lots of .i files)
 
69
          - /usr/local/lib/libswigpy.so (for Python)
 
70
          - /usr/local/lib/libswigpl.so (for Perl)
 
71
 
 
72
          In particular, you want to make sure that
 
73
          libswigpy.so (if you want to use Python) and/or
 
74
          libswigpl.so (if you want to use Perl) was/were built and installed.
 
75
 
 
76
 
 
77
Step 2:  Build and Install Subversion.
 
78
 
 
79
  See Subversion's own INSTALL file for details.
 
80
 
 
81
  Make sure that Subversion's ./configure script sees your installed SWIG!
 
82
  It tries to detect SWIG near the very end of its output.
 
83
 
 
84
  Also make sure that the configure script sees the paths to the perl and/or
 
85
  python executable you used to configure SWIG as above.  If it does not then
 
86
  you can specify the correct path by adding PYTHON=/path/to/python or
 
87
  PERL=/path/to/perl onto the command line for configure.  For example:
 
88
       ./configure PYTHON=/usr/bin/python2.2 PERL=/usr/bin/perl5.8.0
 
89
 
 
90
  If Subversion's ./configure finds a SWIG that it's happy with, then
 
91
  it will build special glue libraries to link svn to the swig bindings:
 
92
    libsvn_swig_py.so (for Python)
 
93
    libsvn_swig_perl.so (for Perl)
 
94
 
 
95
 
 
96
Step 3:  Install Specific Language Bindings
 
97
 
 
98
*  Python
 
99
 
 
100
   1.  Run 'make swig-py' from the top of the Subversion source tree,
 
101
       to build the bindings.
 
102
 
 
103
       (This will invoke SWIG on the *.i files, resulting in a collection
 
104
       of .c source files.  It will then compile and link those .c files into
 
105
       Python libraries.)
 
106
 
 
107
   2.  Run 'make install-swig-py' (as root, typically)
 
108
       from the top of the Subversion source tree.  This will copy
 
109
       your new Python libraries into the appropriate system location.
 
110
 
 
111
       Note: If you don't have access to install to python's site-packages
 
112
       directory, you can have the python modules install to your home
 
113
       directory.  You can do this by running
 
114
       'make install-swig-py swig_pydir=~'.
 
115
 
 
116
       Note: If you want to install to an alternate prefix (usually only
 
117
       if you are building packages), you can supply the prefix here.  An
 
118
       example of doing this for building rpms looks like
 
119
       'make install-swig-py DESTDIR=$RPM_BUILD_ROOT/usr'.
 
120
 
 
121
   3.  Make sure that whatever directory the bindings got installed in
 
122
       is in your PYTHONPATH.  That directory depends on how you
 
123
       installed; a typical location is /usr/local/lib/svn-python/.
 
124
 
 
125
       An nice way to do this is:
 
126
       $ echo /usr/local/lib/svn-python \
 
127
           > /usr/lib/python2.x/site-packages/subversion.pth
 
128
 
 
129
 
 
130
*  Perl
 
131
 
 
132
   Perl 5.8.0 is required.  You can specify the perl binary by passing
 
133
   PERL=/path/to/perl as part of the configure command in the top level
 
134
   of the Subversion source tree.  Make sure that the perl version used
 
135
   is the same one that you configured SWIG to run against during the
 
136
   SWIG configure (see above).
 
137
 
 
138
   1.  Run `make swig-pl' from the top of the Subversion source tree.
 
139
 
 
140
   2.  Run `make check-swig-pl' from the top of the Subversion source
 
141
       tree, to test the bindings 
 
142
 
 
143
   3.  to install run `make install-swig-pl' from the top of the
 
144
       Subversion source tree.
 
145
 
 
146
   If you need to pass extra parameters to perl build process (Makefile.PL),
 
147
   then you need to do this process somewhat different:
 
148
 
 
149
   1.  Run `make swig-pl-lib' from the top of the Subversion source tree.
 
150
 
 
151
   2.  Run `make install-swig-pl-lib'
 
152
 
 
153
   3.  cd subversion/bindings/swig/perl/native 
 
154
 
 
155
   4.  Run `perl Makefile.PL EXTRAOPTIONSHERE` 
 
156
 
 
157
   5.  Run `make install'
 
158
 
 
159
 
 
160
BUILDING SWIG BINDINGS FOR SVN ON WINDOWS
 
161
 
 
162
 
 
163
   1.  Install SWIG. Download the SWIG Windows zipfile (it's the same as the
 
164
       source tarball except that it also includes a copy of swig.exe) from
 
165
 
 
166
           http://www.swig.org/
 
167
 
 
168
       and extract it somewhere, like C:\Program Files.
 
169
 
 
170
   2.  Install whatever languages you want to build runtimes for. Windows
 
171
       versions of Python and Perl are available from:
 
172
 
 
173
           http://www.python.org/
 
174
           http://www.activestate.com/ActivePerl/
 
175
 
 
176
   3.  Configure Visual C++ with paths to swig.exe and language specific
 
177
       libraries. In Visual C++ 6, go to Tools -> Options -> Directories.
 
178
       In Visual C++ .NET, go to Tools -> Options -> Projects 
 
179
       -> VC++ Directories.
 
180
 
 
181
       Add the following paths:
 
182
 
 
183
           Executable Directories:
 
184
 
 
185
               Path to swig.exe
 
186
               (for example, C:\Program Files\SWIG-1.3.19)
 
187
 
 
188
               For Perl, path to perl.exe
 
189
               (for example, C:\Program Files\Perl\bin)
 
190
 
 
191
           Library Directories:
 
192
 
 
193
               For Python, path to python##.lib
 
194
               (for example, C:\Program Files\Python22\libs)
 
195
 
 
196
               For Perl, path to perl##.lib
 
197
               (for example, C:\Program Files\Perl\lib\CORE)
 
198
 
 
199
           Include Directories:
 
200
 
 
201
               For Python, path to Python.h
 
202
               (for example, C:\Program Files\Python22\include)
 
203
 
 
204
               For Perl, path to perl.h
 
205
               (for example, C:\Program Files\Perl\lib\CORE)
 
206
 
 
207
   4.  If you haven't already built Subversion, you should do so now.
 
208
       Instructions are in the main INSTALL file. At the very least,
 
209
       you need to run gen-make.py to generate Visual Studio project
 
210
       files.
 
211
 
 
212
   5.  Build the bindings. Open the Subversion workspace in Visual C++
 
213
       (subversion_msvc.dsw or subversion_vcnet.sln) and build one or more
 
214
       of the following projects:
 
215
 
 
216
           __SWIG_PYTHON__
 
217
           __SWIG_PERL__
 
218
 
 
219
   6. Install the bindings. The procedure varies depending on the language.
 
220
 
 
221
      For Python, create two folders:
 
222
 
 
223
          <PYTHON>\Lib\site-packages\svn
 
224
          <PYTHON>\Lib\site-packages\libsvn
 
225
 
 
226
      Copy subversion\bindings\swig\python\svn\*.py into the svn folder.
 
227
      Copy subversion\bindings\swig\python\*.py and
 
228
      Release\subversion\bindings\swig\python\*.dll into the libsvn folder.
 
229
 
 
230
      Optionally, you can run the following commands to compile the Python
 
231
      sources into bytecode:
 
232
 
 
233
          python <PYTHON>\lib\compileall.py <PYTHON>\Lib\site-packages\svn
 
234
          python <PYTHON>\lib\compileall.py <PYTHON>\Lib\site-packages\libsvn
 
235
 
 
236
      This can make the modules load faster for users without write access
 
237
      to the site-packages directory.
 
238
 
 
239
      For Perl, the bindings have be copied into a more complicated directory
 
240
      structure inside the perl library directory. Running the commands below
 
241
      from the subversion source directory will copy the files to the right
 
242
      places:
 
243
 
 
244
        set PERL_LIBS="C:\Program Files\Perl\site\lib"
 
245
 
 
246
        md %PERL_LIBS%\SVN %PERL_LIBS%\auto\SVN
 
247
        copy subversion\bindings\swig\perl\native\*.pm %PERL_LIBS%\SVN
 
248
 
 
249
        md %PERL_LIBS%\auto\SVN\_Client
 
250
        copy Release\subversion\bindings\swig\perl\_Client.dll %PERL_LIBS%\auto\SVN\_Client
 
251
        copy Release\subversion\bindings\swig\perl\_Client.pdb %PERL_LIBS%\auto\SVN\_Client
 
252
 
 
253
        md %PERL_LIBS%\auto\SVN\_Core
 
254
        copy Release\subversion\bindings\swig\perl\_Core.dll %PERL_LIBS%\auto\SVN\_Core
 
255
        copy Release\subversion\bindings\swig\perl\_Core.pdb %PERL_LIBS%\auto\SVN\_Core
 
256
 
 
257
        md %PERL_LIBS%\auto\SVN\_Delta
 
258
        copy Release\subversion\bindings\swig\perl\_Delta.dll %PERL_LIBS%\auto\SVN\_Delta
 
259
        copy Release\subversion\bindings\swig\perl\_Delta.pdb %PERL_LIBS%\auto\SVN\_Delta
 
260
 
 
261
        md %PERL_LIBS%\auto\SVN\_Fs
 
262
        copy Release\subversion\bindings\swig\perl\_Fs.dll %PERL_LIBS%\auto\SVN\_Fs
 
263
        copy Release\subversion\bindings\swig\perl\_Fs.pdb %PERL_LIBS%\auto\SVN\_Fs
 
264
 
 
265
        md %PERL_LIBS%\auto\SVN\_Ra
 
266
        copy Release\subversion\bindings\swig\perl\_Ra.dll %PERL_LIBS%\auto\SVN\_Ra
 
267
        copy Release\subversion\bindings\swig\perl\_Ra.pdb %PERL_LIBS%\auto\SVN\_Ra
 
268
 
 
269
        md %PERL_LIBS%\auto\SVN\_Repos
 
270
        copy Release\subversion\bindings\swig\perl\_Repos.dll %PERL_LIBS%\auto\SVN\_Repos
 
271
        copy Release\subversion\bindings\swig\perl\_Repos.pdb %PERL_LIBS%\auto\SVN\_Repos
 
272
 
 
273
        md %PERL_LIBS%\auto\SVN\_Wc
 
274
        copy Release\subversion\bindings\swig\perl\_Wc.dll %PERL_LIBS%\auto\SVN\_Wc
 
275
        copy Release\subversion\bindings\swig\perl\_Wc.pdb %PERL_LIBS%\auto\SVN\_Wc
 
276
 
 
277
TESTING AND USING SWIG BINDINGS
 
278
 
 
279
*  Python
 
280
 
 
281
   1.  Verify that an 'svn' package has been installed correctly.  You can
 
282
       do this by running Python via 'python -c "from svn import client"'.
 
283
 
 
284
   2.  Try some demo programs.  From the top of your svn working copy,
 
285
       cd tools/examples/ and try running 'svnlook.py'.
 
286
 
 
287
   3.  Start writing your own scripts. Use the Subversion API definitions
 
288
       and descriptions in:
 
289
 
 
290
           subversion/include/svn_client.h
 
291
           subversion/include/svn_delta.h
 
292
           subversion/include/svn_fs.h
 
293
           subversion/include/svn_ra.h
 
294
           subversion/include/svn_repos.h
 
295
           subversion/include/svn_wc.h
 
296
 
 
297
*  Perl
 
298
 
 
299
   The perl bindings are using the standard module testing facilities
 
300
   to do regression tests. Simply run make check-swig-pl as described in the
 
301
   install section.