summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-04-17 17:59:58 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-04-17 22:10:52 -0400
commitac9003546f99250fc1b129edd804496f69c3ef1a (patch)
treec6fc3609cda0336c3779045dec7fd00773411ea3
parentc38aeb3fbc6b45e5a71af4506c79459ce9cb2121 (diff)
downloadrockbox-ac9003546f99250fc1b129edd804496f69c3ef1a.tar.gz
rockbox-ac9003546f99250fc1b129edd804496f69c3ef1a.zip
release: Revamp release scripts
Covers bins, voices, manuals, fonts, and source tarballs. Only thing remaining is build-info integration Change-Id: I3a93fd87bbeb725fc8e1b38c5787e33fa00f3f37
-rw-r--r--tools/release/README30
-rwxr-xr-xtools/release/bins.pl77
-rwxr-xr-xtools/release/manuals.pl36
-rwxr-xr-xtools/release/sources.sh13
-rwxr-xr-xtools/release/voices.pl76
5 files changed, 114 insertions, 118 deletions
diff --git a/tools/release/README b/tools/release/README
index 294c7ba136..19e4f0735c 100644
--- a/tools/release/README
+++ b/tools/release/README
@@ -5,28 +5,30 @@
5 Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 5 Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 \/ \/ \/ \/ \/ 6 \/ \/ \/ \/ \/
7 7
8 This directory contains useful scripts when creating and building 8 This directory the scripts used to create release artifacts. All
9 releases. The plan is to hopefully create a single top-level script that will 9 generated data is stored in an output directory (called "output").
10 run everything needed to make a complete and full release and put all 10
11 generated data into a separate output directory. 11 All of these scripts take two arguments; the git tag and the version string.
12 12
13 NOTE that these scripts assume that you have the necessary compilers already 13 NOTE that these scripts assume that you have the necessary compilers already
14 present in your PATH. 14 present in your PATH.
15 15
16 The scripts: 16 The scripts:
17 17
18 bins.pl Builds all the binary rockbox zip files. 18 bins.pl Builds all the binary rockbox zip files
19 19 manuals.pl Builds all manuals (pdf and html-zip)
20 manuals.pl Builds all manuals 20 sources.sh Builds the source tarball
21 voices.pl Builds all "complete enough" voice files
21 22
22 voices.pl Builds all english voice files 23 Only "stable" targets, their manuals, and a selection of voice files are built;
24 these are designated in tools/builds.pm
23 25
24 tarball.sh Builds the source tarball 26 Example:
25 27
28 tools/release/sources.sh v3.15-final 3.15
26 29
27 STATUS 30 Other notes:
28 31
29 All these scripts have a "version" variable at the top that needs editing and 32 * Update www/tools/dailybuild-voices.pl file to add the release target
30 each of this script needs to be run at the source tree root to function. Most 33 voice list!
31 of them put their generated files in a subdir called 'output' which the 34 * Update release target in tools/builds.pm
32 scripts create.
diff --git a/tools/release/bins.pl b/tools/release/bins.pl
index 03333a5963..2457558242 100755
--- a/tools/release/bins.pl
+++ b/tools/release/bins.pl
@@ -1,7 +1,5 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2$version="3.15"; 2require "./tools/builds.pm";
3
4require "tools/builds.pm";
5 3
6my $verbose; 4my $verbose;
7if($ARGV[0] eq "-v") { 5if($ARGV[0] eq "-v") {
@@ -9,53 +7,35 @@ if($ARGV[0] eq "-v") {
9 shift @ARGV; 7 shift @ARGV;
10} 8}
11 9
12my $update; 10my $tag = $ARGV[0];
13if($ARGV[0] eq "-u") { 11my $version = $ARGV[1];
14 $update =1;
15 shift @ARGV;
16}
17
18my $doonly;
19if($ARGV[0]) {
20 $doonly = $ARGV[0];
21 print "only build $doonly\n" if($verbose);
22}
23 12
24if($update) { 13my $outdir = "output/bins";
25 # svn update!
26 system("svn -q up");
27}
28 14
29$rev = `svnversion`; 15my $cpus = `nproc`;
30chomp $rev;
31print "rev $rev\n" if($verbose);
32 16
33# made once for all targets 17# made once for all targets
34sub runone { 18sub runone {
35 my ($dir, $confnum, $extra)=@_; 19 my ($dir, $confnum, $extra)=@_;
36 my $a; 20 my $a;
37 21
38 if($doonly && ($doonly ne $dir)) { 22 mkdir "buildb-$dir";
39 return; 23 chdir "buildb-$dir";
40 } 24 print "Build in buildb-$dir\n" if($verbose);
41
42 mkdir "build-$dir";
43 chdir "build-$dir";
44 print "Build in build-$dir\n" if($verbose);
45 25
46 # build the manual(s) 26 # build the manual(s)
47 $a = buildit($dir, $confnum, $extra); 27 $a = buildit($dir, $confnum, $extra);
48 28
49 chdir ".."; 29 chdir "..";
50 30
51 my $o="build-$dir/rockbox.zip"; 31 my $o="buildb-$dir/rockbox.zip";
52 my $map="build-$dir/rockbox-maps.zip"; 32 my $map="buildb-$dir/rockbox-maps.zip";
53 my $elf="build-$dir/rockbox-elfs.zip"; 33 my $elf="buildb-$dir/rockbox-elfs.zip";
54 if (-f $o) { 34 if (-f $o) {
55 my $newo="output/rockbox-$dir-$version.zip"; 35 my $newo="$outdir/rockbox-$dir-$version.zip";
56 my $newmap="output/rockbox-$dir-$version-maps.zip"; 36 my $newmap="$outdir/rockbox-$dir-$version-maps.zip";
57 my $newelf="output/rockbox-$dir-$version-elfs.zip"; 37 my $newelf="$outdir/rockbox-$dir-$version-elfs.zip";
58 system("mkdir -p output"); 38 system("mkdir -p $outdir");
59 system("mv $o $newo"); 39 system("mv $o $newo");
60 print "moved $o to $newo\n" if($verbose); 40 print "moved $o to $newo\n" if($verbose);
61 system("mv $map $newmap"); 41 system("mv $map $newmap");
@@ -74,34 +54,28 @@ sub fonts {
74 my ($dir, $confnum, $newl)=@_; 54 my ($dir, $confnum, $newl)=@_;
75 my $a; 55 my $a;
76 56
77 if($doonly && ($doonly ne $dir)) { 57 mkdir "buildf-$dir";
78 return; 58 chdir "buildf-$dir";
79 } 59 print "Build fonts in buildf-$dir\n" if($verbose);
80
81 mkdir "build-$dir";
82 chdir "build-$dir";
83 print "Build fonts in build-$dir\n" if($verbose);
84 60
85 # build the fonts 61 # build the fonts
86 $a = buildfonts($dir, $confnum, $newl); 62 $a = buildfonts($dir, $confnum, $newl);
87 63
88 chdir ".."; 64 chdir "..";
89 65
90 my $o="build-$dir/rockbox-fonts.zip"; 66 my $o="buildf-$dir/rockbox-fonts.zip";
91 if (-f $o) { 67 if (-f $o) {
92 my $newo="output/rockbox-fonts-$version.zip"; 68 my $newo="$outdir/rockbox-fonts-$version.zip";
93 system("mv $o $newo"); 69 system("mv $o $newo");
94 print "moved $o to $newo\n" if($verbose); 70 print "moved $o to $newo\n" if($verbose);
95 } 71 }
96 72
97 print "remove all contents in build-$dir\n" if($verbose); 73 print "remove all contents in buildb-$dir\n" if($verbose);
98 system("rm -rf build-$dir"); 74 system("rm -rf buildf-$dir");
99 75
100 return $a; 76 return $a;
101}; 77};
102 78
103
104
105sub buildit { 79sub buildit {
106 my ($target, $confnum, $extra)=@_; 80 my ($target, $confnum, $extra)=@_;
107 81
@@ -114,7 +88,7 @@ sub buildit {
114 `$c`; 88 `$c`;
115 89
116 print "Run 'make'\n" if($verbose); 90 print "Run 'make'\n" if($verbose);
117 `make VERSION=$version`; 91 `make -j$cpus VERSION=$version`;
118 92
119 print "Run 'make zip'\n" if($verbose); 93 print "Run 'make zip'\n" if($verbose);
120 `make zip VERSION=$version`; 94 `make zip VERSION=$version`;
@@ -141,14 +115,15 @@ sub buildfonts {
141 `make fontzip`; 115 `make fontzip`;
142} 116}
143 117
118`git checkout $tag`;
119
144# run make in tools first to make sure they're up-to-date 120# run make in tools first to make sure they're up-to-date
145print "cd tools && make\n" if($verbose); 121print "cd tools && make\n" if($verbose);
146`(cd tools && make ) >/dev/null`; 122`(cd tools && make ) >/dev/null`;
147 123
148for my $b (&stablebuilds) { 124for my $b (&usablebuilds) {
149 my $configname = $builds{$b}{configname} ? $builds{$b}{configname} : $b; 125 my $configname = $builds{$b}{configname} ? $builds{$b}{configname} : $b;
150 runone($b, $configname, $builds{$b}{ram}); 126 runone($b, $configname, $builds{$b}{ram});
151} 127}
152 128
153fonts("fonts", "iaudiox5"); 129fonts("fonts", "iaudiox5");
154
diff --git a/tools/release/manuals.pl b/tools/release/manuals.pl
index 923cacf747..61d298fd38 100755
--- a/tools/release/manuals.pl
+++ b/tools/release/manuals.pl
@@ -1,8 +1,7 @@
1#!/usr/bin/perl 1#!/usr/bin/perl -w
2require "./tools/builds.pm";
2 3
3$version="3.15"; 4require "./tools/builds.pm";
4
5require "tools/builds.pm";
6 5
7my $verbose; 6my $verbose;
8if($ARGV[0] eq "-v") { 7if($ARGV[0] eq "-v") {
@@ -10,21 +9,16 @@ if($ARGV[0] eq "-v") {
10 shift @ARGV; 9 shift @ARGV;
11} 10}
12 11
13my $doonly; 12my $tag = $ARGV[0];
14if($ARGV[0]) { 13my $version = $ARGV[1];
15 $doonly = $ARGV[0]; 14
16 print "only build $doonly\n" if($verbose); 15my $outdir = "output/manuals";
17}
18 16
19# made once for all targets 17# made once for all targets
20sub runone { 18sub runone {
21 my ($dir)=@_; 19 my ($dir)=@_;
22 my $a; 20 my $a;
23 21
24 if($doonly && ($doonly ne $dir)) {
25 return;
26 }
27
28 mkdir "buildm-$dir"; 22 mkdir "buildm-$dir";
29 chdir "buildm-$dir"; 23 chdir "buildm-$dir";
30 print "Build in buildm-$dir\n" if($verbose); 24 print "Build in buildm-$dir\n" if($verbose);
@@ -34,16 +28,18 @@ sub runone {
34 28
35 chdir ".."; 29 chdir "..";
36 30
37 my $o="buildm-$dir/manual/rockbox-build.pdf"; 31 my $o="buildm-$dir/rockbox-$dir-$version.pdf";
38 if (-f $o) { 32 if (-f $o) {
39 my $newo="output/rockbox-$dir-$version.pdf"; 33 my $newo="$outdir/rockbox-$dir-$version.pdf";
40 system("mv $o $newo"); 34 system("mv $o $newo");
41 print "moved $o to $newo\n" if($verbose); 35 print "moved $o to $newo\n" if($verbose);
36 } else {
37 print "buildm-$dir/rockbox-$dir-$version.pdf not found\n";
42 } 38 }
43 39
44 $o="buildm-$dir/rockbox-manual.zip"; 40 $o="buildm-$dir/rockbox-manual.zip";
45 if (-f $o) { 41 if (-f $o) {
46 my $newo="output/rockbox-$dir-$version-html.zip"; 42 my $newo="$outdir/rockbox-$dir-$version-html.zip";
47 system("mv $o $newo"); 43 system("mv $o $newo");
48 print "moved $o to $newo\n" if($verbose); 44 print "moved $o to $newo\n" if($verbose);
49 } 45 }
@@ -64,18 +60,20 @@ sub buildit {
64 print "C: $c\n" if($verbose); 60 print "C: $c\n" if($verbose);
65 `$c`; 61 `$c`;
66 62
67 print "Run 'make'\n" if($verbose); 63 print "Run 'make manual'\n" if($verbose);
68 `make manual VERSION=$version 2>/dev/null`; 64 `make manual VERSION=$version 2>/dev/null`;
69 65
70 print "Run 'make manual-zip'\n" if($verbose); 66 print "Run 'make manual-zip'\n" if($verbose);
71 `make manual-zip VERSION=$version 2>/dev/null`; 67 `make manual-zip VERSION=$version 2>/dev/null`;
72} 68}
73 69
70`git checkout $tag`;
71
74# run make in tools first to make sure they're up-to-date 72# run make in tools first to make sure they're up-to-date
75`(cd tools && make ) >/dev/null 2>&1`; 73`(cd tools && make ) >/dev/null 2>&1`;
76 74
77for my $b (&stablebuilds) { 75`mkdir -p $outdir`;
78 next if (length($builds{$b}{configname}) > 0); # no variants
79 76
77for my $b (&usablebuilds) {
80 runone($b); 78 runone($b);
81} 79}
diff --git a/tools/release/sources.sh b/tools/release/sources.sh
new file mode 100755
index 0000000000..2e9dd30bde
--- /dev/null
+++ b/tools/release/sources.sh
@@ -0,0 +1,13 @@
1#!/bin/sh
2
3set -e
4set -x
5
6tag=$1
7version=$2
8
9outdir="output/source"
10
11mkdir -p "${outdir}"
12git archive --prefix=rockbox-$version/ -o "${outdir}/rockbox-source-${version}.tar" ${tag}
13xz -f "${outdir}/rockbox-source-${version}.tar"
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 2require "./tools/builds.pm";
3$version="3.15";
4
5require "tools/builds.pm";
6 3
7my $verbose; 4my $verbose;
8if($ARGV[0] eq "-v") { 5if($ARGV[0] eq "-v") {
@@ -10,61 +7,64 @@ if($ARGV[0] eq "-v") {
10 shift @ARGV; 7 shift @ARGV;
11} 8}
12 9
13my $doonly; 10my $tag = $ARGV[0];
14if($ARGV[0]) { 11my $version = $ARGV[1];
15 $doonly = $ARGV[0]; 12
16 print "only build $doonly\n" if($verbose); 13my $outdir = "output/voices";
17}
18 14
19# made once for all targets 15# made once for all targets
20sub runone { 16sub 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
54sub buildit { 52sub 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
78for my $b (&stablebuilds) { 78`mkdir -p $outdir`;
79 next if (length($builds{$b}{configname}) > 0); # no variants
80 79
81 runone($b); 80for 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 }