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. By default the
system copy is prefered over this one, even on OS X (where it is shipped by
default). Build against system 2.0.1 works fine.
Version in Audacity SVN: 1.2
Patches: None
Upstream version: 2.0.1

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.

id3lib
------
disused?

libflac
-------
http://flac.sourceforge.net/
Free Lossless Audio Codec encoding and decoding library
Version in Audacity SVN: 1.2.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
	gcc-4.3-includes.patch. Patch from gentoo to fix includes needed for
		GCC 4.3. Already included in upstream CVS
	asm-textreloc.patch. Patch from Gentoo to avoid text relocations is
		the assembly optimisations. In upstream CVS
	asneeded.patch. Add LDFLAGS needed for non-glibc systems. Taken from Gentoo.
	flac-lite.diff. Remove all the things not included in Audacity SVN from
		the build system so it will build with 50% less stuff
Upstream version: 1.2.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

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
kFreeBSD-nyquist.patch	Patch from Benjamin Drung to build nyquist on
						kFreeBSD. Asked him to send it upstream 2009/08/22
hurd-nyquist.patch      Patch from Benjamin Drung to build nyquist on HURD.
                        Asked him to send it upstream 2009/12/05.

libogg
------
library to handle Xiph.org's open multimedia container format
Version in Audacity SVN: 1.1.3
Patches: None, except docs build disabled in Makefile.am
/usr/share/aclocal/libtool.m4 copied to acinclude.m4 (working round not having
an m4 directory in the package for libtool files)
Upstream Version: 1.3.0

libresample
-----------
Audio sample rate conversion library. Maintained by Audacity project. 
(Depreciated in favour of libsoxr)

libsamplerate
-------------
Erik de Castro Lopo's high quality sample rate conversion library. Not used
in release builds, could probably be removed altogther except for comparision
purposes.
Version in Audacity SVN: 0.1.7
Patches: endian.m4, lrint.m4, llrint.m4, lrintf.m4, clip_mode.m4 copied from
			libsndfile's M4/.
		 signal.m4 created out of the tail of acinclude.m4 with the remaining
		 	necessary macro
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
by default
Upstream Version: 0.1.8

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.

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.0.5
Patches: 
   * "libsoxr/configure" file: modified cmake params
   * modified .vcproj file in win\Projects\libsoxr

Upstream Version: 0.0.5 (although no file downloads are available yet)

libvamp
-------
Library to load and use VAMP plug-ins. http://www.vamp-plugins.org/
Version in Audacity SVN: 2.0
Patches: optional-progs.patch: Make building the Vamp host (and so the
dependecy on libsndfile) optional rather than mandatory. Accepted upstream.
		 distclean.patch: ensure that distclean actually works and takes away
		 auto* droppings. Accepted upstream.
Upstream Version: 2.4

libvorbis
---------
library for endcoding and decoding Xiph.org's high-quality compressed audio
format.
Version in Audacity SVN: 1.2.0
Patches: local-libogg.patch: configure patch that lets us build against a
local libogg if there isn't a system one.
no-docs-examples.patch: disable building documentation and examples, so we can
avoid shipping the files in those directories
Upstream Version: 1.3.3

liblrdf
-------
Patches:
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
by default


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

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

portaudio
---------
http://portaudio.com/
cross-platform audio I/O library version 18, used for 1.2.x version of
Audacity.
Quite heavily patched local copy to get AC-97 ALSA cards to play back
correctly.

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-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

portsmf
-------
http://portmedia.sourceforge.net/
Cross-platform Midi file reader and writer (succeeded and obsoltes allegro)
Version in Audacity SVN: SVN snapshot from ????
Patches:
portsmf-includes.patch	add include of <cstring> needed to compile with recent
						GCC versions
portsmf-string-const.patch	Add string const qualifiers as needed
local-macros.patch		Add all the necessary 3rd party m4 macros into autotools
						/m4/ and supporting changes.
unsigned-const-casts.patch	Build fix for Solaris compiler, adds casts to
						unsigned integer literals.
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
by default
All patches have been added to upstream patch tracker at
https://sourceforge.net/tracker2/?group_id=196750&atid=958711


portburn
--------
Doesn't do anything yet

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

redland
-------
http://librdf.org
RDF parser and query engine. Consists of three separate libraries, Raptor
(the parser), Rasqal (the query engine) and librdf (triple storage and
wrapper API). It is needed for liblrdf and SLV2.
Version in Audacity SVN: 1.0.8
Patches:
audacity_build_tweaks.patch	Patches the configure scripts to turn off parsers, storage models and query languages not used by Audacity as well as using Expat instead of libxml2 for XML parsing. No need to integrate with upstream.

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: ??
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.

slv2
-------
http://wiki.drobilla.net/SLV2
Support library for LV2 hosts (like Audacity).
Version in Audacity SVN: 0.6.0
Patches:
audacity_build_tweaks.patch	Patches the configure scripts to not build hosts and utility programs and to use local Redland libraries if requested. No need to integrate with upstream.
lv2core_internal.patch		Add lv2.h as an internal header to avoid the dependency on lv2core.
i18n.patch					Patch to support translation of some form?
AM_MAINTAINER_MODE has been added to configure.ac to disable autotools rebuilds
by default

soundtouch
----------
http://www.surina.net/soundtouch/
Independant Pitch and Tempo changing library.
Version in Audacity SVN: 1.3.1
Patches:
PPC mac build changes to configure.in in several places
correct-const-usage.patch: makes usage of const keyword consistent so it
compiles with Sun's C++ compiler. Patch sent upstream 17/03/2008
fix-includes.patch: needed for GCC 4.3.1 to include all the headers we use
directly. In upstream SVN
Argument ([-Wall foreign]) added to AM_INIT_AUTOMAKE because autoreconf fails
otherwise
Upstream Version: 1.7.1

taglib
------
http://developer.kde.org/~wheeler/taglib.html
svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib
Audio Meta-Data Library
Version in Audacity SVN: svn revision 924567 (post 1.5)
Patches: none

If replacing via svn, you need to do the following to generate the configure
scripts (from within the base taglib directory):
   sh admin/cvs.sh dist

And remove the .svn directories (from within the base taglib direcotry):
   find -d . -path \*/.svn\* -exec rm -rf \{\} \;

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

wave++
------
http://www.scs.ryerson.ca/~lkolasa/CppWavelets.html
disused?

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 loose
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.
