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-11-17 10:14:48 +00:00
|
|
|
use strict;
|
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
use File::Copy; # For move() and copy()
|
|
|
|
use File::Find; # For find()
|
2010-07-13 14:17:52 +00:00
|
|
|
use File::Path qw(mkpath rmtree); # For rmtree()
|
2010-12-28 10:30:46 +00:00
|
|
|
use Cwd;
|
2008-07-20 22:20:32 +00:00
|
|
|
use Cwd 'abs_path';
|
2011-02-26 21:30:20 +00:00
|
|
|
use Getopt::Long qw(:config pass_through); # pass_through so not confused by -DTYPE_STUFF
|
2008-11-24 22:16:07 +00:00
|
|
|
|
|
|
|
my $ROOT="..";
|
|
|
|
|
2010-11-14 15:29:11 +00:00
|
|
|
my $ziptool;
|
|
|
|
my $output;
|
2008-11-24 22:16:07 +00:00
|
|
|
my $verbose;
|
2010-07-07 20:31:34 +00:00
|
|
|
my $install;
|
2008-11-24 22:16:07 +00:00
|
|
|
my $exe;
|
|
|
|
my $target;
|
2009-01-31 12:23:35 +00:00
|
|
|
my $modelname;
|
2008-11-24 22:16:07 +00:00
|
|
|
my $incfonts;
|
|
|
|
my $target_id; # passed in, not currently used
|
2010-11-14 15:29:11 +00:00
|
|
|
my $rbdir; # can be non-.rockbox for special builds
|
2010-07-13 14:17:52 +00:00
|
|
|
my $app;
|
2010-12-28 10:30:46 +00:00
|
|
|
my $mklinks;
|
2008-11-24 22:16:07 +00:00
|
|
|
|
2010-07-13 14:17:52 +00:00
|
|
|
sub glob_mkdir {
|
|
|
|
my ($dir) = @_;
|
|
|
|
mkpath ($dir, $verbose, 0777);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub glob_install {
|
|
|
|
my ($_src, $dest, $opts) = @_;
|
|
|
|
|
|
|
|
unless ($opts) {
|
|
|
|
$opts = "-m 0664";
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach my $src (glob($_src)) {
|
|
|
|
unless ( -d $src || !(-e $src)) {
|
2010-07-13 14:53:10 +00:00
|
|
|
system("install $opts \"$src\" \"$dest\"");
|
2010-07-13 14:17:52 +00:00
|
|
|
print "install $opts \"$src\" -> \"$dest\"\n" if $verbose;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
2008-07-20 22:20:32 +00:00
|
|
|
|
|
|
|
sub glob_copy {
|
|
|
|
my ($pattern, $destination) = @_;
|
2008-11-24 22:16:07 +00:00
|
|
|
print "glob_copy: $pattern -> $destination\n" if $verbose;
|
2008-07-20 22:20:32 +00:00
|
|
|
foreach my $path (glob($pattern)) {
|
|
|
|
copy($path, $destination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-21 10:51:34 +00:00
|
|
|
sub glob_move {
|
|
|
|
my ($pattern, $destination) = @_;
|
2008-11-24 22:16:07 +00:00
|
|
|
print "glob_move: $pattern -> $destination\n" if $verbose;
|
2008-07-21 10:51:34 +00:00
|
|
|
foreach my $path (glob($pattern)) {
|
|
|
|
move($path, $destination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
sub glob_unlink {
|
|
|
|
my ($pattern) = @_;
|
2008-11-24 22:16:07 +00:00
|
|
|
print "glob_unlink: $pattern\n" if $verbose;
|
2008-07-20 22:20:32 +00:00
|
|
|
foreach my $path (glob($pattern)) {
|
|
|
|
unlink($path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub find_copyfile {
|
|
|
|
my ($pattern, $destination) = @_;
|
2008-11-24 22:16:07 +00:00
|
|
|
print "find_copyfile: $pattern -> $destination\n" if $verbose;
|
2008-07-20 22:20:32 +00:00
|
|
|
return sub {
|
2008-11-17 10:14:48 +00:00
|
|
|
my $path = $_;
|
2010-12-28 10:30:46 +00:00
|
|
|
my $source = getcwd();
|
2008-11-24 22:16:07 +00:00
|
|
|
if ($path =~ $pattern && filesize($path) > 0 && !($path =~ /$rbdir/)) {
|
2010-12-28 10:30:46 +00:00
|
|
|
if($mklinks) {
|
|
|
|
print "link $path $destination\n" if $verbose;
|
|
|
|
symlink($source.'/'.$path, $destination.'/'.$path);
|
|
|
|
} else {
|
|
|
|
print "cp $path $destination\n" if $verbose;
|
|
|
|
copy($path, $destination);
|
|
|
|
chmod(0755, $destination.'/'.$path);
|
|
|
|
}
|
2008-07-20 22:20:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-13 14:17:52 +00:00
|
|
|
sub find_installfile {
|
|
|
|
my ($pattern, $destination) = @_;
|
|
|
|
print "find_installfile: $pattern -> $destination\n" if $verbose;
|
|
|
|
return sub {
|
|
|
|
my $path = $_;
|
|
|
|
if ($path =~ $pattern) {
|
|
|
|
print "FIND_INSTALLFILE: $path\n";
|
|
|
|
glob_install($path, $destination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sub make_install {
|
|
|
|
my ($src, $dest) = @_;
|
|
|
|
|
|
|
|
my $bindir = $dest;
|
|
|
|
my $libdir = $dest;
|
|
|
|
my $userdir = $dest;
|
|
|
|
|
|
|
|
my @plugins = ( "games", "apps", "demos", "viewers" );
|
|
|
|
my @userstuff = ( "backdrops", "codepages", "docs", "fonts", "langs", "themes", "wps", "eqs", "icons" );
|
|
|
|
my @files = ();
|
|
|
|
|
|
|
|
if ($app) {
|
|
|
|
$bindir .= "/bin";
|
|
|
|
$libdir .= "/lib/rockbox";
|
|
|
|
$userdir .= "/share/rockbox";
|
|
|
|
} else {
|
|
|
|
# for non-app builds we expect the prefix to be the dir above .rockbox
|
2010-09-25 14:47:11 +00:00
|
|
|
$bindir .= "/$rbdir";
|
2010-07-13 14:17:52 +00:00
|
|
|
$libdir = $userdir = $bindir;
|
|
|
|
}
|
|
|
|
if ($dest =~ /\/dev\/null/) {
|
|
|
|
die "ERROR: No PREFIX given\n"
|
|
|
|
}
|
|
|
|
|
2010-12-17 11:41:43 +00:00
|
|
|
if ((!$app) && -e $bindir && -e $src && (abs_path($bindir) eq abs_path($src))) {
|
2010-07-13 14:17:52 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
# binary
|
|
|
|
unless ($exe eq "") {
|
|
|
|
unless (glob_mkdir($bindir)) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
glob_install($exe, $bindir, "-m 0775");
|
|
|
|
}
|
|
|
|
|
|
|
|
# codecs
|
|
|
|
unless (glob_mkdir("$libdir/codecs")) {
|
|
|
|
return 0;
|
|
|
|
}
|
2011-05-31 21:26:18 +00:00
|
|
|
# Android has codecs installed as native libraries so they are not needed
|
|
|
|
# in the zip.
|
|
|
|
if ($modelname !~ /android/) {
|
|
|
|
glob_install("$src/codecs/*", "$libdir/codecs", "-m 0755");
|
|
|
|
}
|
2010-07-13 14:17:52 +00:00
|
|
|
|
|
|
|
# plugins
|
|
|
|
unless (glob_mkdir("$libdir/rocks")) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
foreach my $t (@plugins) {
|
|
|
|
unless (glob_mkdir("$libdir/rocks/$t")) {
|
|
|
|
return 0;
|
|
|
|
}
|
2010-08-29 12:29:34 +00:00
|
|
|
glob_install("$src/rocks/$t/*", "$libdir/rocks/$t", "-m 0755");
|
2010-07-13 14:17:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# rocks/viewers/lua
|
|
|
|
unless (glob_mkdir("$libdir/rocks/viewers/lua")) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
glob_install("$src/rocks/viewers/lua/*", "$libdir/rocks/viewers/lua");
|
|
|
|
|
|
|
|
# all the rest directories
|
|
|
|
foreach my $t (@userstuff) {
|
|
|
|
unless (glob_mkdir("$userdir/$t")) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
glob_install("$src/$t/*", "$userdir/$t");
|
|
|
|
}
|
|
|
|
|
|
|
|
# wps/ subfolders and bitmaps
|
|
|
|
opendir(DIR, $src . "/wps");
|
|
|
|
@files = readdir(DIR);
|
|
|
|
closedir(DIR);
|
|
|
|
|
|
|
|
foreach my $_dir (@files) {
|
|
|
|
my $dir = "wps/" . $_dir;
|
|
|
|
if ( -d "$src/$dir" && $_dir !~ /\.\.?/) {
|
|
|
|
unless (glob_mkdir("$userdir/$dir")) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
glob_install("$src/$dir/*", "$userdir/$dir");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# rest of the files, excluding the binary
|
|
|
|
opendir(DIR,$src);
|
|
|
|
@files = readdir(DIR);
|
|
|
|
closedir(DIR);
|
|
|
|
|
Initial commit of the Samsung YP-R0 port.
This port is a hybrid native/RaaA port. It runs on a embedded linux system,
but is the only application. It therefore can implement lots of stuff that
native targets also implement, while leveraging the underlying linux kernel.
The port is quite advanced. User interface, audio playback, plugins work
mostly fine. Missing is e.g. power mangement and USB (see SamsungYPR0 wiki page).
Included in utils/ypr0tools are scripts and programs required to generate
a patched firmware. The patched firmware has the rootfs modified to load
Rockbox. It includes a early/safe USB mode.
This port needs a new toolchain, one that includes glibc headers and libraries.
rockboxdev.sh can generate it, but e.g. codesourcey and distro packages may
also work.
Most of the initial effort is done by Lorenzo Miori and others (on ABI),
including reverse engineering and patching of the original firmware,
initial drivers, and more. Big thanks to you.
Flyspray: FS#12348
Author: Lorenzo Miori, myself
Merry christmas to ypr0 owners! :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31415 a1c6a512-1295-4272-9138-f99709370657
2011-12-24 11:56:46 +00:00
|
|
|
foreach my $file (grep (/[a-zA-Z]+\.(txt|config|ignore|sh)/,@files)) {
|
2010-07-13 14:17:52 +00:00
|
|
|
glob_install("$src/$file", "$userdir/");
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-11-17 10:14:48 +00:00
|
|
|
# Get options
|
2011-02-26 21:30:20 +00:00
|
|
|
GetOptions ( 'r|root=s' => \$ROOT,
|
|
|
|
'z|ziptool:s' => \$ziptool,
|
|
|
|
'm|modelname=s' => \$modelname, # The model name as used in ARCHOS in the root makefile
|
|
|
|
'i|id=s' => \$target_id, # The target id name as used in TARGET_ID in the root makefile
|
|
|
|
'o|output:s' => \$output,
|
|
|
|
'f|fonts=s' => \$incfonts, # 0 - no fonts, 1 - fonts only 2 - fonts and package
|
|
|
|
'v|verbose' => \$verbose,
|
|
|
|
'install=s' => \$install, # install destination
|
|
|
|
'rbdir:s' => \$rbdir, # If we want to put in a different directory
|
|
|
|
'l|link' => \$mklinks, # If we want to create links instead of copying files
|
2011-02-27 11:37:39 +00:00
|
|
|
'a|app:s' => \$app, # Is this an Application build?
|
2008-11-24 22:16:07 +00:00
|
|
|
);
|
2005-12-13 10:20:23 +00:00
|
|
|
|
2010-11-14 15:29:11 +00:00
|
|
|
# GetOptions() doesn't remove the params from @ARGV if their value was ""
|
|
|
|
# Thus we use the ":" for those for which we use a default value in case of ""
|
|
|
|
# and assign the default value afterwards
|
|
|
|
if ($ziptool eq '') {
|
|
|
|
$ziptool = "zip -r9";
|
|
|
|
}
|
|
|
|
if ($output eq '') {
|
|
|
|
$output = "rockbox.zip"
|
|
|
|
}
|
|
|
|
if ($rbdir eq '') {
|
|
|
|
$rbdir = ".rockbox";
|
|
|
|
}
|
|
|
|
|
|
|
|
# Now @ARGV shuold be free of any left-overs GetOptions left
|
2008-11-17 10:14:48 +00:00
|
|
|
($target, $exe) = @ARGV;
|
2004-08-24 15:13:08 +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
|
2009-05-23 07:55:14 +00:00
|
|
|
LCD Width: LCD_WIDTH
|
|
|
|
LCD Height: LCD_HEIGHT
|
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|");
|
|
|
|
|
2009-05-23 07:55:14 +00:00
|
|
|
my ($bitmap, $width, $height, $depth, $swcodec, $icon_h, $icon_w);
|
2007-04-16 09:14:36 +00:00
|
|
|
my ($remote_depth, $remote_icon_h, $remote_icon_w);
|
2007-05-29 08:17:32 +00:00
|
|
|
my ($recording);
|
2008-11-17 10:14:48 +00:00
|
|
|
my $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;
|
|
|
|
}
|
2009-05-23 07:55:14 +00:00
|
|
|
elsif($_ =~ /^LCD Width: (\d*)/) {
|
|
|
|
$width = $1;
|
|
|
|
}
|
|
|
|
elsif($_ =~ /^LCD Height: (\d*)/) {
|
|
|
|
$height = $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");
|
|
|
|
|
2009-05-23 07:55:14 +00:00
|
|
|
return ($bitmap, $depth, $width, $height, $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;
|
|
|
|
}
|
|
|
|
|
2010-09-14 11:56:50 +00:00
|
|
|
sub create_failsafefiles {
|
2010-10-13 23:10:22 +00:00
|
|
|
my ($dir, $remote_depth) = @_;
|
2010-09-14 11:56:50 +00:00
|
|
|
my $text = "# Dummy file to allow Rockbox to reset to the default skin config.
|
|
|
|
# Do not edit this file. It's never actually loaded by Rockbox.";
|
|
|
|
open (FOO, ">$dir/wps/rockbox_failsafe.wps");
|
|
|
|
print FOO $text;
|
|
|
|
close(FOO);
|
|
|
|
open (FOO, ">$dir/wps/rockbox_failsafe.sbs");
|
|
|
|
print FOO $text;
|
|
|
|
close(FOO);
|
|
|
|
open (FOO, ">$dir/wps/rockbox_failsafe.fms");
|
|
|
|
print FOO $text;
|
|
|
|
close(FOO);
|
2010-10-13 23:10:22 +00:00
|
|
|
if ($remote_depth) {
|
|
|
|
open (FOO, ">$dir/wps/rockbox_failsafe.rwps");
|
|
|
|
print FOO $text;
|
|
|
|
close(FOO);
|
|
|
|
open (FOO, ">$dir/wps/rockbox_failsafe.rsbs");
|
|
|
|
print FOO $text;
|
|
|
|
close(FOO);
|
|
|
|
open (FOO, ">$dir/wps/rockbox_failsafe.rfms");
|
|
|
|
print FOO $text;
|
|
|
|
close(FOO);
|
|
|
|
}
|
2010-09-14 11:56:50 +00:00
|
|
|
open (FOO, ">$dir/themes/rockbox_failsafe.cfg");
|
|
|
|
print FOO <<STOP
|
|
|
|
# This config has been autogenerated to reload the failsafe setup
|
|
|
|
wps: $dir/wps/rockbox_failsafe.wps
|
|
|
|
sbs: $dir/wps/rockbox_failsafe.sbs
|
|
|
|
fms: $dir/wps/rockbox_failsafe.fms
|
2010-10-13 23:10:22 +00:00
|
|
|
STOP
|
|
|
|
;
|
|
|
|
if ($remote_depth) {
|
|
|
|
print FOO <<STOP
|
|
|
|
rwps: $dir/wps/rockbox_failsafe.rwps
|
|
|
|
rsbs: $dir/wps/rockbox_failsafe.rsbs
|
2010-09-14 11:56:50 +00:00
|
|
|
rfms: $dir/wps/rockbox_failsafe.rfms
|
2010-10-13 23:10:22 +00:00
|
|
|
STOP
|
|
|
|
;
|
|
|
|
}
|
|
|
|
print FOO <<STOP
|
2010-09-14 11:56:50 +00:00
|
|
|
statusbar: top
|
|
|
|
font: 08-Schumacher-Clean.fnt
|
|
|
|
foreground color: 000000
|
|
|
|
background color: B6C6E5
|
|
|
|
selector type: bar (inverse)
|
2012-01-25 08:22:07 +00:00
|
|
|
backdrop: -
|
2010-09-14 11:56:50 +00:00
|
|
|
STOP
|
|
|
|
;
|
|
|
|
close(FOO);
|
|
|
|
}
|
|
|
|
|
2004-05-21 19:05:27 +00:00
|
|
|
sub buildzip {
|
2010-07-13 14:17:52 +00:00
|
|
|
my ($image, $fonts)=@_;
|
|
|
|
my $libdir = $install;
|
2010-07-25 13:44:30 +00:00
|
|
|
my $temp_dir = ".rockbox";
|
2007-03-12 10:51:08 +00:00
|
|
|
|
2008-11-24 22:16:07 +00:00
|
|
|
print "buildzip: image=$image fonts=$fonts\n" if $verbose;
|
|
|
|
|
2009-05-23 07:55:14 +00:00
|
|
|
my ($bitmap, $depth, $width, $height, $icon_w, $icon_h, $recording,
|
|
|
|
$swcodec, $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
|
2010-07-25 13:44:30 +00:00
|
|
|
rmtree($temp_dir);
|
2004-05-21 19:05:27 +00:00
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir($temp_dir);
|
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;
|
|
|
|
}
|
2006-05-10 21:57:08 +00:00
|
|
|
if($fonts) {
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/fonts");
|
|
|
|
chdir "$temp_dir/fonts";
|
2008-11-17 10:14:48 +00:00
|
|
|
my $cmd = "$ROOT/tools/convbdf -f $ROOT/fonts/*bdf >/dev/null 2>&1";
|
2008-07-20 23:16:39 +00:00
|
|
|
print($cmd."\n") if $verbose;
|
2008-07-20 23:12:03 +00:00
|
|
|
system($cmd);
|
|
|
|
chdir("../../");
|
2006-05-10 21:57:08 +00:00
|
|
|
|
|
|
|
if($fonts < 2) {
|
|
|
|
# fonts-only package, return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-26 23:41:52 +00:00
|
|
|
# create the file so the database does not try indexing a folder
|
2010-07-25 13:44:30 +00:00
|
|
|
open(IGNORE, ">$temp_dir/database.ignore") || die "can't open database.ignore";
|
2008-08-26 23:41:52 +00:00
|
|
|
close(IGNORE);
|
Initial commit of the Samsung YP-R0 port.
This port is a hybrid native/RaaA port. It runs on a embedded linux system,
but is the only application. It therefore can implement lots of stuff that
native targets also implement, while leveraging the underlying linux kernel.
The port is quite advanced. User interface, audio playback, plugins work
mostly fine. Missing is e.g. power mangement and USB (see SamsungYPR0 wiki page).
Included in utils/ypr0tools are scripts and programs required to generate
a patched firmware. The patched firmware has the rootfs modified to load
Rockbox. It includes a early/safe USB mode.
This port needs a new toolchain, one that includes glibc headers and libraries.
rockboxdev.sh can generate it, but e.g. codesourcey and distro packages may
also work.
Most of the initial effort is done by Lorenzo Miori and others (on ABI),
including reverse engineering and patching of the original firmware,
initial drivers, and more. Big thanks to you.
Flyspray: FS#12348
Author: Lorenzo Miori, myself
Merry christmas to ypr0 owners! :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31415 a1c6a512-1295-4272-9138-f99709370657
2011-12-24 11:56:46 +00:00
|
|
|
|
|
|
|
# the samsung ypr0 has a loader script that's needed in the zip
|
|
|
|
if ($modelname =~ /samsungypr0/) {
|
|
|
|
glob_copy("$ROOT/utils/ypr0tools/rockbox.sh", "$temp_dir/");
|
|
|
|
}
|
2012-05-19 09:00:16 +00:00
|
|
|
# add .nomedia on Android
|
|
|
|
# in the zip.
|
|
|
|
if ($modelname =~ /android/) {
|
|
|
|
open(NOMEDIA, ">$temp_dir/.nomedia") || die "can't open .nomedia";
|
|
|
|
close(NOMEDIA);
|
|
|
|
}
|
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/langs");
|
|
|
|
glob_mkdir("$temp_dir/rocks");
|
|
|
|
glob_mkdir("$temp_dir/rocks/games");
|
|
|
|
glob_mkdir("$temp_dir/rocks/apps");
|
|
|
|
glob_mkdir("$temp_dir/rocks/demos");
|
|
|
|
glob_mkdir("$temp_dir/rocks/viewers");
|
2007-08-06 13:42:52 +00:00
|
|
|
|
2007-05-29 08:17:32 +00:00
|
|
|
if ($recording) {
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/recpresets");
|
2007-05-29 08:17:32 +00:00
|
|
|
}
|
2007-03-12 10:51:08 +00:00
|
|
|
|
|
|
|
if($swcodec) {
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/eqs");
|
2006-03-18 21:17:35 +00:00
|
|
|
|
2011-06-24 05:25:21 +00:00
|
|
|
glob_copy("$ROOT/lib/rbcodec/dsp/eqs/*.cfg", "$temp_dir/eqs/"); # equalizer presets
|
2007-03-12 10:51:08 +00:00
|
|
|
}
|
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/wps");
|
|
|
|
glob_mkdir("$temp_dir/themes");
|
2007-04-16 14:33:29 +00:00
|
|
|
if ($bitmap) {
|
2010-07-25 13:44:30 +00:00
|
|
|
open(THEME, ">$temp_dir/themes/rockbox_default_icons.cfg");
|
2007-04-16 14:33:29 +00:00
|
|
|
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
|
2008-11-24 22:16:07 +00:00
|
|
|
viewers iconset: /$rbdir/icons/viewers.bmp
|
2007-04-16 14:33:29 +00:00
|
|
|
remote iconset: -
|
|
|
|
# taken from apps/gui/icon.c
|
2008-11-24 22:16:07 +00:00
|
|
|
remote viewers iconset: /$rbdir/icons/remote_viewers.bmp
|
2007-04-16 14:33:29 +00:00
|
|
|
|
|
|
|
STOP
|
|
|
|
;
|
|
|
|
close(THEME);
|
|
|
|
}
|
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/codepages");
|
2007-04-01 13:09:22 +00:00
|
|
|
|
|
|
|
if($bitmap) {
|
|
|
|
system("$ROOT/tools/codepages");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
system("$ROOT/tools/codepages -m");
|
|
|
|
}
|
2008-07-20 22:20:32 +00:00
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_move('*.cp', "$temp_dir/codepages/");
|
2007-03-12 10:51:08 +00:00
|
|
|
|
2010-07-13 14:17:52 +00:00
|
|
|
if($bitmap && $depth > 1) {
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/backdrops");
|
2010-07-13 14:17:52 +00:00
|
|
|
}
|
2006-10-12 20:48:40 +00:00
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/codecs");
|
2006-03-18 21:17:35 +00:00
|
|
|
|
2011-05-31 21:26:18 +00:00
|
|
|
# Android has codecs installed as native libraries so they are not needed
|
|
|
|
# in the zip.
|
|
|
|
if ($modelname !~ /android/) {
|
2011-06-26 01:32:25 +00:00
|
|
|
find(find_copyfile(qr/.*\.codec/, abs_path("$temp_dir/codecs/")), 'lib/rbcodec/codecs');
|
2011-05-31 21:26:18 +00:00
|
|
|
}
|
2010-07-13 14:17:52 +00:00
|
|
|
|
|
|
|
# remove directory again if no codec was copied
|
2010-07-25 13:44:30 +00:00
|
|
|
rmdir("$temp_dir/codecs");
|
2005-08-11 20:48:34 +00:00
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
find(find_copyfile(qr/\.(rock|ovl|lua)/, abs_path("$temp_dir/rocks/")), 'apps/plugins');
|
2004-05-21 19:05:27 +00:00
|
|
|
|
2010-11-21 13:47:56 +00:00
|
|
|
# exclude entries for the image file types not supported by the imageviewer for the target.
|
|
|
|
my $viewers = "$ROOT/apps/plugins/viewers.config";
|
|
|
|
my $c="cat $viewers | gcc $cppdef -I. -I$firmdir/export -E -P -include config.h -";
|
|
|
|
|
|
|
|
open VIEWERS, "$c|" or die "can't open viewers.config";
|
2008-11-17 10:14:48 +00:00
|
|
|
my @viewers = <VIEWERS>;
|
2004-07-13 09:45:39 +00:00
|
|
|
close VIEWERS;
|
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
open VIEWERS, ">$temp_dir/viewers.config" or
|
|
|
|
die "can't create $temp_dir/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";
|
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
if(-e "$temp_dir/rocks/$name") {
|
2005-10-05 08:02:10 +00:00
|
|
|
if($dir ne "rocks") {
|
|
|
|
# target is not 'rocks' but the plugins are always in that
|
|
|
|
# dir at first!
|
2010-07-25 13:44:30 +00:00
|
|
|
move("$temp_dir/rocks/$name", "$temp_dir/rocks/$r");
|
2005-10-05 08:02:10 +00:00
|
|
|
}
|
|
|
|
print VIEWERS $line;
|
2004-05-21 21:01:20 +00:00
|
|
|
}
|
2010-07-25 13:44:30 +00:00
|
|
|
elsif(-e "$temp_dir/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
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
if(-e "$temp_dir/rocks/$oname") {
|
2005-03-04 08:19:56 +00:00
|
|
|
# if there's an "overlay" file for the .rock, move that as
|
|
|
|
# well
|
2010-07-25 13:44:30 +00:00
|
|
|
move("$temp_dir/rocks/$oname", "$temp_dir/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;
|
2008-11-17 10:14:48 +00:00
|
|
|
|
2007-08-06 13:42:52 +00:00
|
|
|
open CATEGORIES, "$ROOT/apps/plugins/CATEGORIES" or
|
|
|
|
die "can't open CATEGORIES";
|
2008-11-17 10:14:48 +00:00
|
|
|
my @rock_targetdirs = <CATEGORIES>;
|
2007-08-06 13:42:52 +00:00
|
|
|
close CATEGORIES;
|
|
|
|
foreach my $line (@rock_targetdirs) {
|
|
|
|
if ($line =~ /([^,]*),(.*)/) {
|
|
|
|
my ($plugin, $dir)=($1, $2);
|
2010-07-25 13:44:30 +00:00
|
|
|
move("$temp_dir/rocks/${plugin}.rock", "$temp_dir/rocks/$dir/${plugin}.rock");
|
|
|
|
if(-e "$temp_dir/rocks/${plugin}.ovl") {
|
2009-05-07 01:23:13 +00:00
|
|
|
# if there's an "overlay" file for the .rock, move that as
|
|
|
|
# well
|
2010-07-25 13:44:30 +00:00
|
|
|
move("$temp_dir/rocks/${plugin}.ovl", "$temp_dir/rocks/$dir");
|
2009-05-07 01:23:13 +00:00
|
|
|
}
|
2010-07-25 13:44:30 +00:00
|
|
|
if(-e "$temp_dir/rocks/${plugin}.lua") {
|
2009-10-28 23:05:02 +00:00
|
|
|
# if this is a lua script, move it to the appropriate dir
|
2010-07-25 13:44:30 +00:00
|
|
|
move("$temp_dir/rocks/${plugin}.lua", "$temp_dir/rocks/$dir/");
|
2009-10-28 23:05:02 +00:00
|
|
|
}
|
2007-08-06 13:42:52 +00:00
|
|
|
}
|
|
|
|
}
|
2008-11-17 10:14:48 +00:00
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_unlink("$temp_dir/rocks/*.lua"); # Clean up unwanted *.lua files (e.g. actions.lua, buttons.lua)
|
2009-10-28 23:05:02 +00:00
|
|
|
|
2007-04-16 09:14:36 +00:00
|
|
|
if ($bitmap) {
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/icons");
|
|
|
|
copy("$viewer_bmpdir/viewers.${icon_w}x${icon_h}x$depth.bmp", "$temp_dir/icons/viewers.bmp");
|
2007-04-16 09:14:36 +00:00
|
|
|
if ($remote_depth) {
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("$viewer_bmpdir/remote_viewers.${remote_icon_w}x${remote_icon_h}x$remote_depth.bmp", "$temp_dir/icons/remote_viewers.bmp");
|
2007-04-16 09:14:36 +00:00
|
|
|
}
|
|
|
|
}
|
2008-11-17 10:14:48 +00:00
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("$ROOT/apps/tagnavi.config", "$temp_dir/");
|
|
|
|
copy("$ROOT/apps/plugins/disktidy.config", "$temp_dir/rocks/apps/");
|
2008-11-17 10:14:48 +00:00
|
|
|
|
2007-03-12 10:51:08 +00:00
|
|
|
if($bitmap) {
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("$ROOT/apps/plugins/sokoban.levels", "$temp_dir/rocks/games/sokoban.levels"); # sokoban levels
|
|
|
|
copy("$ROOT/apps/plugins/snake2.levels", "$temp_dir/rocks/games/snake2.levels"); # snake2 levels
|
|
|
|
copy("$ROOT/apps/plugins/rockbox-fonts.config", "$temp_dir/rocks/viewers/");
|
2004-11-20 10:45:27 +00:00
|
|
|
}
|
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
if(-e "$temp_dir/rocks/demos/pictureflow.rock") {
|
2009-05-23 07:55:14 +00:00
|
|
|
copy("$ROOT/apps/plugins/bitmaps/native/pictureflow_emptyslide.100x100x16.bmp",
|
2010-07-25 13:44:30 +00:00
|
|
|
"$temp_dir/rocks/demos/pictureflow_emptyslide.bmp");
|
2009-05-23 07:55:14 +00:00
|
|
|
my ($pf_logo);
|
|
|
|
if ($width < 200) {
|
|
|
|
$pf_logo = "pictureflow_logo.100x18x16.bmp";
|
|
|
|
} else {
|
|
|
|
$pf_logo = "pictureflow_logo.193x34x16.bmp";
|
|
|
|
}
|
|
|
|
copy("$ROOT/apps/plugins/bitmaps/native/$pf_logo",
|
2010-07-25 13:44:30 +00:00
|
|
|
"$temp_dir/rocks/demos/pictureflow_splash.bmp");
|
2009-05-23 07:55:14 +00:00
|
|
|
|
2008-12-27 00:26:15 +00:00
|
|
|
}
|
2010-10-13 23:10:22 +00:00
|
|
|
create_failsafefiles($temp_dir, $remote_depth);
|
2008-12-27 00:26:15 +00:00
|
|
|
|
2004-11-20 10:45:27 +00:00
|
|
|
if($image) {
|
|
|
|
# image is blank when this is a simulator
|
|
|
|
if( filesize("rockbox.ucl") > 1000 ) {
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("rockbox.ucl", "$temp_dir/rockbox.ucl"); # UCL for flashing
|
2004-11-20 10:45:27 +00:00
|
|
|
}
|
|
|
|
if( filesize("rombox.ucl") > 1000) {
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("rombox.ucl", "$temp_dir/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)
|
|
|
|
{
|
2010-07-25 13:44:30 +00:00
|
|
|
copy($romfile, "$temp_dir/$romfile");
|
2007-01-08 18:21:12 +00:00
|
|
|
}
|
|
|
|
}
|
2004-05-21 19:05:27 +00:00
|
|
|
}
|
|
|
|
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/docs");
|
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
|
|
|
)) {
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("$ROOT/docs/$_", "$temp_dir/docs/$_.txt");
|
2004-05-21 19:05:27 +00:00
|
|
|
}
|
2007-06-18 09:32:28 +00:00
|
|
|
if ($fonts) {
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("$ROOT/docs/profontdoc.txt", "$temp_dir/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"
|
|
|
|
)) {
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("$ROOT/docs/$_", "$temp_dir/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") {
|
2011-02-26 21:30:20 +00:00
|
|
|
my $wps_build_cmd="perl $ROOT/wps/wpsbuild.pl ";
|
|
|
|
$wps_build_cmd=$wps_build_cmd."-v " if $verbose;
|
|
|
|
$wps_build_cmd=$wps_build_cmd." --tempdir=$temp_dir --rbdir=$rbdir -r $ROOT -m $modelname $ROOT/wps/WPSLIST $target";
|
|
|
|
print "wpsbuild: $wps_build_cmd\n" if $verbose;
|
2008-11-24 22:16:07 +00:00
|
|
|
system("$wps_build_cmd");
|
2011-02-26 21:30:20 +00:00
|
|
|
print "wps_build_cmd: done\n" if $verbose;
|
2005-11-14 15:06:51 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
print STDERR "No wps module present, can't do the WPS magic!\n";
|
|
|
|
}
|
2009-11-16 03:53:49 +00:00
|
|
|
|
|
|
|
# until buildwps.pl is fixed, manually copy the classic_statusbar theme across
|
2010-07-25 13:44:30 +00:00
|
|
|
mkdir "$temp_dir/wps/classic_statusbar", 0777;
|
|
|
|
glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$temp_dir/wps/classic_statusbar");
|
2009-11-16 03:53:49 +00:00
|
|
|
if ($swcodec) {
|
2011-02-26 21:30:20 +00:00
|
|
|
if ($depth == 16) {
|
|
|
|
copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps");
|
|
|
|
} elsif ($depth > 1) {
|
|
|
|
copy("$ROOT/wps/classic_statusbar.grey.sbs", "$temp_dir/wps/classic_statusbar.sbs");
|
|
|
|
} else {
|
|
|
|
copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.sbs");
|
|
|
|
}
|
2009-11-16 03:53:49 +00:00
|
|
|
} else {
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("$ROOT/wps/classic_statusbar.112x64x1.sbs", "$temp_dir/wps/classic_statusbar.sbs");
|
2009-11-16 03:53:49 +00:00
|
|
|
}
|
2009-11-20 07:05:22 +00:00
|
|
|
if ($remote_depth != $depth) {
|
2011-02-26 21:30:20 +00:00
|
|
|
copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.rsbs");
|
|
|
|
} else {
|
|
|
|
copy("$temp_dir/wps/classic_statusbar.sbs", "$temp_dir/wps/classic_statusbar.rsbs");
|
|
|
|
}
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("$temp_dir/wps/rockbox_none.sbs", "$temp_dir/wps/rockbox_none.rsbs");
|
2005-11-14 15:06:51 +00:00
|
|
|
|
2007-04-20 12:53:40 +00:00
|
|
|
# and the info file
|
2010-07-25 13:44:30 +00:00
|
|
|
copy("rockbox-info.txt", "$temp_dir/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
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_copy('apps/lang/*lng', "$temp_dir/langs/");
|
2004-05-21 19:05:27 +00:00
|
|
|
|
2009-05-21 21:58:18 +00:00
|
|
|
# copy the .lua files
|
2010-07-25 13:44:30 +00:00
|
|
|
glob_mkdir("$temp_dir/rocks/viewers/lua/");
|
|
|
|
glob_copy('apps/plugins/lua/*.lua', "$temp_dir/rocks/viewers/lua/");
|
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)=@_;
|
2010-07-07 18:30:17 +00:00
|
|
|
|
2011-02-26 21:23:20 +00:00
|
|
|
# Strip the leading / from $rbdir unless we are installing an application
|
|
|
|
# build - the layout is different (no .rockbox, but bin/lib/share)
|
|
|
|
unless ($app && $install) {
|
2010-08-01 16:15:27 +00:00
|
|
|
$rbdir = substr($rbdir, 1);
|
|
|
|
}
|
2010-07-13 14:17:52 +00:00
|
|
|
|
2008-11-24 22:16:07 +00:00
|
|
|
# build a full install .rockbox ($rbdir) directory
|
2008-08-26 22:00:37 +00:00
|
|
|
buildzip($target, $fonts);
|
2006-05-10 21:57:08 +00:00
|
|
|
|
2008-07-20 22:20:32 +00:00
|
|
|
unlink($output);
|
2008-08-26 23:21:20 +00:00
|
|
|
|
|
|
|
if($fonts == 1) {
|
|
|
|
# Don't include image file in fonts-only package
|
|
|
|
undef $target;
|
|
|
|
}
|
|
|
|
if($target && ($target !~ /(mod|ajz|wma)\z/i)) {
|
|
|
|
# On some targets, the image goes into .rockbox.
|
2010-09-25 14:47:11 +00:00
|
|
|
copy("$target", ".rockbox/$target");
|
2008-08-26 23:21:20 +00:00
|
|
|
undef $target;
|
2006-05-10 21:57:08 +00:00
|
|
|
}
|
|
|
|
|
2009-04-12 01:28:33 +00:00
|
|
|
if($install) {
|
2010-12-28 10:30:46 +00:00
|
|
|
if($mklinks) {
|
|
|
|
my $cwd = getcwd();
|
|
|
|
symlink("$cwd/.rockbox", "$install/.rockbox");
|
|
|
|
print "link .rockbox $install\n" if $verbose;
|
|
|
|
} else {
|
|
|
|
make_install(".rockbox", $install) or die "MKDIRFAILED\n";
|
|
|
|
rmtree(".rockbox");
|
|
|
|
print "rm .rockbox\n" if $verbose;
|
|
|
|
}
|
2008-11-04 10:47:48 +00:00
|
|
|
}
|
|
|
|
else {
|
2010-07-13 14:17:52 +00:00
|
|
|
unless (".rockbox" eq $rbdir) {
|
2010-08-02 20:34:47 +00:00
|
|
|
mkpath($rbdir);
|
|
|
|
rmtree($rbdir);
|
2010-07-13 14:17:52 +00:00
|
|
|
move(".rockbox", $rbdir);
|
|
|
|
print "mv .rockbox $rbdir\n" if $verbose;
|
|
|
|
}
|
2008-11-24 22:16:07 +00:00
|
|
|
system("$ziptool $output $rbdir $target >/dev/null");
|
2010-07-13 14:17:52 +00:00
|
|
|
print "$ziptool $output $rbdir $target >/dev/null\n" if $verbose;
|
2010-09-25 14:47:11 +00:00
|
|
|
rmtree("$rbdir");
|
|
|
|
print "rm $rbdir\n" if $verbose;
|
2008-11-04 10:47:48 +00:00
|
|
|
}
|
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";
|
|
|
|
}
|
|
|
|
}
|
2010-07-13 14:17:52 +00:00
|
|
|
elsif(($exe =~ /rockboxui/)) {
|
2005-03-03 22:31:30 +00:00
|
|
|
# simulator, exclude the exe file
|
|
|
|
$exe = "";
|
|
|
|
}
|
2010-09-26 10:32:43 +00:00
|
|
|
elsif($exe eq "librockbox.so") {
|
|
|
|
# android, exclude the binary
|
|
|
|
$exe="";
|
|
|
|
}
|
2004-06-14 15:04:46 +00:00
|
|
|
|
2007-03-12 10:51:08 +00:00
|
|
|
runone($exe, $incfonts);
|
|
|
|
|