Bundle ArdourSans with packages
[ardour.git] / tools / update_fluidsynth.sh
1 #!/bin/sh
2
3 if ! test -f wscript || ! test -d gtk2_ardour || ! test -d libs/fluidsynth/;then
4         echo "This script needs to run from ardour's top-level src tree"
5         exit 1
6 fi
7
8 if test -z "`which rsync`" -o -z "`which git`"; then
9         echo "this script needs rsync and git"
10         exit 1
11 fi
12
13 ASRC=`pwd`
14 set -e
15
16 TMP=`mktemp -d`
17 test -d "$TMP"
18 echo $TMP
19
20 trap "rm -rf $TMP" EXIT
21
22 cd $TMP
23 #git clone git://git.code.sf.net/p/fluidsynth/code-git fs-git
24 git clone git://github.com/FluidSynth/fluidsynth.git fs-git
25
26 cd fs-git;
27 git describe --tags
28 git log | head
29 cd $TMP
30
31 FSR=fs-git/
32
33 rsync -auc --info=progress2 \
34         ${FSR}src/midi/fluid_midi.c \
35         ${FSR}src/midi/fluid_midi.h \
36         ${FSR}src/rvoice/fluid_adsr_env.c \
37         ${FSR}src/rvoice/fluid_adsr_env.h \
38         ${FSR}src/rvoice/fluid_chorus.c \
39         ${FSR}src/rvoice/fluid_chorus.h \
40         ${FSR}src/rvoice/fluid_iir_filter.c \
41         ${FSR}src/rvoice/fluid_iir_filter.h \
42         ${FSR}src/rvoice/fluid_lfo.c \
43         ${FSR}src/rvoice/fluid_lfo.h \
44         ${FSR}src/rvoice/fluid_phase.h \
45         ${FSR}src/rvoice/fluid_rev.c \
46         ${FSR}src/rvoice/fluid_rev.h \
47         ${FSR}src/rvoice/fluid_rvoice.c \
48         ${FSR}src/rvoice/fluid_rvoice_dsp.c \
49         ${FSR}src/rvoice/fluid_rvoice_event.c \
50         ${FSR}src/rvoice/fluid_rvoice_event.h \
51         ${FSR}src/rvoice/fluid_rvoice.h \
52         ${FSR}src/rvoice/fluid_rvoice_mixer.c \
53         ${FSR}src/rvoice/fluid_rvoice_mixer.h \
54         ${FSR}src/sfloader/fluid_defsfont.c \
55         ${FSR}src/sfloader/fluid_defsfont.h \
56         ${FSR}src/sfloader/fluid_samplecache.c \
57         ${FSR}src/sfloader/fluid_samplecache.h \
58         ${FSR}src/sfloader/fluid_sffile.c \
59         ${FSR}src/sfloader/fluid_sffile.h \
60         ${FSR}src/sfloader/fluid_sfont.c \
61         ${FSR}src/sfloader/fluid_sfont.h \
62         ${FSR}src/synth/fluid_chan.c \
63         ${FSR}src/synth/fluid_chan.h \
64         ${FSR}src/synth/fluid_event.c \
65         ${FSR}src/synth/fluid_event.h \
66         ${FSR}src/synth/fluid_gen.c \
67         ${FSR}src/synth/fluid_gen.h \
68         ${FSR}src/synth/fluid_mod.c \
69         ${FSR}src/synth/fluid_mod.h \
70         ${FSR}src/synth/fluid_synth.c \
71         ${FSR}src/synth/fluid_synth.h \
72         ${FSR}src/synth/fluid_synth_monopoly.c \
73         ${FSR}src/synth/fluid_tuning.c \
74         ${FSR}src/synth/fluid_tuning.h \
75         ${FSR}src/synth/fluid_voice.c \
76         ${FSR}src/synth/fluid_voice.h \
77         ${FSR}src/utils/fluid_conv.c \
78         ${FSR}src/utils/fluid_conv.h \
79         ${FSR}src/utils/fluid_conv_tables.h \
80         ${FSR}src/utils/fluid_hash.c \
81         ${FSR}src/utils/fluid_hash.h \
82         ${FSR}src/utils/fluid_list.c \
83         ${FSR}src/utils/fluid_list.h \
84         ${FSR}src/utils/fluid_ringbuffer.c \
85         ${FSR}src/utils/fluid_ringbuffer.h \
86         ${FSR}src/utils/fluid_settings.c \
87         ${FSR}src/utils/fluid_settings.h \
88         ${FSR}src/utils/fluidsynth_priv.h \
89         ${FSR}src/utils/fluid_sys.c \
90         ${FSR}src/utils/fluid_sys.h \
91         \
92         "$ASRC/libs/fluidsynth/src/"
93
94 rsync -auc --info=progress2 \
95         --exclude fluidsynth.h \
96         ${FSR}include/fluidsynth/event.h  \
97         ${FSR}include/fluidsynth/gen.h  \
98         ${FSR}include/fluidsynth/log.h \
99         ${FSR}include/fluidsynth/midi.h \
100         ${FSR}include/fluidsynth/misc.h  \
101         ${FSR}include/fluidsynth/mod.h \
102         ${FSR}include/fluidsynth/settings.h \
103         ${FSR}include/fluidsynth/sfont.h \
104         ${FSR}include/fluidsynth/synth.h \
105         ${FSR}include/fluidsynth/types.h \
106         ${FSR}include/fluidsynth/voice.h \
107         \
108         "$ASRC/libs/fluidsynth/fluidsynth/"
109
110 cd "$ASRC"
111 ## 1st: apply patch below, fix up any merge-conflicts and git commit the result.
112 ## 2nd run (after commiting the new version): re-create the patch to upstream & amend:
113 # git diff -R libs/fluidsynth/ > tools/fluid-patches/ardour_fluidsynth.diff
114 #exit
115 patch -p1 < tools/fluid-patches/ardour_fluidsynth.diff
116
117 # auto-generated files
118 cp tools/fluid-patches/fluid_conv_tables.c  libs/fluidsynth/src/
119 cp tools/fluid-patches/fluid_rvoice_dsp_tables.c  libs/fluidsynth/src/