This is intended as a list of all the patches that have been incorporated into
the lib-src copies of libraries, to avoid them getting lost in version upgrades
from upstream, and to remind us of the versions we are using. See the notes at
the end for how external libraries are brought in and maintained.

Libraries
=========
expat
-----
XML parser library used to parse project files and so on.
Version in Audacity SVN: 2.1.0
Patches: None
Upstream version: 2.1.0

FileDialog
----------
The customised file saving dialogs for wxwidgets to provide the options
button for format preferences. This is written and maintained by us so doesn't
have an upstream at the moment.

libflac
-------
http://flac.sourceforge.net/
Free Lossless Audio Codec encoding and decoding library
Version in Audacity SVN: 1.3.1
Patches: mac-asm-fixes.patch. Fixes build on OS X Intel 10.4 by creating and
            object format for Mach-O. Needs to go upstream
         add-maintainer-mode.patch. Disable autotools rebuilds
         bypass-constraint-problem.patch. Gets around problem with older
            gcc (4.0)...not need after we upgrade past Xcode 3.2.6.
Upstream version: 1.3.1

libid3tag
---------
MP3 tag manipulation library. Comes with libmad (below)
arguments ([-Wall foreign]) added to AM_INIT_AUTOMAKE to avoid autoreconf
failures
arguments (--no-verify) removed from ltconfig execution to prevent configure
failures
Patches: libid3tag-srcdir.patch  Adds srcdir handling

libmad
------
http://www.underbit.com/products/mad/
MP3 decoding library
Version in Audacity SVN: 0.15.1 (beta)
Patches: libmad-mp2-out-of-spec.patch:	Import some forms of MP2 file that are
theoretically out of spec but in practise work fine (msmeyer)
osx-universal-build.patch: Makes build work on OS X for universal binary by
using compiler-defined symbols for targets as well as hosts.
autotools.patch:			Update to autotools to work with recent auto{conf,
make}
Upstream version: 0.15.1 (beta)

libnyquist
----------
Digital Audio scripting language, with our own library interface added to it
Version in Audacity SVN: 3.09
nyquist.patch  Fix for a couple of memory leaks
xlisp.patch    Fix build in Windows
sound.patch    Fix build when using VS2013 (log2 is included in VS2013)
revert-convolve.patch  Replaces broken convolve with previous version

libogg
------
library to handle Xiph.org's open multimedia container format
Version in Audacity SVN: 1.3.1
Patches: autotools.patch: Fix all autotools warnings. configure.in was renamed
                          to configure.ac after applying the patch.
AM_MAINTAINER_MODE has been called with "disable" in configure.ac to disable
autotools rebuilds by default.
Upstream Version: 1.3.1

libsndfile
----------
Erik de Castro Lopo's uncompressed audio file I/O library. Core and essential
to Audacity.
Version in Audacity SVN: 1.0.24
Patches: maintainer-mode.patch: AM_MAINTAINER_MODE added to configure.ac
         id3.patch: already in upstream 1.0.26 (git 41da64d9270b2fa10c93ce74dea014fe8f0bd303)
                    fixes crash when importing mp3s that have duplicated tags
         libsndfile-ppc-crash-on-some-id3-mp3s.patch - submitted to libsndfile
                    list on may 22 2012 (mchinen)
         Add-support-for-Album-and-Track-tags-in-RIFF-files.patch 
                    Add support for Album and Track tags in RIFF files in the LIST chunk of WAV files.
                    0001-Add-support-for-Album-and-Track-tags-in-RIFF-files-for-libsndfile-1.0.24.patch for libsndfile 1.0.24, and
                    0001-Add-support-for-Album-and-Track-tags-in-RIFF-files-for-libsndfile-1.0.25.patch for libsndfile 1.0.25,
                    submitted to libsndfile list on August 19 2012.
         autotools.patch: Fix all autotools warnings.
Upstream Version: 1.0.25

libsoxr
-------
The SoX Resampler library performs one-dimensional sample-rate conversion, 
by Rob Sykes.
http://sourceforge.net/p/soxr/wiki/Home/
Version in Audacity SVN: 0.1.1
Patches: 
   * "libsoxr/configure" file: modified cmake params
   * add-make-check-support.patch: Add a check target for GNU Autotools integration.
   * libsoxr-srcdir.patch: Adds srcdir handling
Upstream Version: 0.1.1

libvamp
-------
Library to load and use VAMP plug-ins. http://www.vamp-plugins.org/
Version in Audacity SVN: 2.5
Patches: fix-linkage-against-dl.patch: Fix linkage against dl for hostsdk library.
         fix-all-target.patch: Fix all target to not build disabled targets.
         libvamp-srcdir.patch: Adds srcdir handling
Upstream Version: 2.5

libvorbis
---------
library for endcoding and decoding Xiph.org's high-quality compressed audio
format.
Version in Audacity SVN: 1.3.3
Patches: autotools.patch: Fix all autotools warnings.
Upstream Version: 1.3.3


lib-widget-extra
----------------

lv2
---------
A merging of the lilv, lv2, msinttypes, serd, sord, sratom, and suil libraries to support
LV2 plug-ins.
Versions in Audacity SVN:
    lilv-0.20.0
    lv2-1.10.0
    msinttypes-r29
    serd-0.20.0
    sord-0.12.2
    sratom-0.4.6
    suil-0.8.2
Patches:
    usegetprocaddress.patch - ticket #923 opened upstream on 10/23/2013
                              fix commited (r5164) upstream on 10/30/2013
    serdnode.patch - Both lilv and serd have a node.c which causes problems during build.
                     This is just a copy of serd/node.c and is a way to work around the
                     problem.
Modifications:
    Run lib-src/lv2/unpack-waf to unpack the waf scripts.
    See http://lintian.debian.org/tags/source-contains-waf-binary.html for details.
Upstream Versions:
    lilv-0.20.0
    lv2-1.10.0
    msinttypes-r29
    serd-0.20.0
    sord-0.12.2
    sratom-0.8.2


mod-script-pipe
---------------

portaudio-v19
-------------
http://portaudio.com/
cross-platform audio I/O library version 19, used for 1.3.2 onwards releases
Version in Audacity SVN: 23rd September 2013 SVN snapshot (revision 1910)
Patches:
../portmixer/portaudio.patch	add features needed to make portmixer work
		Integration by upstream in progress. Will need updating as upstream
		portaudio moves
portaudio-srcdir.patch  Adds srcdir handling
portaudio-v19/wasapi-fix.patch  Patch to WASAPI hostapi that corrects incorrect
reporting of stream open/running/closed state.

portaudio-v19/wasapi-loopback.patch  Patch to add loopback devices to the WASAPI
hostapi.

portaudio-v19/jack.patch  Patch to add JACK support to Windows.

?portaudio/libtool22.patch	Patch from Gentoo to ensure that static libraries
are always built, not shared ones, otherwise the assumptions elsewhere in the
build system break. Not suitable for upstream, what is needed is more
powerfull autoconf features to pass the right options to portaudio's configure
script, which suffers from the broken-ness of autoconf's subdirectory support

portmidi
-------
http://portmedia.sourceforge.net/
PortMidi is a library for software developers. It supports real-time input
and output of MIDI data using a system-independent interface.
Version in Audacity SVN: SVN snapshot from 227
Patches:
Upstream Version: SVN revision 227

portsmf
-------
http://portmedia.sourceforge.net/
Cross-platform Midi file reader and writer (succeeded and obsoletes allegro)
Version in Audacity SVN: SVN snapshot from 227
Patches: autotools.patch: Fix all autotools warnings.
autotools-fix-make-dist.patch: Correct file lists to make dist target work.
Upstream Version: SVN revision 227

portmixer
---------
cross-platform audio mixer control library, hooked onto portaudio. Maintained
by the Audacity project with some help from portaudio development.

sbsms
-----
http://sbsms.sourceforge.net/
An audio stretching library for changing pitch or tempo without changing the
other. Alternative to SoundTouch, better on large changes but slower.
Version in Audacity SVN: 2.0.2
Patches:
Misc fixes to configure.in/Makefile.am for autoconf macros and libtool. More
files added to m4/ directory by libtoolizing commited to Audacity SVN.
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
by default
dont-mangle-cflags.patch	patch to stop sed-ing the CXXFLAGS and achieve the
same ends by better means, replacing a hacked version from Gentoo. Patch
linked to from upstream tracker at
https://sourceforge.net/tracker/index.php?func=detail&aid=2561247&group_id=177794&atid=882654
because attachements there don't seem to work.
autotools.patch: Fix all autotools warnings.
autotools-fix-make-dist.patch: Correct file lists to make dist target work.
sbsms-srcdir.patch: Adds srcdir handling

soundtouch
----------
http://www.surina.net/soundtouch/
Independant Pitch and Tempo changing library.
Version in Audacity SVN: 1.7.1
Patches: autotools.patch: Fix all autotools warnings.
AM_MAINTAINER_MODE([disable]) has been added to configure.ac to disable autotools rebuilds.
Upstream Version: 1.7.1

twolame
-------
http://www.twolame.org/
MPEG I layer 2 audio encoding library used for MP2 exports
Version in Audacity SVN: 0.3.13
Patches: fix-tests.patch: Terminate AM_TESTS_ENVIRONMENT by a semicolon.
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
by default
Upstream Version: 0.3.13

Crib notes on upgrading lib-src trees
=====================================
With extensive reference to
http://svnbook.red-bean.com/en/1.5/svn.advanced.vendorbr.html

This directory (audacity-src/trunk/lib-src/) is the working copy of the
imported libraries, with changes made to them. The current upstream version of
the libraries is imported into the audacity-src/vendor/ tree, which is _not
modified_ except for new imports. The unmodified upstream sources are then
used to merge forward the changes between releases into the
audacity-src/trunk/lib-src/ copy which contains the audacity project changes.

The version of a given <library> in lib-src should be the version from
vendor/<library>/current/ with the audacity changes added in.

1. We will update the vendor branch copy with the new upstream source first,
then merge into the working copy. As always we need a new set of clean source
to import. If pulling from upstream version control, do an export to lose
version control files first.
   svn export -r HEAD https://www.portaudio.com/repos/portaudio/trunk export

2. Use the svn_load_dirs.pl script to upgrade the vendor branch to the new
upstream source (which will deal with adds, deletions and renaming in the
source tree without too much effort). You need to specify a tag name for the
new update (which should reflect the upstream release, in this case an SVN
revision in upstream's repository)
	svn_load_dirs.pl -t r1541 \
	https://audacity.googlecode.com/svn/audacity-src/vendor/portaudio-v19/ \
	current /path/to/newver
Note that the URL excludes the final 'current' section, which is specified
separately in the next argument, with the final one being the path to inside
the directory with the new source in it.

3. Answer the questions as posed by the script (it is interactive). The tag
should be correct as you specfied it in the command. Several temporary SVN
checkouts will be created (in /tmp) and merges done. Deleted and Added files
will be printed (with a pause after each screen). If some of these should
actually be renames (that is, a delete and an addition go together), then
enter the numbers of those two files to sort that out for the script. Getting
this correct makes the merge of changes much less painful.

4. Much churning will occur to update all the files, remove orphans etc. The
new version of the library will now be in vendor/<library>/current/, with a
tag of the given name at vendor/<library>/<tag>/. This will be autotmatically 
committed to SVN by the script.

5. Merge the changes between the previous and current upstream versions into
the lib-src copy used in Audacity using svn merge. Do this from the
audacity-src/lib-src/ directory of a working copy, as you will need to resolve
some conflicts along the way.
svn merge
https://audacity.googlecode.com/svn/audacity-src/vendor/portaudio-v19/r1416 \
https://audacity.googlecode.com/svn/audacity-src/vendor/portaudio-v19/current \
portaudio-v19

6. When prompted with a conflict, most of the time, you want to see the
changes, which you can get with the 'df' (diff full) response. In many cases
the changes may be trivial (e.g. version headers), in which case you can just
choose to use the new version with the 'tf' (theirs full) command.
* For generated files (e.g. configure), accept upstream's version because we
  will re-generate them later.
* If there is a minor conflict, then going to 'e' (edit) will let you clean
  the remaining issues in the file up. Save the file, then 'r' (resolved)
  accepts the updated file.
* Mangled line endings cause a load of grief here, so try to make sure they
  don't happen. SVN shouldn't have trouble with this, provided that the
  svn:eol property is correctly set

7. Check the SVN status output to see what has changed. In particularly, look
for files not under version control and which are, but have been deleted.
svn st | grep '^?'
svn st | grep '^!'
Ideally there shouldn't be any!

8. Do some local updates to help reliable builds (especially if upstream
aren't very good at doing these) 
* If the package uses libtool, run libtoolize --copy --force to update 
	ltmain.sh, config.sub, config.guess. If not, update config.sub,
	config.guess from /usr/share/gnuconfig/
* run autoreconf

9. Build and test the code! Make sure that your merges actually work!

10. Commit to repository - svn commit as usual.

11. To re-generate the patches in the Audacity tree, diff the original in
/vendor/ against the patched version in lib-src/ (you will need to use both
URLs on the server for this to work)

Bringing in a new (or only previously in CVS) library
-----------------------------------------------------
We start out with the svn import command to to all the adding and setting up
for us. We need a set of files to import (for old CVS libs, a set of whatever
was imported last time), without any version control droppings (to get this
from someone else's SVN repository, use
svn export -r <revision> https://wherever <local directory>)

So to push our local folder tree into the vendor branch:
1. Create a directory to put it in the vendor branch
	svn mkdir --parents https://audacity.googlecode.com/svn/audacity-src/vendor/portaudio-v19/current/

2. Do the svn import
	 svn import portaudio/pa-r1416/ https://audacity.googlecode.com/svn/audacity-src/vendor/portaudio-v19/current/ -m 'Import the previous SVN snapshot of portaudio as a base'
  portaudio/pa-r1416/ is the source directory, e.g. an unpacked tarball. Note
  that we don't want the versioned top level directory from the tarball, so we
  give the path including that directory with a trailing slash on it.

3. The import will list the files by their source directory as it goes on and
  commits as part of the import. At the end you should have all the files for
  the library in the
  https://audacity.googlecode.com/svn/audacity-src/vendor/portaudio-v19/current/
  directory.
