Ticket #6900: 6900-w32pkg.patch

File 6900-w32pkg.patch, 2.4 KB (added by Jeff Lu <jll544@…>, 15 years ago)

Revised patch: change SDL extract condition, add QT warning, and stream downloads to disk

  • win32-packager.pl

     
    4040use Digest::MD5;
    4141
    4242
     43$SIG{INT} = sub { die "Interrupted\n"; };
    4344$| = 1; # autoflush stdout;
    4445
    4546# this script was last tested to work with this version, on other versions YMMV.
     
    708672if ( $qtver == 4  ) {
    709673push @{$expect},
    710674[ archive => $sources.'qt-win-opensource-4.5.1-mingw.exe', 
    711     fetch => 'ftp://ftp.qtsoftware.com/qt/source/'.
    712              'qt-win-opensource-4.5.1-mingw.exe'],
     675    fetch => 'http://get.qt.nokia.com/qt/source/'.
     676             'qt-win-opensource-4.5.1-mingw.exe',
     677    comment => 'Downloading QT binaries; this will take a LONG time (165MB)' ],
    713678[ file => $qt4dir.'bin/QtCore4.dll',
    714679  exec => $dossources.'qt-win-opensource-4.5.1-mingw.exe',
    715680  comment => 'Install Qt - use default options.  '.
     
    947915# confirmed latest source version as at 26-12-2008:
    948916[ archive => $sources.'SDL-devel-1.2.13-mingw32.tar.gz', 
    949917  fetch   => 'http://www.libsdl.org/release/SDL-devel-1.2.13-mingw32.tar.gz'],
    950 [ dir     => $sources.'SDL-1.2.13',
     918[ file    => $sources.'SDL-1.2.13/bin/SDL.dll',
    951919  extract => $sources.'SDL-devel-1.2.13-mingw32.tar.gz' ],
    952920[ file    => $msys.'bin/SDL.dll',
    953921  shell   => ["cd $unixsources/SDL-1.2.13",
     
    25782375    my $ua = LWP::UserAgent->new;
    25792376    $ua->proxy(['http', 'ftp'], $proxy);
    25802377
    2581     my $req = HTTP::Request->new(GET => $url);
    2582     my $res = $ua->request($req);
    2583 
    2584     if ($res->is_success) {
    2585         my $f = new IO::File "> $file" || die "_fetch: $!\n";
    2586         $f->binmode();
    2587         $f->print($res->content);
    2588         $f->close();
     2378    my $res = $ua->request(HTTP::Request->new(GET => $url),
     2379      sub {
     2380          if (! -f $file) {
     2381              open(FILE, ">$file") || die "_fetch can't open $file: $!\n";
     2382              binmode FILE;
     2383          }
     2384          print FILE $_[0] or die "_fetch can't write to $file: $!\n";
     2385      }
     2386    );
     2387    close(FILE) || die "_fetch can't close $file: $!\n";
     2388    if (my $mtime = $res->last_modified) {
     2389        utime time, $mtime, $file;
    25892390    }
     2391    if ($res->header("X-Died") || !$res->is_success) {
     2392        unlink($file) && print "Transfer failed.  File deleted.\n";
     2393    }
     2394
    25902395    if ( ! -s $file ) {
    25912396      die ('ERR: Unable to automatically fetch file!\nPerhaps manually '.
    25922397           'downloading from the URL to the filename (both listed above) '.