A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 129 lines 3.0 kB view raw
1#!/usr/bin/perl 2require "./tools/builds.pm"; 3 4my $verbose; 5if($ARGV[0] eq "-v") { 6 $verbose =1; 7 shift @ARGV; 8} 9 10my $tag = $ARGV[0]; 11my $version = $ARGV[1]; 12 13my $outdir = "output/bins"; 14 15my $cpus = `nproc`; 16 17# made once for all targets 18sub runone { 19 my ($dir, $confnum, $extra)=@_; 20 my $a; 21 22 mkdir "buildb-$dir"; 23 chdir "buildb-$dir"; 24 print "Build in buildb-$dir\n" if($verbose); 25 26 # build the manual(s) 27 $a = buildit($dir, $confnum, $extra); 28 29 chdir ".."; 30 31 my $o="buildb-$dir/rockbox.zip"; 32 my $map="buildb-$dir/rockbox-maps.zip"; 33 my $elf="buildb-$dir/rockbox-elfs.zip"; 34 if (-f $o) { 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"); 39 system("mv $o $newo"); 40 print "moved $o to $newo\n" if($verbose); 41 system("mv $map $newmap"); 42 print "moved $map to $newmap\n" if($verbose); 43 system("mv $elf $newelf"); 44 print "moved $elf to $newelf\n" if($verbose); 45 } 46 47 print "remove all contents in build-$dir\n" if($verbose); 48 system("rm -rf buildb-$dir"); 49 50 return $a; 51}; 52 53sub fonts { 54 my ($dir, $confnum, $newl)=@_; 55 my $a; 56 57 mkdir "buildf-$dir"; 58 chdir "buildf-$dir"; 59 print "Build fonts in buildf-$dir\n" if($verbose); 60 61 # build the fonts 62 $a = buildfonts($dir, $confnum, $newl); 63 64 chdir ".."; 65 66 my $o="buildf-$dir/rockbox-fonts.zip"; 67 if (-f $o) { 68 my $newo="$outdir/rockbox-fonts-$version.zip"; 69 system("mv $o $newo"); 70 print "moved $o to $newo\n" if($verbose); 71 } 72 73 print "remove all contents in buildb-$dir\n" if($verbose); 74 system("rm -rf buildf-$dir"); 75 76 return $a; 77}; 78 79sub buildit { 80 my ($target, $confnum, $extra)=@_; 81 82 `rm -rf * >/dev/null 2>&1`; 83 84 my $ram = $extra ? $extra : -1; 85 my $c = "../tools/configure --type=n --target=$confnum --ram=$ram"; 86 87 print "C: $c\n" if($verbose); 88 `$c`; 89 90 print "Run 'make'\n" if($verbose); 91 `make -j$cpus VERSION=$version`; 92 93 print "Run 'make zip'\n" if($verbose); 94 `make zip VERSION=$version`; 95 96 print "Run 'make mapzip'\n" if($verbose); 97 `make mapzip VERSION=$version`; 98 99 print "Run 'make elfzip'\n" if($verbose); 100 `make elfzip VERSION=$version`; 101} 102 103sub buildfonts { 104 my ($target, $confnum, $newl)=@_; 105 106 `rm -rf * >/dev/null 2>&1`; 107 108 my $ram = $extra ? $extra : -1; 109 my $c = "../tools/configure --type=n --target=$confnum --ram=$ram"; 110 111 print "C: $c\n" if($verbose); 112 `$c`; 113 114 print "Run 'make fontzip'\n" if($verbose); 115 `make fontzip NODEPS=1`; 116} 117 118`git checkout $tag`; 119 120# run make in tools first to make sure they're up-to-date 121print "cd tools && make\n" if($verbose); 122`(cd tools && make ) >/dev/null`; 123 124for my $b (&stablebuilds) { 125 my $configname = $builds{$b}{configname} ? $builds{$b}{configname} : $b; 126 runone($b, $configname, $builds{$b}{ram}); 127} 128 129fonts("fonts", "iaudiox5");