summaryrefslogtreecommitdiffstats
path: root/tools/release/voices.pl
blob: 785896e1a824ed9f5b7fe6d605f03418fb0ea18d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/perl

$version="3.15";

require "tools/builds.pm";

my $verbose;
if($ARGV[0] eq "-v") {
    $verbose =1;
    shift @ARGV;
}

my $doonly;
if($ARGV[0]) {
    $doonly = $ARGV[0];
    print "only build $doonly\n" if($verbose);
}

# made once for all targets
sub runone {
    my ($dir)=@_;
    my $a;

    if($doonly && ($doonly ne $dir)) {
        return;
    }

    mkdir "buildv-$dir";
    chdir "buildv-$dir";
    print "Build in buildv-$dir\n" if($verbose);

    # build the manual(s)
    $a = buildit($dir);

    chdir "..";

    my $o="buildv-$dir/english.voice";
    if (-f $o) {
        my $newo="output/$dir-$version-english.zip";
        system("cp $o output/$dir-$version-english.voice");
        system("mkdir -p .rockbox/langs");
        system("cp $o .rockbox/langs");
        system("zip -r $newo .rockbox");
        system("rm -rf .rockbox");
        print "moved $o to $newo\n" if($verbose);
    }

    print "remove all contents in buildv-$dir\n" if($verbose);
    system("rm -rf buildv-$dir");

    return $a;
};

sub buildit {
    my ($model)=@_;

    `rm -rf * >/dev/null 2>&1`;

    my $c = "../tools/configure --type=av --target=$model --language=0 --tts=f --ram=0 --voice=0";

    print "C: $c\n" if($verbose);
    `$c`;

    print "Run 'make voice'\n" if($verbose);
    print `make voice VERSION=$version 2>/dev/null`;
}

# run make in tools first to make sure they're up-to-date
`(cd tools && make ) >/dev/null 2>&1`;

my $home=$ENV{'HOME'};

my $pool="$home/tmp/rockbox-voices-$version/voice-pool";
`mkdir -p $pool`;
`rm -f $pool/*`;
$ENV{'POOL'}="$pool";

for my $b (&stablebuilds) {
    next if (length($builds{$b}{configname}) > 0); # no variants

    runone($b);
}