[svk-commit] r3033 - trunk/pkg

nobody at bestpractical.com nobody at bestpractical.com
Thu Jul 31 18:10:45 EDT 2008


Author: clkao
Date: Thu Jul 31 18:10:45 2008
New Revision: 3033

Modified:
   trunk/pkg/buildsvk.pl

Log:
buildscript tweaks for win32:
- strawberry perl dist structure changes.
- bundle all dll we can find.
- update svn binary version.


Modified: trunk/pkg/buildsvk.pl
==============================================================================
--- trunk/pkg/buildsvk.pl	(original)
+++ trunk/pkg/buildsvk.pl	Thu Jul 31 18:10:45 2008
@@ -30,7 +30,8 @@
 and svn-win*{,_pl}.zip under current directory before you run buildsvk.pl.
 strawberry-perl.zip can be obtained by zipping the freshly installed
 strawberry-perl for the moment.  You will also need NSIS installed under
-$PATH or C:\program files\nsis.
+$PATH or C:\program files\nsis.  You also need the unzip.exe binary in your path
+(FIXME: just use our extract method)
 
 =head1 TODO
 
@@ -55,7 +56,7 @@
 $build->prepare_perl();
 $build->prepare_svn_core();
 
-$build->build_module('libwin32', 'Console') if $^O eq 'MSWin32';
+$build->build_module('libwin32') if $^O eq 'MSWin32';
 
 $build->build_module($_) for qw(Scalar-List-Utils Class-Autouse version Sub-Uplevel Test-Simple Test-Exception Data-Hierarchy PerlIO-via-dynamic PerlIO-via-symlink SVN-Simple PerlIO-eol Algorithm-Diff Algorithm-Annotate Pod-Escapes Pod-Simple IO-Digest TimeDate Getopt-Long Encode PathTools YAML-Syck Locale-Maketext-Simple App-CLI List-MoreUtils Path-Class Class-Data-Inheritable Class-Accessor UNIVERSAL-require File-Temp Log-Log4perl Time-Progress);
 $build->build_module($_) for qw(Locale-Maketext-Lexicon TermReadKey IO-Pager);
@@ -255,6 +256,8 @@
 use File::Spec;
 use File::Copy 'move';
 
+my $svn_version = '1.5.0';
+
 sub build_dir {
     'c:/tmp/svk-build';
 }
@@ -274,7 +277,7 @@
 sub perlmake_install {
     my $self = shift;
     local %ENV = %ENV;
-    Env::Path->PATH->Assign( map { abs_path(File::Spec->catfile($self->build_dir, 'strawberry-perl', $_, 'bin')) } qw(perl dmake mingw));
+    Env::Path->PATH->Assign( map { abs_path(File::Spec->catfile($self->build_dir, 'strawberry-perl', $_, 'bin')) } qw(perl c));
     return $self->SUPER::perlmake_install(@_);
 }
 
@@ -289,20 +292,22 @@
 	warn "found strawberry perl, remove ".$self->perldest." for clean build.\n";
 	return 1;
     }
-    $self->extract('strawberry-perl.zip');
+    mkdir('strawberry-perl');
+    $self->extract('strawberry-perl.zip' => $self->build_dir.'/strawberry-perl');
 }
 
 sub prepare_svn_core {
     my $self = shift;
     return 1 if -e File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'lib', 'SVN' );
 
-    $self->extract('svn-win32-1.4.4.zip');
-    $self->extract('svn-win32-1.4.4_pl.zip');
+    $self->extract("svn-win32-${svn_version}.zip");
+    $self->extract("svn-win32-${svn_version}_pl.zip");
 
-    my $svnperl = File::Spec->catfile($self->build_dir, 'svn-win32-1.4.4', 'perl', 'site', 'lib' );
+    my $svnperl = File::Spec->catfile($self->build_dir, "svn-win32-$svn_version", 'perl', 'site', 'lib' );
 
     my $strperl = File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'lib' );
 
+warn "$svnperl / $strperl";
     rename(File::Spec->catfile($svnperl, "SVN") =>
 	   File::Spec->catfile($strperl, "SVN")) or die $!;
 
@@ -310,9 +315,9 @@
 	   File::Spec->catfile($strperl, "auto", "SVN")) or die $!;
 
     move($_ => File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'bin'))
-	for glob($self->build_dir."/svn-win32-1.4.4/bin/*.dll");
+	for glob($self->build_dir."/svn-win32-$svn_version/bin/*.dll");
 
-    move($self->build_dir."/svn-win32-1.4.4/iconv" => File::Spec->catfile($self->build_dir, 'strawberry-perl', 'iconv'))
+    move($self->build_dir."/svn-win32-$svn_version/iconv" => File::Spec->catfile($self->build_dir, 'strawberry-perl', 'iconv'))
 }
 
 sub prepare_dist {
@@ -324,6 +329,9 @@
     close $tmpfh;
     open my $fh, 'win32/paroptions.txt' or die $!;
     while (<$fh>) { next if m/^#/; chomp; push @paroptions, split(/ /,$_) };
+
+    my @bundled_dll = map { s{.*\\}{}; $_ } glob(File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'bin').'\*.dll');
+
     push @paroptions,
          -o => $self->build_dir."/SVK.par",
          -a => "$toplevel/lib/SVK/Help;lib/SVK/Help",
@@ -332,7 +340,7 @@
          -I => "$toplevel/lib",
          -I => $self->perldest,
          (map { (-a => File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'bin', $_).";bin/$_") }
-              qw(perl.exe perl58.dll prove.bat intl3_svn.dll libapr.dll libapriconv.dll libaprutil.dll libdb44.dll libeay32.dll ssleay32.dll) ),
+              qw(perl.exe prove.bat), @bundled_dll ),
          -a => "$toplevel/blib/script/svk;bin/svk",
          -a => "$toplevel/pkg/win32/maketest.bat;win32/maketest.bat",
          -a => "$toplevel/pkg/win32/svk.ico;win32/svk.ico",
@@ -356,7 +364,7 @@
     $ENV{PAR_VERBATIM} = 1; # dynloader gets upset and gives warnings if it has #line
     system('pp', @paroptions, "$toplevel/blib/script/svk");
 
-    $self->extract( $self->build_dir."/SVK.par" => $self->build_dir."/build" );
+    eval { $self->extract( $self->build_dir."/SVK.par" => $self->build_dir."/build" ); } or warn $@;
     $self->build_archive( $self->build_dir."/build", $self->get_svk_version($toplevel));
 }
 


More information about the svk-commit mailing list