diff options
Diffstat (limited to 'tools/release/voices.pl')
-rwxr-xr-x | tools/release/voices.pl | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/tools/release/voices.pl b/tools/release/voices.pl index 785896e1a8..42bf533118 100755 --- a/tools/release/voices.pl +++ b/tools/release/voices.pl | |||
@@ -1,8 +1,5 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl -w |
2 | 2 | require "./tools/builds.pm"; | |
3 | $version="3.15"; | ||
4 | |||
5 | require "tools/builds.pm"; | ||
6 | 3 | ||
7 | my $verbose; | 4 | my $verbose; |
8 | if($ARGV[0] eq "-v") { | 5 | if($ARGV[0] eq "-v") { |
@@ -10,61 +7,64 @@ if($ARGV[0] eq "-v") { | |||
10 | shift @ARGV; | 7 | shift @ARGV; |
11 | } | 8 | } |
12 | 9 | ||
13 | my $doonly; | 10 | my $tag = $ARGV[0]; |
14 | if($ARGV[0]) { | 11 | my $version = $ARGV[1]; |
15 | $doonly = $ARGV[0]; | 12 | |
16 | print "only build $doonly\n" if($verbose); | 13 | my $outdir = "output/voices"; |
17 | } | ||
18 | 14 | ||
19 | # made once for all targets | 15 | # made once for all targets |
20 | sub runone { | 16 | sub runone { |
21 | my ($dir)=@_; | 17 | my ($target, $name, $lang, $engine, $voice, $engine_opts)=@_; |
22 | my $a; | 18 | my $a; |
23 | 19 | ||
24 | if($doonly && ($doonly ne $dir)) { | 20 | print "*** LANGUAGE: $lang\n"; |
25 | return; | ||
26 | } | ||
27 | 21 | ||
28 | mkdir "buildv-$dir"; | 22 | print "Build in buildv-$target-$lang\n" if($verbose); |
29 | chdir "buildv-$dir"; | ||
30 | print "Build in buildv-$dir\n" if($verbose); | ||
31 | 23 | ||
32 | # build the manual(s) | 24 | mkdir "buildv-$target-$lang"; |
33 | $a = buildit($dir); | 25 | chdir "buildv-$target-$lang"; |
34 | 26 | ||
35 | chdir ".."; | 27 | # build the voice(s) |
28 | $a = buildit($target, $lang, $engine, $voice, $engine_opts); | ||
36 | 29 | ||
37 | my $o="buildv-$dir/english.voice"; | 30 | my $o="$lang.voice"; |
38 | if (-f $o) { | 31 | if (-f $o) { |
39 | my $newo="output/$dir-$version-english.zip"; | 32 | my $newo="../$outdir/$target/voice-$target-$version-$name.zip"; |
40 | system("cp $o output/$dir-$version-english.voice"); | 33 | system("mkdir -p ../$outdir/$target"); |
34 | system("mkdir -p .rockbox/langs"); | ||
35 | system("mkdir -p output/$target"); | ||
41 | system("mkdir -p .rockbox/langs"); | 36 | system("mkdir -p .rockbox/langs"); |
42 | system("cp $o .rockbox/langs"); | 37 | system("cp $o .rockbox/langs"); |
43 | system("zip -r $newo .rockbox"); | 38 | system("zip -q -r $newo .rockbox"); |
44 | system("rm -rf .rockbox"); | 39 | system("rm -rf .rockbox"); |
40 | `chmod a+r $newo`; | ||
45 | print "moved $o to $newo\n" if($verbose); | 41 | print "moved $o to $newo\n" if($verbose); |
46 | } | 42 | } |
47 | 43 | ||
48 | print "remove all contents in buildv-$dir\n" if($verbose); | 44 | chdir ".."; |
49 | system("rm -rf buildv-$dir"); | 45 | |
46 | print "remove all contents in buildv-$target-$lang\n" if($verbose); | ||
47 | system("rm -rf buildv-$target-$lang"); | ||
50 | 48 | ||
51 | return $a; | 49 | return $a; |
52 | }; | 50 | }; |
53 | 51 | ||
54 | sub buildit { | 52 | sub buildit { |
55 | my ($model)=@_; | 53 | my ($target, $lang, $engine, $voice, $engine_opts)=@_; |
56 | 54 | ||
57 | `rm -rf * >/dev/null 2>&1`; | 55 | `rm -rf * >/dev/null 2>&1`; |
58 | 56 | ||
59 | my $c = "../tools/configure --type=av --target=$model --language=0 --tts=f --ram=0 --voice=0"; | 57 | my $c = "../tools/configure --no-ccache --type=av --target=$target --ram=-1 --language=$lang --tts=$engine --voice=$voice --ttsopts='$engine_opts'"; |
60 | 58 | ||
61 | print "C: $c\n" if($verbose); | 59 | print "C: $c\n" if($verbose); |
62 | `$c`; | 60 | system($c); |
63 | 61 | ||
64 | print "Run 'make voice'\n" if($verbose); | 62 | print "Run 'make voice'\n" if($verbose); |
65 | print `make voice VERSION=$version 2>/dev/null`; | 63 | `make voice`; |
66 | } | 64 | } |
67 | 65 | ||
66 | `git checkout $tag`; | ||
67 | |||
68 | # run make in tools first to make sure they're up-to-date | 68 | # run make in tools first to make sure they're up-to-date |
69 | `(cd tools && make ) >/dev/null 2>&1`; | 69 | `(cd tools && make ) >/dev/null 2>&1`; |
70 | 70 | ||
@@ -75,8 +75,16 @@ my $pool="$home/tmp/rockbox-voices-$version/voice-pool"; | |||
75 | `rm -f $pool/*`; | 75 | `rm -f $pool/*`; |
76 | $ENV{'POOL'}="$pool"; | 76 | $ENV{'POOL'}="$pool"; |
77 | 77 | ||
78 | for my $b (&stablebuilds) { | 78 | `mkdir -p $outdir`; |
79 | next if (length($builds{$b}{configname}) > 0); # no variants | ||
80 | 79 | ||
81 | runone($b); | 80 | for my $b (&usablebuilds) { |
82 | } | 81 | next if ($builds{$b}{voice}); # no variants |
82 | |||
83 | for my $v (&allvoices) { | ||
84 | my %voice = $voices{$v}; | ||
85 | |||
86 | # print " runone $b $v ($voices{$v}->{lang} via $voices{$v}->{defengine})\n"; | ||
87 | runone($b, $v, $voices{$v}->{lang}, $voices{$v}->{defengine}, | ||
88 | "-1", $voices{$v}->{engines}->{$voices{$v}->{defengine}}); | ||
89 | } | ||
90 | } | ||