2004-05-21 19:05:27 +00:00
|
|
|
#!/usr/bin/perl
|
2005-11-14 15:06:51 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
2004-05-21 19:05:27 +00:00
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
use File::Copy; # For move() and copy()
|
|
|
|
use File::Find; # For find()
|
|
|
|
use File::Path; # For rmtree()
|
|
|
|
use Cwd 'abs_path';
|
|
|
|
|
|
|
|
sub glob_copy {
|
|
|
|
my ($pattern, $destination) = @_;
|
|
|
|
foreach my $path (glob($pattern)) {
|
|
|
|
copy($path, $destination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub glob_unlink {
|
|
|
|
my ($pattern) = @_;
|
|
|
|
foreach my $path (glob($pattern)) {
|
|
|
|
unlink($path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub find_copyfile {
|
|
|
|
my ($pattern, $destination) = @_;
|
|
|
|
return sub {
|
|
|
|
$path = $_;
|
|
|
|
if ($path =~ $pattern && filesize($path) > 0 && !($path =~ /\.rockbox/)) {
|
|
|
|
copy($path, $destination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-24 15:13:08 +00:00
|
|
|
$ROOT="..";
|
|
|
|
|
2005-12-13 10:20:23 +00:00
|
|
|
my $ziptool="zip";
|
|
|
|
my $output="rockbox.zip";
|
2004-08-24 15:13:08 +00:00
|
|
|
my $verbose;
|
2005-12-13 10:20:23 +00:00
|
|
|
my $exe;
|
|
|
|
my $target;
|
2006-04-03 21:11:11 +00:00
|
|
|
my $archos;
|
2006-05-10 21:57:08 +00:00
|
|
|
my $incfonts;
|
2005-12-13 10:20:23 +00:00
|
|
|
|
|
|
|
while(1) {
|
|
|
|
if($ARGV[0] eq "-r") {
|
|
|
|
$ROOT=$ARGV[1];
|
|
|
|
shift @ARGV;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
|
|
|
|
|
|
|
elsif($ARGV[0] eq "-z") {
|
|
|
|
$ziptool=$ARGV[1];
|
|
|
|
shift @ARGV;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
|
|
|
|
2006-04-03 21:11:11 +00:00
|
|
|
elsif($ARGV[0] eq "-t") {
|
|
|
|
# The target name as used in ARCHOS in the root makefile
|
|
|
|
$archos=$ARGV[1];
|
|
|
|
shift @ARGV;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2007-08-05 19:19:39 +00:00
|
|
|
elsif($ARGV[0] eq "-i") {
|
|
|
|
# The target id name as used in TARGET_ID in the root makefile
|
|
|
|
$target_id=$ARGV[1];
|
|
|
|
shift @ARGV;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2005-12-13 10:20:23 +00:00
|
|
|
elsif($ARGV[0] eq "-o") {
|
|
|
|
$output=$ARGV[1];
|
|
|
|
shift @ARGV;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2006-05-10 21:57:08 +00:00
|
|
|
elsif($ARGV[0] eq "-f") {
|
|
|
|
$incfonts=$ARGV[1]; # 0 - no fonts, 1 - fonts only 2 - fonts and package
|
|
|
|
shift @ARGV;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
2005-12-13 10:20:23 +00:00
|
|
|
|
|
|
|
elsif($ARGV[0] eq "-v") {
|
|
|
|
$verbose =1;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$target = $ARGV[0];
|
|
|
|
$exe = $ARGV[1];
|
|
|
|
last;
|
|
|
|
}
|
2004-08-24 15:13:08 +00:00
|
|
|
}
|
|
|
|
|
2005-12-13 10:20:23 +00:00
|
|
|
|
2005-08-04 18:11:46 +00:00
|
|
|
my $firmdir="$ROOT/firmware";
|
2007-04-16 09:14:36 +00:00
|
|
|
my $appsdir="$ROOT/apps";
|
|
|
|
my $viewer_bmpdir="$ROOT/apps/plugins/bitmaps/viewer_defaults";
|
2005-08-04 18:11:46 +00:00
|
|
|
|
2005-08-03 21:31:51 +00:00
|
|
|
my $cppdef = $target;
|
|
|
|
|
2007-03-12 10:51:08 +00:00
|
|
|
sub gettargetinfo {
|
|
|
|
open(GCC, ">gcctemp");
|
|
|
|
# Get the LCD screen depth and graphical status
|
|
|
|
print GCC <<STOP
|
|
|
|
\#include "config.h"
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
Bitmap: yes
|
|
|
|
Depth: LCD_DEPTH
|
2007-04-16 09:14:36 +00:00
|
|
|
Icon Width: CONFIG_DEFAULT_ICON_WIDTH
|
|
|
|
Icon Height: CONFIG_DEFAULT_ICON_HEIGHT
|
2007-03-12 10:51:08 +00:00
|
|
|
#endif
|
|
|
|
Codec: CONFIG_CODEC
|
2007-04-16 09:14:36 +00:00
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
Remote Depth: LCD_REMOTE_DEPTH
|
|
|
|
Remote Icon Width: CONFIG_REMOTE_DEFAULT_ICON_WIDTH
|
2007-04-16 09:59:27 +00:00
|
|
|
Remote Icon Height: CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
|
2007-04-16 09:14:36 +00:00
|
|
|
#else
|
|
|
|
Remote Depth: 0
|
|
|
|
#endif
|
2007-05-29 08:17:32 +00:00
|
|
|
#ifdef HAVE_RECORDING
|
|
|
|
Recording: yes
|
|
|
|
#endif
|
2007-03-12 10:51:08 +00:00
|
|
|
STOP
|
|
|
|
;
|
2007-03-12 12:56:35 +00:00
|
|
|
close(GCC);
|
2007-03-12 10:51:08 +00:00
|
|
|
|
|
|
|
my $c="cat gcctemp | gcc $cppdef -I. -I$firmdir/export -E -P -";
|
|
|
|
|
|
|
|
# print STDERR "CMD $c\n";
|
|
|
|
|
|
|
|
open(TARGET, "$c|");
|
|
|
|
|
2007-04-16 09:14:36 +00:00
|
|
|
my ($bitmap, $depth, $swcodec, $icon_h, $icon_w);
|
|
|
|
my ($remote_depth, $remote_icon_h, $remote_icon_w);
|
2007-05-29 08:17:32 +00:00
|
|
|
my ($recording);
|
2007-04-16 09:14:36 +00:00
|
|
|
$icon_count = 1;
|
2007-03-12 10:51:08 +00:00
|
|
|
while(<TARGET>) {
|
|
|
|
# print STDERR "DATA: $_";
|
|
|
|
if($_ =~ /^Bitmap: (.*)/) {
|
|
|
|
$bitmap = $1;
|
|
|
|
}
|
|
|
|
elsif($_ =~ /^Depth: (\d*)/) {
|
|
|
|
$depth = $1;
|
|
|
|
}
|
2007-04-16 09:14:36 +00:00
|
|
|
elsif($_ =~ /^Icon Width: (\d*)/) {
|
|
|
|
$icon_w = $1;
|
|
|
|
}
|
|
|
|
elsif($_ =~ /^Icon Height: (\d*)/) {
|
|
|
|
$icon_h = $1;
|
|
|
|
}
|
2007-03-12 10:51:08 +00:00
|
|
|
elsif($_ =~ /^Codec: (\d*)/) {
|
|
|
|
# SWCODEC is 1, the others are HWCODEC
|
|
|
|
$swcodec = ($1 == 1);
|
|
|
|
}
|
2007-04-16 09:14:36 +00:00
|
|
|
elsif($_ =~ /^Remote Depth: (\d*)/) {
|
|
|
|
$remote_depth = $1;
|
|
|
|
}
|
|
|
|
elsif($_ =~ /^Remote Icon Width: (\d*)/) {
|
|
|
|
$remote_icon_w = $1;
|
|
|
|
}
|
|
|
|
elsif($_ =~ /^Remote Icon Height: (\d*)/) {
|
|
|
|
$remote_icon_h = $1;
|
|
|
|
}
|
2007-05-29 08:17:32 +00:00
|
|
|
if($_ =~ /^Recording: (.*)/) {
|
|
|
|
$recording = $1;
|
|
|
|
}
|
2007-03-12 10:51:08 +00:00
|
|
|
}
|
|
|
|
close(TARGET);
|
|
|
|
unlink("gcctemp");
|
|
|
|
|
2007-05-29 08:17:32 +00:00
|
|
|
return ($bitmap, $depth, $icon_w, $icon_h, $recording,
|
2007-04-16 09:14:36 +00:00
|
|
|
$swcodec, $remote_depth, $remote_icon_w, $remote_icon_h);
|
2007-03-12 10:51:08 +00:00
|
|
|
}
|
2004-08-24 15:13:08 +00:00
|
|
|
|
2004-08-24 09:38:26 +00:00
|
|
|
sub filesize {
|
|
|
|
my ($filename)=@_;
|
|
|
|
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
|
|
|
|
$atime,$mtime,$ctime,$blksize,$blocks)
|
|
|
|
= stat($filename);
|
|
|
|
return $size;
|
|
|
|
}
|
|
|
|
|
2004-05-21 19:05:27 +00:00
|
|
|
sub buildzip {
|
2007-03-12 10:51:08 +00:00
|
|
|
my ($zip, $image, $fonts)=@_;
|
|
|
|
|
2007-05-29 08:17:32 +00:00
|
|
|
my ($bitmap, $depth, $icon_w, $icon_h, $recording, $swcodec,
|
2007-04-16 09:14:36 +00:00
|
|
|
$remote_depth, $remote_icon_w, $remote_icon_h) = &gettargetinfo();
|
2007-03-12 10:51:08 +00:00
|
|
|
|
2007-03-20 12:38:54 +00:00
|
|
|
# print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n";
|
2004-05-21 19:05:27 +00:00
|
|
|
|
|
|
|
# remove old traces
|
2008-07-20 22:20:32 +00:00
|
|
|
rmtree('.rockbox');
|
2004-05-21 19:05:27 +00:00
|
|
|
|
|
|
|
mkdir ".rockbox", 0777;
|
2006-05-10 21:57:08 +00:00
|
|
|
|
2007-03-12 10:51:08 +00:00
|
|
|
if(!$bitmap) {
|
|
|
|
# always disable fonts on non-bitmap targets
|
|
|
|
$fonts = 0;
|
|
|
|
}
|
2007-11-21 13:37:45 +00:00
|
|
|
# create the file so the database does not try indexing a folder
|
2008-07-20 22:20:32 +00:00
|
|
|
open(IGNORE, ">.rockbox/database.ignore") || die "can't open database.ignore";
|
|
|
|
close(IGNORE);
|
2007-11-21 13:37:45 +00:00
|
|
|
|
2006-05-10 21:57:08 +00:00
|
|
|
if($fonts) {
|
|
|
|
mkdir ".rockbox/fonts", 0777;
|
2008-07-20 23:12:03 +00:00
|
|
|
chdir(".rockbox/fonts");
|
|
|
|
$cmd = "$ROOT/tools/convbdf -f $ROOT/fonts/*bdf >/dev/null 2>&1";
|
|
|
|
print($cmd);
|
|
|
|
system($cmd);
|
|
|
|
chdir("../../");
|
2006-05-10 21:57:08 +00:00
|
|
|
|
|
|
|
if($fonts < 2) {
|
|
|
|
# fonts-only package, return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-05-21 19:05:27 +00:00
|
|
|
mkdir ".rockbox/langs", 0777;
|
|
|
|
mkdir ".rockbox/rocks", 0777;
|
2007-08-06 13:42:52 +00:00
|
|
|
mkdir ".rockbox/rocks/games", 0777;
|
|
|
|
mkdir ".rockbox/rocks/apps", 0777;
|
|
|
|
mkdir ".rockbox/rocks/demos", 0777;
|
|
|
|
mkdir ".rockbox/rocks/viewers", 0777;
|
|
|
|
|
2007-05-29 08:17:32 +00:00
|
|
|
if ($recording) {
|
|
|
|
mkdir ".rockbox/recpresets", 0777;
|
|
|
|
}
|
2007-03-12 10:51:08 +00:00
|
|
|
|
|
|
|
if($swcodec) {
|
2006-03-18 21:17:35 +00:00
|
|
|
mkdir ".rockbox/eqs", 0777;
|
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
glob_copy("$ROOT/apps/eqs/*.cfg", '.rockbox/eqs/'); # equalizer presets
|
2007-03-12 10:51:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mkdir ".rockbox/wps", 0777;
|
2007-04-04 06:26:53 +00:00
|
|
|
mkdir ".rockbox/themes", 0777;
|
2007-04-16 14:33:29 +00:00
|
|
|
if ($bitmap) {
|
|
|
|
open(THEME, ">.rockbox/themes/rockbox_default_icons.cfg");
|
|
|
|
print THEME <<STOP
|
|
|
|
# this config file was auto-generated to make it
|
|
|
|
# easy to reset the icons back to default
|
|
|
|
iconset: -
|
|
|
|
# taken from apps/gui/icon.c
|
|
|
|
viewers iconset: /.rockbox/icons/viewers.bmp
|
|
|
|
remote iconset: -
|
|
|
|
# taken from apps/gui/icon.c
|
|
|
|
remote viewers iconset: /.rockbox/icons/remote_viewers.bmp
|
|
|
|
|
|
|
|
STOP
|
|
|
|
;
|
|
|
|
close(THEME);
|
|
|
|
}
|
|
|
|
|
2007-04-01 13:09:22 +00:00
|
|
|
mkdir ".rockbox/codepages", 0777;
|
|
|
|
|
|
|
|
if($bitmap) {
|
|
|
|
system("$ROOT/tools/codepages");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
system("$ROOT/tools/codepages -m");
|
|
|
|
}
|
2008-07-20 22:20:32 +00:00
|
|
|
|
|
|
|
glob_copy('*.cp', '.rockbox/codepages/');
|
|
|
|
glob_unlink('*.cp');
|
2007-03-12 10:51:08 +00:00
|
|
|
|
|
|
|
if($bitmap) {
|
|
|
|
mkdir ".rockbox/codecs", 0777;
|
|
|
|
if($depth > 1) {
|
|
|
|
mkdir ".rockbox/backdrops", 0777;
|
|
|
|
}
|
2006-10-12 20:48:40 +00:00
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
find(find_copyfile(qr/.*\.codec/, abs_path('.rockbox/codecs/')), 'apps/codecs');
|
2006-03-18 21:17:35 +00:00
|
|
|
|
2008-07-20 22:47:49 +00:00
|
|
|
# remove directory again if no codec was copied
|
|
|
|
rmdir(".rockbox/codecs");
|
2005-08-11 20:48:34 +00:00
|
|
|
}
|
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
find(find_copyfile(qr/\.(rock|ovl)/, abs_path('.rockbox/rocks/')), 'apps/plugins');
|
2004-05-21 19:05:27 +00:00
|
|
|
|
2004-08-24 15:13:08 +00:00
|
|
|
open VIEWERS, "$ROOT/apps/plugins/viewers.config" or
|
2004-07-13 09:45:39 +00:00
|
|
|
die "can't open viewers.config";
|
|
|
|
@viewers = <VIEWERS>;
|
|
|
|
close VIEWERS;
|
|
|
|
|
|
|
|
open VIEWERS, ">.rockbox/viewers.config" or
|
|
|
|
die "can't create .rockbox/viewers.config";
|
2007-08-06 13:42:52 +00:00
|
|
|
|
2005-10-05 08:02:10 +00:00
|
|
|
foreach my $line (@viewers) {
|
|
|
|
if ($line =~ /([^,]*),([^,]*),/) {
|
|
|
|
my ($ext, $plugin)=($1, $2);
|
|
|
|
my $r = "${plugin}.rock";
|
2005-11-02 07:32:16 +00:00
|
|
|
my $oname;
|
2005-10-05 08:02:10 +00:00
|
|
|
|
|
|
|
my $dir = $r;
|
|
|
|
my $name;
|
|
|
|
|
|
|
|
# strip off the last slash and file name part
|
|
|
|
$dir =~ s/(.*)\/(.*)/$1/;
|
|
|
|
# store the file name part
|
|
|
|
$name = $2;
|
|
|
|
|
2005-11-02 07:32:16 +00:00
|
|
|
# get .ovl name (file part only)
|
|
|
|
$oname = $name;
|
|
|
|
$oname =~ s/\.rock$/.ovl/;
|
|
|
|
|
2005-10-05 08:02:10 +00:00
|
|
|
# print STDERR "$ext $plugin $dir $name $r\n";
|
|
|
|
|
|
|
|
if(-e ".rockbox/rocks/$name") {
|
|
|
|
if($dir ne "rocks") {
|
|
|
|
# target is not 'rocks' but the plugins are always in that
|
|
|
|
# dir at first!
|
2008-07-20 22:20:32 +00:00
|
|
|
move(".rockbox/rocks/$name", ".rockbox/rocks/$r");
|
2005-10-05 08:02:10 +00:00
|
|
|
}
|
|
|
|
print VIEWERS $line;
|
2004-05-21 21:01:20 +00:00
|
|
|
}
|
2007-08-07 10:15:40 +00:00
|
|
|
elsif(-e ".rockbox/rocks/$r") {
|
2005-03-03 22:09:41 +00:00
|
|
|
# in case the same plugin works for multiple extensions, it
|
|
|
|
# was already moved to the viewers dir
|
2005-10-05 08:02:10 +00:00
|
|
|
print VIEWERS $line;
|
2005-03-03 22:09:41 +00:00
|
|
|
}
|
2005-11-02 07:32:16 +00:00
|
|
|
|
|
|
|
if(-e ".rockbox/rocks/$oname") {
|
2005-03-04 08:19:56 +00:00
|
|
|
# if there's an "overlay" file for the .rock, move that as
|
|
|
|
# well
|
2008-07-20 22:20:32 +00:00
|
|
|
move(".rockbox/rocks/$oname", ".rockbox/rocks/$dir");
|
2005-03-04 08:19:56 +00:00
|
|
|
}
|
2004-05-21 21:01:20 +00:00
|
|
|
}
|
2004-07-13 09:45:39 +00:00
|
|
|
}
|
|
|
|
close VIEWERS;
|
2007-08-06 13:42:52 +00:00
|
|
|
|
|
|
|
open CATEGORIES, "$ROOT/apps/plugins/CATEGORIES" or
|
|
|
|
die "can't open CATEGORIES";
|
|
|
|
@rock_targetdirs = <CATEGORIES>;
|
|
|
|
close CATEGORIES;
|
|
|
|
foreach my $line (@rock_targetdirs) {
|
|
|
|
if ($line =~ /([^,]*),(.*)/) {
|
|
|
|
my ($plugin, $dir)=($1, $2);
|
2008-07-20 22:20:32 +00:00
|
|
|
move(".rockbox/rocks/${plugin}.rock", ".rockbox/rocks/$dir/${plugin}.rock");
|
2007-08-06 13:42:52 +00:00
|
|
|
}
|
|
|
|
}
|
2004-07-13 09:45:39 +00:00
|
|
|
|
2007-04-16 09:14:36 +00:00
|
|
|
if ($bitmap) {
|
|
|
|
mkdir ".rockbox/icons", 0777;
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("$viewer_bmpdir/viewers.${icon_w}x${icon_h}x$depth.bmp", ".rockbox/icons/viewers.bmp");
|
2007-04-16 09:14:36 +00:00
|
|
|
if ($remote_depth) {
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("$viewer_bmpdir/remote_viewers.${remote_icon_w}x${remote_icon_h}x$remote_depth.bmp", ".rockbox/icons/remote_viewers.bmp");
|
2007-04-16 09:14:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("$ROOT/apps/tagnavi.config", ".rockbox/");
|
|
|
|
copy("$ROOT/apps/plugins/disktidy.config", ".rockbox/rocks/apps/");
|
2006-04-04 19:28:13 +00:00
|
|
|
|
2007-03-12 10:51:08 +00:00
|
|
|
if($bitmap) {
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("$ROOT/apps/plugins/sokoban.levels", ".rockbox/rocks/games/sokoban.levels"); # sokoban levels
|
|
|
|
copy("$ROOT/apps/plugins/snake2.levels", ".rockbox/rocks/games/snake2.levels"); # snake2 levels
|
2004-11-20 10:45:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if($image) {
|
|
|
|
# image is blank when this is a simulator
|
|
|
|
if( filesize("rockbox.ucl") > 1000 ) {
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("rockbox.ucl", ".rockbox/rockbox.ucl"); # UCL for flashing
|
2004-11-20 10:45:27 +00:00
|
|
|
}
|
|
|
|
if( filesize("rombox.ucl") > 1000) {
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("rombox.ucl", ".rockbox/rombox.ucl"); # UCL for flashing
|
2004-06-14 15:04:46 +00:00
|
|
|
}
|
2007-01-08 18:21:12 +00:00
|
|
|
|
|
|
|
# Check for rombox.target
|
|
|
|
if ($image=~/(.*)\.(\w+)$/)
|
|
|
|
{
|
|
|
|
my $romfile = "rombox.$2";
|
|
|
|
if (filesize($romfile) > 1000)
|
|
|
|
{
|
2008-07-20 22:20:32 +00:00
|
|
|
copy($romfile, ".rockbox/$romfile");
|
2007-01-08 18:21:12 +00:00
|
|
|
}
|
|
|
|
}
|
2004-05-21 19:05:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mkdir ".rockbox/docs", 0777;
|
2006-03-25 22:52:28 +00:00
|
|
|
for(("COPYING",
|
2006-01-18 20:54:13 +00:00
|
|
|
"LICENSES",
|
2007-06-18 09:32:28 +00:00
|
|
|
"KNOWN_ISSUES"
|
2006-03-25 22:52:28 +00:00
|
|
|
)) {
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("$ROOT/docs/$_", ".rockbox/docs/$_.txt");
|
2004-05-21 19:05:27 +00:00
|
|
|
}
|
2007-06-18 09:32:28 +00:00
|
|
|
if ($fonts) {
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("$ROOT/docs/profontdoc.txt", ".rockbox/docs/profontdoc.txt");
|
2007-06-18 09:32:28 +00:00
|
|
|
}
|
2007-06-19 04:21:06 +00:00
|
|
|
for(("sample.colours",
|
2007-06-18 09:32:28 +00:00
|
|
|
"sample.icons"
|
|
|
|
)) {
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("$ROOT/docs/$_", ".rockbox/docs/$_");
|
2007-06-18 09:32:28 +00:00
|
|
|
}
|
2004-05-21 19:05:27 +00:00
|
|
|
|
2005-11-14 15:06:51 +00:00
|
|
|
# Now do the WPS dance
|
|
|
|
if(-d "$ROOT/wps") {
|
2005-11-14 18:52:17 +00:00
|
|
|
system("perl $ROOT/wps/wpsbuild.pl -r $ROOT $ROOT/wps/WPSLIST $target");
|
2005-11-14 15:06:51 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
print STDERR "No wps module present, can't do the WPS magic!\n";
|
|
|
|
}
|
|
|
|
|
2007-04-20 12:53:40 +00:00
|
|
|
# and the info file
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("rockbox-info.txt", ".rockbox/rockbox-info.txt");
|
2007-04-20 12:53:40 +00:00
|
|
|
|
2008-02-18 12:17:34 +00:00
|
|
|
# copy the already built lng files
|
2008-07-20 22:20:32 +00:00
|
|
|
glob_copy('apps/lang/*lng', '.rockbox/langs/');
|
2004-05-21 19:05:27 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
|
|
|
|
localtime(time);
|
|
|
|
|
|
|
|
$mon+=1;
|
|
|
|
$year+=1900;
|
|
|
|
|
2007-03-12 12:56:35 +00:00
|
|
|
#$date=sprintf("%04d%02d%02d", $year,$mon, $mday);
|
|
|
|
#$shortdate=sprintf("%02d%02d%02d", $year%100,$mon, $mday);
|
2004-05-21 19:05:27 +00:00
|
|
|
|
|
|
|
# made once for all targets
|
|
|
|
sub runone {
|
2007-03-12 10:51:08 +00:00
|
|
|
my ($target, $fonts)=@_;
|
2004-05-21 19:05:27 +00:00
|
|
|
|
2006-05-10 21:57:08 +00:00
|
|
|
# build a full install .rockbox directory
|
2007-03-12 10:51:08 +00:00
|
|
|
buildzip($output, $target, $fonts);
|
2006-05-10 21:57:08 +00:00
|
|
|
|
|
|
|
# create a zip file from the .rockbox dfir
|
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
unlink($output);
|
2006-05-10 21:57:08 +00:00
|
|
|
if($verbose) {
|
2008-07-20 22:20:32 +00:00
|
|
|
print "$ziptool -r $output .rockbox >/dev/null\n";
|
2006-05-10 21:57:08 +00:00
|
|
|
}
|
2008-07-20 22:20:32 +00:00
|
|
|
system("$ziptool -r $output .rockbox >/dev/null");
|
2006-05-10 21:57:08 +00:00
|
|
|
|
2006-05-11 10:31:32 +00:00
|
|
|
if($target && ($fonts != 1)) {
|
2007-03-20 12:00:50 +00:00
|
|
|
# On some targets, rockbox.* is inside .rockbox
|
2007-03-20 12:37:41 +00:00
|
|
|
if($target !~ /(mod|ajz|wma)\z/i) {
|
2008-07-20 22:20:32 +00:00
|
|
|
copy("$target", ".rockbox/$target");
|
2007-03-20 12:00:50 +00:00
|
|
|
$target = ".rockbox/".$target;
|
|
|
|
}
|
|
|
|
|
2006-05-10 21:57:08 +00:00
|
|
|
if($verbose) {
|
2008-07-20 22:20:32 +00:00
|
|
|
print "$ziptool $output $target >/dev/null\n";
|
2006-05-10 21:57:08 +00:00
|
|
|
}
|
2008-07-20 22:20:32 +00:00
|
|
|
system("$ziptool $output $target >/dev/null");
|
2006-05-10 21:57:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# remove the .rockbox afterwards
|
2008-07-20 22:20:32 +00:00
|
|
|
rmtree('.rockbox');
|
2004-05-21 19:05:27 +00:00
|
|
|
};
|
|
|
|
|
2005-02-18 13:47:17 +00:00
|
|
|
if(!$exe) {
|
|
|
|
# not specified, guess!
|
2004-09-15 13:20:49 +00:00
|
|
|
if($target =~ /(recorder|ondio)/i) {
|
2004-06-14 15:04:46 +00:00
|
|
|
$exe = "ajbrec.ajz";
|
|
|
|
}
|
2005-01-31 19:33:39 +00:00
|
|
|
elsif($target =~ /iriver/i) {
|
|
|
|
$exe = "rockbox.iriver";
|
|
|
|
}
|
2004-06-14 15:04:46 +00:00
|
|
|
else {
|
|
|
|
$exe = "archos.mod";
|
|
|
|
}
|
|
|
|
}
|
2005-03-03 22:31:30 +00:00
|
|
|
elsif($exe =~ /rockboxui/) {
|
|
|
|
# simulator, exclude the exe file
|
|
|
|
$exe = "";
|
|
|
|
}
|
2004-06-14 15:04:46 +00:00
|
|
|
|
2007-03-12 10:51:08 +00:00
|
|
|
runone($exe, $incfonts);
|
|
|
|
|
2004-05-21 19:05:27 +00:00
|
|
|
|