Getting source code with Subversion

1.  Introduction

Subversion (SVN) allows multiple people to work on code development at one time. You can get a lot more information on Subversion and/or download the code from its home page. We strongly recommend that you read the documentation and the Subversion FAQ.

People who belong to the GIT religion please look here.

2.  Modules

There are two active modules in the current Subversion repository:

lyx-devel
This repository hosts the LyX source code. The development of the forthcoming major release takes place in trunk and the minor (maintenance) releases are prepared in branches. The forthcoming stable version resides in the most recent branches/BRANCH_X_X_X directory.
www-user
This repository holds some contents of our www pages (www.lyx.org).

While they are not in use anymore, these ones are kept for their historical interest:

lyx-tests
This repository contains various .lyx files that may be useful for testing purposes.
lyx-1_0_x
This is the old stable release branch. No more work is being done on this branch.
lyx
This is the old and unstable development branch, and is not in use anymore.
www-devel
This used to hold the developer www pages. The contents has been merged into subdirectory devel of www-user
lyxdoc
Documentation for LyX 1.3.x is kept here (in the BRANCH_1_3_X branch) and folded in to the doc directory before release. It is not used anymore for the main trunk, since the documentation has been moved in the lyx-devel module.

3.  Trac source browser

Using SVN, you can download a whole module with just one command. If you want to look at just one SVN file, consider using Trac source browser. Trac is a tool that allows, among other things, for browsing an SVN repository and gives the possibility to browse diffs between arbitrary versions as well as reading log files and the like.

The Trac source browser for the LyX SVN repository is at the LyX home page. Most probably, though, you want to download a whole module. If so, read on.

4.  Anonymous SVN login

From within the directory where you want to place your local copy of the sources, do:

 svn co svn://svn.lyx.org/lyx/lyx-devel/trunk lyx-devel

This will make a directory lyx-devel and download lots of files into that directory. (A fresh copy will need about 150MB. However, depending on which frontends you are compiling, you will need a lot more space for the compiled version, up to 800MB).

Of course you can say svn co svn://svn.lyx.org/lyx/www-user/trunk www-user instead, depending on which module you'd like to download.

5.  After the first download

If the code is updated, just cd to the lyx-devel directory and say:

 svn update

This will magically download or patch only those files which have been changed or added, saving you (and the server) lots of time.

If you just want to check what's changed in your local copy as opposed to the repository, do:

 svn status

If you want to check what's changed on the server, but not yet updated to your local copy, do:

 svn status -u

6.  Compiling the source

Just follow the directions in INSTALL, as if you had downloaded a tar file. For the stable module, this is pretty much just ./autogen.sh, ./configure, make, and sudo make install.

If you want to compile and run the development module, things are somewhat more complicated than for the release module. You're going to need automake, autoconf, and gettext, which can be downloaded from your favorite GNU ftp site. (Start at gnu.org to find a mirror.) Once you've installed all of that stuff, just run the autogen.sh script written by Allan Rae, which will do things in the right order, and then tell you to run configure and make.


7.  Changing the source

We strongly support any creative impulses you may have. Bug fixes, documentation, and new features will always be looked at carefully, and will usually be accepted, with a number of exceptions. New features will rarely be accepted for the stable release version.

If you'd like to make changes to LyX, it will make everyone's life easier if you change the latest SVN sources rather than the latest release. Here's a quick rundown of what you would do:

  • Get the latest version of the source with svn update. A patch to old sources will be much harder to apply, and is therefore more likely to be ignored.
  • Change the files. (Either edit in place or copy them to somewhere else, edit them, and then copy them back to wherever you keep the SVN tree.)
  • Run svn diff > mypatch.diff to create a patch
  • send the patch to the LyX developers' mailing list.

8.  Write access via ssh

If you find yourself creating lots of patches that the LyX team incorporates into the code, you may be granted SVN access. In that case, your life becomes even easier. Instead of the above anonymous login, you can checkout the sources with

 svn co svn://svn.lyx.org/lyx/lyx-devel/trunk lyx-devel

Then you just run a svn commit to check changes in to the Subversion tree, instead of creating a patch and mailing it in. In the first time you will be asked for the username and password, for the next sessions subversion will save them for your convenience (this can be disabled on demand).

The non-wiki content of the LyX Home Page (e.g. the news and the announcements) is also under Subversion. It's probably not worth downloading unless you have write access, of course. It resides in the www-user module.

9.  SVN Branches

The main development in LyX is done in SVN branches. If you are interested in helping develop or test work on these branches, you can check out a copy with a command like:

 svn co svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X lyx-1.6.x
Branch NameMaintainerStatusComment
trunkJMatosunstableMain Branch
BRANCH_1_6_XJSpitzmstableStable 1.6 series branch

There are also some older obsolete branches:

Branch NameMaintainerStatusComment
BRANCH_1_5_XJSpitzmstableStable 1.5 series branch
BRANCH_1_4_XJMarcstableStable 1.4 series branch
BRANCH_1_3_XJMarcstableStable 1.3 series branch
BRANCH-1_2_XJMarcstableStable 1.2 series branch
BRANCH_1_1_6JMarcstableStabilizing of 1.1.6