[Mud-builder-commits] r320 - in trunk: . lib/MUD
jaffa at garage.maemo.org
jaffa at garage.maemo.org
Mon Sep 21 19:00:32 EEST 2009
Author: jaffa
Date: 2009-09-21 19:00:31 +0300 (Mon, 21 Sep 2009)
New Revision: 320
Modified:
trunk/lib/MUD/Build.pm
trunk/lib/MUD/Package.pm
trunk/mud
Log:
Add optify support; some basic SDK heuristics; 48x48 icon support
Modified: trunk/lib/MUD/Build.pm
===================================================================
--- trunk/lib/MUD/Build.pm 2009-09-19 22:22:59 UTC (rev 319)
+++ trunk/lib/MUD/Build.pm 2009-09-21 16:00:31 UTC (rev 320)
@@ -225,6 +225,10 @@
# -- Include dh_install...
#
$rules =~ s/^\s*#\s*dh_install\s*$/\tdh_install --sourcedir=debian\/tmp/mg;
+
+ # -- Include maemo-optify...
+ #
+ $rules =~ s/^\tdh_gencontrol$/$&\n\tmaemo-optify/mg if $self->{data}->optify;
# -- Append configure flags...
#
@@ -529,7 +533,7 @@
# -- Icon(s)...
#
- my $iconFile = $self->{data}->icon(26);
+ my $iconFile = $self->{data}->icon($self->{data}->{sdk} eq 'fremantle' ? 48 : 26);
if ($iconFile and $control !~ /^XB-Maemo-Icon-26:/im) {
my $iconData = `uuencode -m icon <\Q${iconFile}\E`;
$iconData =~ s/^begin-base64 \d{3,4} icon[\s\r\n]+//m;
Modified: trunk/lib/MUD/Package.pm
===================================================================
--- trunk/lib/MUD/Package.pm 2009-09-19 22:22:59 UTC (rev 319)
+++ trunk/lib/MUD/Package.pm 2009-09-21 16:00:31 UTC (rev 320)
@@ -223,6 +223,7 @@
copy($sourceIcon, $iconFile) or die "copy failed: $!" unless -s $iconFile;
}
+ print "Icon for ${size}x${size} = [$iconFile]\n";
return undef unless $iconFile and -s $iconFile;
return $iconFile;
}
@@ -299,6 +300,21 @@
}
+=item optify
+
+Return true if the package should be automatically "optified". This
+will introduce a build-dependency on 'maemo-optify' and ensure the
+optification happens after the package has been built.
+
+=cut
+
+sub optify {
+ my $self = shift;
+
+ return $self->{data}->{deb}->{'optify'};
+}
+
+
=item controlFields
Return a hash reference of values which contain additional
@@ -318,7 +334,7 @@
# -- Generate...
#
my %data = map { $_ => $self->{data}->{deb}->{$_} }
- grep { $_ !~ /^(icon|prefix-section|library|libdev|upgrade-description|description|display-name|version)$/ }
+ grep { $_ !~ /^(icon|prefix-section|optify|library|libdev|upgrade-description|description|display-name|version|bugtracker)$/ }
keys %{ $self->{data}->{deb} };
$self->{controlFields} = \%data;
return $self->{controlFields};
@@ -376,6 +392,8 @@
=item I<package>-26.png =E<gt> C</usr/share/icons/hicolor/26x26/hildon/I<package>.png>
+=item I<package>-48.png =E<gt> C</usr/share/icons/hicolor/48x48/hildon/I<package>.png>
+
=item I<package>-64.png =E<gt> C</usr/share/icons/hicolor/scalable/hildon/I<package>.png>
=item I<package>.desktop =E<gt> C</usr/share/applications/hildon/I<package>.desktop>
@@ -400,6 +418,7 @@
if (-f (my $desktop = $self->{basedir}."$self->{name}.desktop")) {
push @extras, new MUD::ExtrasEntry($desktop, { path => "/usr/share/applications/hildon/$self->{name}.desktop"} );
push @extras, new MUD::ExtrasEntry($self->icon(26), { path => "/usr/share/icons/hicolor/26x26/hildon/$self->{name}.png"} );
+ push @extras, new MUD::ExtrasEntry($self->icon(48), { path => "/usr/share/icons/hicolor/48x48/hildon/$self->{name}.png"} );
push @extras, new MUD::ExtrasEntry($self->icon(64), { path => "/usr/share/icons/hicolor/scalable/hildon/$self->{name}.png"} );
if (-f (my $service = $self->{basedir}."$self->{name}.service")) {
Modified: trunk/mud
===================================================================
--- trunk/mud 2009-09-19 22:22:59 UTC (rev 319)
+++ trunk/mud 2009-09-21 16:00:31 UTC (rev 320)
@@ -68,6 +68,20 @@
exit;
}
+if (!$OPTS{sdk}) {
+ if (open(IN, "</etc/maemo_version")) {
+ chomp(my $line = <IN>);
+ my ($sdk) = $line =~ /^([\d\.]+)/;
+
+ $OPTS{sdk} = $sdk == 5.0 ? 'fremantle'
+ : $sdk == 4.1 ? 'diablo'
+ : $sdk == 4.0 ? 'chinook'
+ : '';
+ close(IN);
+ print "+++ Guessed SDK = [$OPTS{sdk}]\n";
+ }
+}
+
$config = { base => $Bin };
$config->{file} = $OPTS{config} if $OPTS{config};
$config = new MUD::Config(%$config);
More information about the Mud-builder-commits
mailing list