archrelease: copy trunk to extra-x86_64
[arch-packages.git] / festival / repos / extra-x86_64 / PKGBUILD
blobade1acc23ca949da3f775b0a38f511b323823467
1 # Maintainer:
2 # Contributor: netcrusher < tobias AT miglix DOT eu >
3 # Contributor: Andrea Scarpino <andrea@archlinux.org>
4 # Contributor: Simo Leone <neotuli@gmail.com>
6 pkgname=festival
7 pkgver=2.5.0
8 pkgrel=4
9 pkgdesc="A general multi-lingual speech synthesis system"
10 arch=(x86_64)
11 url="http://festvox.org/festival/"
12 license=(BSD GPL custom)
13 depends=(perl alsa-lib)
14 options=('!makeflags')
15 source=(http://festvox.org/packed/festival/${pkgver%.*}/festival-$pkgver-release.tar.gz
16         http://festvox.org/packed/festival/${pkgver%.*}/speech_tools-$pkgver-release.tar.gz
17         http://festvox.org/packed/festival/${pkgver%.*}/festlex_CMU.tar.gz
18         http://festvox.org/packed/festival/${pkgver%.*}/festlex_OALD.tar.gz
19         http://festvox.org/packed/festival/${pkgver%.*}/festlex_POSLEX.tar.gz
20         speechconfig.patch
21         festconfig.patch
22         festival-shared-build.patch
23         festival-2.5.0-compile.patch)
24 sha512sums=('529ec3a1780a861074b6070567f3e11cfcc839081f61e078978a491f11eb424bc4d6adf599f073d5571e20f66871b7045df9f9b175a1083d10e8bb02342639b1'
25             '013540a5252efb57633f442143a51bc87aac719dfb46c8f47e750322d19dac9b504f55125462a2ee74a6b0bd2661a63a1fc73a8c3c6d2886e38b136a80447fd7'
26             'c293344020fd3337193303cd5dfb7e2b0a1012770a484d8bccaae921b0c61b75699204bec45fee0db754506d6f1558fd616866cc94e76afcbb85a4dcbcf9542b'
27             'dc7ec5db71ef331f4c4460a741392d548e037369d47080dc734e912aa312bd5c11e66cdcb94bdc4746a3f6c16c0e0294ce159f07b46e350b85c0afab07cc2064'
28             'd7f96621fd98bcd3c84f0188fc6ac5a006e2cbb535279693be3341d51148344360f68e67962f08c4041df1e3527de9b30705b13fb9859ad91e3c804704eb5348'
29             'd48f899826914a94efcf4005d0e029cebd577ad2c4feb3e1af2e094259e9ca5a5829a6b5c08f22900049c6032ade926af159200d55613cc8d4f3d17e579edd3a'
30             'a3d92ae83bf4b55e9bc83469b85eb1540675c3ed06b9bffa8f99a8a0c4fbdb0cb3fc1abe8c8a4fa5b2c22c77d84bbca36b6b2db3ae0e5ef2d7ddfa214a049372'
31             'cd14a06e7eaef8755be08635a6354380c0cd67e533d1ec908413f4096b271c5594c054499d016ec4d255180288a68b55d24b891e06e5d04595e3004f2bb62d49'
32             '1e00f531710eb7bb4d7fcfd48f53a485023d37a068cfc87323df1fcfd8c358ca3dce21e261dfc73c5a9d724da64f60ea4fca46656215e1cc5055d4f038110567')
34 prepare() {
35   patch -Np0 -i speechconfig.patch
36   patch -Np0 -i festconfig.patch
38   # build shared libs - taken from Mageia
39   patch -Np0 -i festival-shared-build.patch
41   patch -p0 -i festival-2.5.0-compile.patch # Fix build (OpenMandriva)
43   # Avoid make failure on making scripts and docs
44   sed -i "s|examples bin doc|examples|" festival/Makefile
47 build() {
48   CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
50   # Build Speech Tools first
51   cd speech_tools
52   ./configure --prefix=/usr --sysconfdir=/etc
53   make OPTIMISE_CXXFLAGS="${CXXFLAGS}" OPTIMISE_CCFLAGS="${CFLAGS}"
55   # Build Festival itself
56   cd ../festival
57   ./configure --prefix=/usr --sysconfdir=/etc
58   make OPTIMISE_CXXFLAGS="${CXXFLAGS}" OPTIMISE_CCFLAGS="${CFLAGS}"
61 package() {
62   # Install Speech Tools first
63   cd speech_tools
64   install -dm755 "$pkgdir"/usr/{bin,lib,include/speech_tools/{,instantiate,ling_class,rxp,sigpr,unix}}
66   #binaries
67   #move binaries over wrappers (FS#7864)
68   for i in $(grep -l 'EST shared script' bin/*); do
69     cp -f main/$(basename $i) bin;
70   done
71   install -m755 -t "$pkgdir"/usr/bin bin/[a-z]*
72   rm -f "$pkgdir"/usr/bin/{est_gdb,est_examples,est_program}
74   #libraries
75   install -m755 -t "$pkgdir"/usr/lib lib/lib*.so.*
76   ln -sf libestbase.so.${pkgver}.1 "$pkgdir"/usr/lib/libestbase.so
77   ln -sf libestools.so.${pkgver}.1 "$pkgdir"/usr/lib/libestools.so
78   ln -sf libeststring.so.1.2 "$pkgdir"/usr/lib/libeststring.so
80   #headers
81   for dir in {.,instantiate,ling_class,rxp,sigpr,unix}; do
82     install -m644 -t "$pkgdir"/usr/include/speech_tools/$dir include/$dir/*.h
83   done
85   # Install Festival itself
86   cd "$srcdir"/festival
88   #binaries
89   install -m755 src/main/festival "$pkgdir"/usr/bin/
90   install -m755 src/main/festival_client "$pkgdir"/usr/bin/
91   install -m755 examples/benchmark "$pkgdir"/usr/bin/
92   install -m755 examples/dumpfeats "$pkgdir"/usr/bin/
93   install -m755 examples/durmeanstd "$pkgdir"/usr/bin/
94   install -m755 examples/latest "$pkgdir"/usr/bin/
95   install -m755 examples/make_utts "$pkgdir"/usr/bin/
96   install -m755 examples/powmeanstd "$pkgdir"/usr/bin/
97   install -m755 examples/run-festival-script "$pkgdir"/usr/bin/
98   install -m755 examples/saytime "$pkgdir"/usr/bin/
99   install -m755 examples/scfg_parse_text "$pkgdir"/usr/bin/
100   install -m755 examples/text2pos "$pkgdir"/usr/bin/
101   install -m755 examples/text2wave "$pkgdir"/usr/bin
102   install -m755 examples/text2utt "$pkgdir"/usr/bin
104   #libraries
105   install -m755 src/lib/libFestival.so.* "$pkgdir"/usr/lib/
106   ln -sf libFestival.so.2.5.0.0 "$pkgdir"/usr/lib/libFestival.so
108   #headers
109   install -dm755 "$pkgdir"/usr/include/festival
110   install -m644 -t "$pkgdir"/usr/include/festival src/include/*.h
112   mkdir -p "$pkgdir"/usr/share/festival
113   cp -aR lib/* "$pkgdir"/usr/share/festival
114   rm -fv $(find "$pkgdir"/usr/share/festival -name Makefile)
115   rm -fv $(find "$pkgdir"/usr/bin -name Makefile)
117   #create voices directory
118   install -dm755 "$pkgdir"/usr/share/festival/voices
120   #licenses
121   install -D -m644 "$srcdir"/festival/COPYING \
122     "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
123   install -D -m644 "$srcdir"/speech_tools/README.md \
124     "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.other
126   # Ok now some general cleanups
127   for i in $(find "$pkgdir"/usr/include/ -type f); do
128     sed -i -e 's,"EST.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/\",speech_tools/,g' \
129       -e 's,"siod.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/\",speech_tools/,g' \
130       -e 's,"instantiate/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/instantiate/\",speech_tools/instantiate/,g' -e 's,"instantiate,instantiate,g' \
131       -e 's,"ling_class/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/ling_class/\",speech_tools/ling_class/,g' -e 's,"ling_class,ling_class,g' \
132       -e 's,"rxp/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/rxp/\",speech_tools/rxp/,g' -e 's,"rxp,rxp,g' \
133       -e 's,"sigpr/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/sigpr/\",speech_tools/sigpr/,g' -e 's,"sigpr,sigpr,g' \
134       -e 's,"unix/.*\.h",\<speech_tools/&\>,g' -e 's,speech_tools/unix/\",speech_tools/unix/,g' -e 's,\.h\">,.h\>,g' -e 's,"unix,unix,g' \
135       -e 's,"festival\.h",\<festival/festival.h\>,g' \
136       -e 's,"ModuleDescription\.h",\<festival/ModuleDescription.h\>,g' \
137       -e 's,"Phone\.h",\<festival/Phone.h\>,g' $i
138   done