A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

release: Revamp release scripts

Covers bins, voices, manuals, fonts, and source tarballs.

Only thing remaining is build-info integration

Change-Id: I3a93fd87bbeb725fc8e1b38c5787e33fa00f3f37

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