Ticket #7293: 7293-w32pkg_upd22.3.patch

File 7293-w32pkg_upd22.3.patch, 46.6 KB (added by Jeff Lu <jll544@…>, 11 years ago)

Updated patch: bumps Qt to 4.5.3 and MySql? to 5.1.42; also moves MySQL headers into /msys

  • win32-packager.pl

     
    4343$SIG{INT} = sub { die "Interrupted\n"; };
    4444$| = 1; # autoflush stdout;
    4545
     46# NOTE: QT3 removed - 0.21 builds are no longer possible using this script.
    4647# this script was last tested to work with this version, on other versions YMMV.
    47 #my $SVNRELEASE = '16789'; # This is the last version that was Qt 3 based.
    48                            # Qt 4 merges began immediately after.
    49 #my $SVNRELEASE = '18442'; # Recent 0-21-fixes
    50 my $SVNRELEASE = '21995'; # Recent trunk
     48my $SVNRELEASE = '22990'; # Recent trunk
    5149#my $SVNRELEASE = 'HEAD'; # If you are game, go forth and test the latest!
    5250
    5351
     
    7270my $NOISY   = 1;            # Set to 0 for less output to the screen
    7371my $version = '0.22';       # Main mythtv version - used to name dlls
    7472my $package = 0;            # Create a Win32 Distribution package? 1 for yes
    75 my $update  = 0;            # Revert instead of checkout.
    76                             #  Careful, will destruct local copy!
    7773my $compile_type = "profile"; # compile options: debug, profile or release
    7874my $tickets = 0;            # Apply specific win32 tickets -
    7975                            #  usually those not merged into SVN
     
    8177                            #  Required only for testing
    8278my $makeclean = 0;          # Flag to make clean
    8379my $svnlocation = "trunk";  # defaults to trunk unless -b specified
    84 my $qtver = 3;              # default to 3 until we can test otherwise below,
    85                             #  do not change this here.
     80my $qtver = 4;              # default to 4 until we can test otherwise
    8681my $continuous = 0 ;        # by default the app pauses to notify you what
    8782                            #  it's about to do, -y overrides for batch usage.
    8883
    8984##############################################################################
    9085# get command line options
    91 my $opt_string = 'vhu:kp:r:c:tldby';
     86my $opt_string = 'vhogkp:r:c:tldby';
    9287my %opt = ();
    9388getopts( "$opt_string", \%opt );
    9489usage() if $opt{h};
    9590
    96 $update     = 1       if defined $opt{u};
    9791$package    = 1       if defined $opt{k};
    9892$NOISY      = 1       if defined $opt{v};
    9993$tickets    = 1       if defined $opt{t};
     
    112106if (defined $opt{b}) {
    113107    my @num = split /\./, $version;
    114108    $svnlocation = "branches/release-$num[0]-$num[1]-fixes";
    115     print "NOT using SVN 'trunk', using '$svnlocation'\n";
    116 
    117     print "\nWARNING: This is unlikely to build successfully.\n\n";
    118     print "SVN trunk changes frequently, and this version of the\n";
    119     print "build script has had many changes to keep up with it.\n";
    120     print "Maybe try the version from the branch instead! e.g.\n";
    121     print "http://svn.mythtv.org/svn/branches/release-0-21-fixes/mythtv/contrib/Win32/win32-packager.pl\n\n";
    122 #    [ pause => 'press [enter] to continue !'],
    123     print 'Press [enter] to continue !';
    124     my $temp = getc();
    125109} else {
    126110    $svnlocation = "trunk";
    127111}
    128112
    129 # force QT4 if we are on trunk above the point where QT4 patches were merged
    130 if ( $svnlocation eq 'trunk' &&
    131      ($SVNRELEASE =~ m/^HEAD$/i || $SVNRELEASE > 16789) )
    132 {   $qtver = 4   }
    133 
    134 # 0.22-fixes doesn't exist yet.
    135 if ($svnlocation eq "branches/release-0-22-fixes") {
    136     $version = '0.21';
    137     $svnlocation = "branches/release-0-21-fixes";
    138     $qtver = 3;
    139 }
    140 
    141113# Try to use parallel make
    142114my $numCPU = $ENV{'NUMBER_OF_PROCESSORS'} or 1;
    143115my $parallelMake = 'make';
     
    146118    $parallelMake = 'make -j '. ($numCPU + 1);
    147119}
    148120
     121# this list defines the components to build
     122my @components = ( 'mythtv', 'packaging', 'myththemes' );
     123push @components, 'oldthemes' if defined $opt{o};
     124push @components, 'mythplugins' unless defined $opt{g};
    149125
    150126print "Config:\n\tQT version: $qtver\n\tDLLs will be labeled as: $version\n";
    151127if ( $numCPU gt 1 ) {
    152128    print "\tBuilding with ", $numCPU, " processors\n";
    153129}
    154 print "\tSVN location is: $svnlocation\n\tSVN revision is: $SVNRELEASE\n\n";
    155 print "Press [enter] to continue, or [ctrl]-c to exit now....\n";
     130print "\tSVN location is: $svnlocation\n\tSVN revision is: $SVNRELEASE\n";
     131print "\tComponents to build: ";
     132foreach my $comp( @components ) { print "$comp " }
     133print "\n\nPress [enter] to continue, or [ctrl]-c to exit now....\n";
    156134getc() unless $continuous;
    157135
    158136# this will be used to test if we the same
     
    160138my $is_same = "$compile_type-$svnlocation-$qtver.same";
    161139$is_same =~ s#/#-#g; # don't put dir slashes in a filename!
    162140
    163 # this list defines the components to build , to build everything, leave as-is
    164 my @components = ( 'mythtv', 'oldthemes', 'mythplugins', 'packaging' );
    165141
    166 
    167142# TODO - we should try to autodetect these paths, rather than assuming
    168143#        the defaults - perhaps from environment variables like this:
    169144#  die "must have env variable SOURCES pointing to your sources folder"
     
    219194my $unixbuild   = perl2unix($build);
    220195
    221196# The installer for MinGW:
    222 my $MinGWinstaller = 'MinGW-5.1.4.exe';
     197my $MinGWinstaller = 'MinGW-5.1.6.exe';
    223198my $installMinGW   = $dossources.$MinGWinstaller;
    224199
    225200# Qt4 directory
    226 my $qt4dir = '/qt/4.5.1/';
     201my $qt4dir = '/qt/4.5.3/';
    227202my $dosqt4dir = perl2dos($qt4dir);
    228203my $unixqt4dir = '/c'.perl2unix($qt4dir);
    229204
     
    350325[ file    => $mingw."bin/gcc.exe",
    351326  exec    => $installMinGW,
    352327  comment => 'unable to find a gcc.exe where expected, '.
    353              'rerunning MinGW installer!' ];
     328             'rerunning MinGW installer!' ] ,
    354329
    355 # sanity check - building 0.21 with mingwrt != 3.14 is guaranteed FAIL
    356 if ($version == '0.21') {
    357    push @{$expect},
    358      [grep    => ['runtime=mingw-runtime-3.14.tar.gz',$mingw.'installed.ini'],
    359       Died_Because_Wrong_MinGW_Version => 'Intentional script failure',
    360       comment => $version.' must be built with (old) MinGW runtime 3.14. '.
    361                  '"Current" MinGW releases will NOT work. If the script '.
    362                  'dies here, uninstall MinGW and next time, choose the '.
    363                  '"Previous" MinGW package in the Automated Installer.'];
    364 }
    365 
    366 push @{$expect},
    367 
    368330[ archive => $sources.'MSYS-1.0.10.exe',
    369331  'fetch' => 'http://'.$sourceforge.'/sourceforge/mingw/MSYS-1.0.10.exe',
    370332  comment => 'Get the MSYS and addons:' ] ,
     
    454416  mkdirs  => $sources.'unzip',
    455417  comment => 'unzip.exe - Get a precompiled '.
    456418             'native Win32 version from InfoZip' ],
    457 [ archive => $sources.'unzip/unz552xN.exe',
    458   'fetch' => 'ftp://tug.ctan.org/tex-archive'.
    459              '/tools/zip/info-zip/WIN32/unz552xN.exe'],
     419[ archive => $sources.'unzip/unz600xn.exe',
     420  'fetch' => 'ftp://ftp.info-zip.org/pub/infozip/win32/unz600xn.exe'],
    460421[ file    => $sources.'unzip/unzip.exe',
    461422  exec    => 'chdir '.$dossources.'unzip && '.
    462              $dossources.'unzip/unz552xN.exe' ],
     423             $dossources.'unzip/unz600xn.exe' ],
    463424# we could probably put the unzip.exe into the path...
    464425
    465426
     
    472433[ dir     => $sources.'svn-win32-1.5.1',
    473434  extract => $sources.'svn-win32-1.5.1.zip' ],
    474435
    475 
    476 [ file    => $msys.'bin/svn151_.exe',
    477   shell   => [ "cp -R $unixsources/svn-win32-1.5.1/* ".$unixmsys,
    478                "cp $unixsources/svn-win32-1.5.1/bin/svn.exe ".
    479                    $unixmsys."bin/svn151.exe",
    480                "cp $unixsources/svn-win32-1.5.1/bin/svn.exe ".
    481                    $unixmsys."bin/svn151_.exe",
    482                "cp $unixsources/svn-win32-1.5.1/bin/intl3_svn.dll ".
    483                    $unixmsys."bin"
    484              ],
    485   comment => 'put the svn.exe executable into the path, '.
     436# link to svn instead of installing it, to avoid packaging its dlls later
     437[ always  => $msys.'bin/svn.bat',
     438  write   => [$msys.'bin/svn.bat',
     439  '@'.$dossources.'svn-win32-1.5.1\bin\svn.exe %*' ],
     440  comment => 'put svn.bat into the path, '.
    486441             'so we can use it easily later!' ],
    487442
     443[ always  => $msys.'bin/svnversion',
     444  write   => [$msys.'bin/svnversion',
     445'#!/bin/sh
     446'.$unixsources.'svn-win32-1.5.1/bin/svnversion.exe $*' ],
     447  comment => 'put svnversion into the path, '.
     448             'so mythtv can use it later!' ],
     449
    488450# :
    489451[ dir     => $sources."zlib",
    490452  mkdirs  => $sources.'zlib',
     
    500462[ file    => $msys.'include/zlib.h',
    501463  exec    => ["copy /Y ".$dossources.'zlib\usr\include\* '.
    502464              $dosmsys."include"] ],
    503 # taglib also requires zlib in /mingw , so we'll put it there too, why not!
    504 [ file    => $mingw.'lib/libz.a',
    505   exec    => ["copy /Y ".$dossources.'zlib\usr\lib\* '.$dosmingw."lib"] ],
    506 [ file    => $mingw.'bin/msys-z.dll',
    507   exec    => ["copy /Y ".$dossources.'zlib\usr\bin\* '. $dosmingw."bin"] ],
    508 [ file    => $mingw.'include/zlib.h',
    509   exec    => ["copy /Y ".$dossources.'zlib\usr\include\* '.
    510               $dosmingw."include"] ],
    511465
    512466# fetch mysql
    513467# primary server site is:
     
    515469#     mysql-essential-5.1.30-win32.msi/from/http://mysql.mirrors.ilisys.com.au/
    516470# alternate: http://mysql.mirrors.ilisys.com.au/Downloads/MySQL-5.1/
    517471#     mysql-essential-5.1.30-win32.msi
    518 [ archive => $sources.'mysql-essential-5.1.36-win32.msi',
     472[ archive => $sources.'mysql-essential-5.1.42-win32.msi',
    519473  'fetch' => 'http://mysql.mirrors.ilisys.com.au/Downloads/'.
    520              'MySQL-5.1/mysql-essential-5.1.36-win32.msi',
     474             'MySQL-5.1/mysql-essential-5.1.42-win32.msi',
    521475  comment => 'fetch mysql binaries - this is a big download(35MB) '.
    522476             'so it might take a while' ],
    523477[ file    => $mysql.'bin/libmySQL.dll',
    524   exec    => $dossources.'mysql-essential-5.1.36-win32.msi INSTALLLEVEL=2',
     478  exec    => $dossources.'mysql-essential-5.1.42-win32.msi',
    525479  comment => 'Install mysql - be sure to choose to do a "COMPLETE" install. '.
    526480             'You should also choose NOT to "configure the server now" ' ],
    527481
    528482# after mysql install
    529 [ filesame => [$mingw.'bin/libmySQL.dll', $mysql.'bin/libmySQL.dll'],
     483[ filesame => [$msys.'bin/libmySQL.dll', $mysql.'bin/libmySQL.dll'],
    530484  copy     => [''=>'',
    531485  comment  => 'post-mysql-install'] ],
    532 [ filesame => [$mingw.'lib/libmySQL.dll', $mysql.'bin/libmySQL.dll'],
     486[ filesame => [$msys.'lib/libmySQL.dll', $mysql.'bin/libmySQL.dll'],
    533487  copy     => [''=>'',
    534488  comment  => 'post-mysql-install'] ],
    535 [ filesame => [$mingw.'lib/libmysql.lib', $mysql.'lib/opt/libmysql.lib'],
     489[ filesame => [$msys.'lib/libmysql.lib', $mysql.'lib/opt/libmysql.lib'],
    536490  copy     => [''=>''] ],
    537 [ file     => $mingw.'include/mysql.h',
    538   exec     => 'copy /Y "'.$dosmysql.'include\*" '.$dosmingw.'include' ],
     491[ file     => $msys.'include/mysql.h',
     492  exec     => 'copy /Y "'.$dosmysql.'include\*" '.$dosmsys.'include' ],
    539493
    540494
    541495# make sure that /mingw is mounted in MSYS properly before trying
     
    550504#
    551505# TIP: we use a special file (with two extra _'s )
    552506#      as a marker to say this acton is already done!
    553 [ file    => $mingw.'lib/libmysql.lib__',
    554   shell   => ["cd /mingw/lib","reimp -d libmysql.lib",
     507[ file    => $msys.'lib/libmysql.lib__',
     508  shell   => ["cd /usr/lib","reimp -d libmysql.lib",
    555509           "dlltool -k --input-def libmysql.def --dllname libmysql.dll".
    556510           " --output-lib libmysql.a",
    557            "touch ".$unixmingw.'lib/libmysql.lib__'],
     511           "touch ".$unixmsys.'lib/libmysql.lib__'],
    558512  comment => ' rebuild libmysql.a' ],
    559513
    560514# grep    => [pattern,file] , actions/etc
    561 [ file    => $mingw.'include/mysql___h.patch',
    562   write   => [$mingw.'include/mysql___h.patch',
     515[ file    => $msys.'include/mysql___h.patch',
     516  write   => [$msys.'include/mysql___h.patch',
    563517'--- mysql.h_orig       Fri Jan  4 19:35:33 2008
    564518+++ mysql.h     Tue Jan  8 14:48:36 2008
    565519@@ -45,11 +45,9 @@
     
    577531 #if !defined(__WIN__)
    578532' ],comment => 'write the patch for the the mysql.h file'],
    579533# apply it!?
    580 [ grep    => ['\|\| defined\(__MINGW32__\)',$mingw.'include/mysql.h'],
    581   shell   => ["cd /mingw/include","patch -p0 < mysql___h.patch"],
     534[ grep    => ['\|\| defined\(__MINGW32__\)',$msys.'include/mysql.h'],
     535  shell   => ["cd /usr/include","patch -p0 < mysql___h.patch"],
    582536  comment => 'Apply mysql.h patch file, if not already applied....' ],
    583537
    584538
     
    706660#----------------------------------------
    707661if ( $qtver == 4  ) {
    708662push @{$expect},
    709 [ archive => $sources.'qt-win-opensource-4.5.1-mingw.exe', 
     663[ archive => $sources.'qt-win-opensource-4.5.3-mingw.exe', 
    710664    fetch => 'http://get.qt.nokia.com/qt/source/'.
    711              'qt-win-opensource-4.5.1-mingw.exe',
     665             'qt-win-opensource-4.5.3-mingw.exe',
    712666    comment => 'Downloading QT binaries; this will take a LONG time (165MB)' ],
    713667[ file => $qt4dir.'bin/QtCore4.dll',
    714   exec => $dossources.'qt-win-opensource-4.5.1-mingw.exe',
     668  exec => $dossources.'qt-win-opensource-4.5.3-mingw.exe',
    715669  comment => 'Install Qt - use default options.  '.
    716670             'Ignore the warning about w32api version.' ],
    717671;
     
    737691[ dir     => $sources.'freetype-2.3.5',
    738692  extract => $sources.'freetype-2.3.5.tar' ],
    739693# caution... freetype comes with a Makefile in the .tar.gz, so work around it!
    740 [ file    => $sources.'freetype-2.3.5/Makefile_',
     694[ file    => $sources.'freetype-2.3.5/Makefile__',
    741695  shell   => ["cd $unixsources/freetype-2.3.5",
    742               "./configure --prefix=/mingw",
    743               "touch $unixsources/freetype-2.3.5/Makefile_"],
     696              "./configure --prefix=/usr",
     697              "touch $unixsources/freetype-2.3.5/Makefile__"],
    744698  comment => 'building freetype' ],
    745699             
    746700# here's an example of specifying the make and make install steps separately,
     
    749703  shell   => ["cd $unixsources/freetype-2.3.5",
    750704              "make"],
    751705  comment => 'checking freetype' ],
    752 [ file    => $mingw.'lib/libfreetype.a',
     706[ file    => $msys.'lib/libfreetype.a',
    753707  shell   => ["cd $unixsources/freetype-2.3.5",
    754708              "make install"],
    755709  comment => 'installing freetype' ],
    756 [ file    => $mingw.'bin/libfreetype-6.dll',
     710[ file    => $msys.'bin/libfreetype-6.dll',
    757711  shell   => ["cp $unixsources/freetype-2.3.5/objs/.libs/libfreetype-6.dll ".
    758               "$mingw/bin/"] ],
     712              "$msys/bin/"] ],
    759713
    760714#eg: http://transact.dl.sourceforge.net/sourceforge/lame/lame-398-2.tar.gz
    761715[ archive => $sources.'lame-398-2.tar.gz', 
    762716  fetch   => 'http://'.$sourceforge.'/sourceforge/lame/lame-398-2.tar.gz'],
    763717[ dir     => $sources.'lame-398-2',
    764718  extract => $sources.'lame-398-2.tar' ],
    765 [ file    => $mingw.'lib/libmp3lame.a',
    766   shell   => ["cd $unixsources/lame-398-2",
    767               "./configure --prefix=/mingw",
    768               "make",
    769               "make install"],
    770   comment => 'building and installing: mingw lame' ],
    771719[ file    => $msys.'lib/libmp3lame.a',
    772720  shell   => ["cd $unixsources/lame-398-2",
    773721              "./configure --prefix=/usr",
    774722              "make",
    775723              "make install"],
    776724  comment => 'building and installing: msys lame' ],
     725;
    777726
     727if ( grep m/mythplugins/, @components ) {
     728push @{$expect},
    778729# taglib 1.5 sources changed it's build system under win32 to use 'cmake',
    779730# which we don't have, however pre-compiled mingw 1.5 binaries are available:
    780731[ archive => $sources.'taglib-1.5-mingw-bin.zip', 
     
    782733             '/users/luks/taglib/taglib-1.5-mingw-bin.zip'],
    783734[ dir     => $sources.'taglib-1.5-mingw-bin',
    784735  extract => $sources.'taglib-1.5-mingw-bin.zip' ],
    785 [ file    => $mingw.'lib/libtag.dll.a',
    786   shell   => ['cd '.$sources.'taglib-1.5-mingw-bin',
    787               "cp -vr * $unixmingw"],
    788   comment => 'installing: mingw taglib' ],
    789736[ file    => $msys.'lib/libtag.dll.a',
    790737  shell   => ['cd '.$sources.'taglib-1.5-mingw-bin',
    791738              "cp -vr * $unixmsys"],
     
    822769              "make install"],
    823770  comment => 'building and installing: msys libogg' ],
    824771
    825 #  need msys version of ogg for msys version of vorbis!
    826 [ archive => $sources.'libogg-1.1.3.tar.gz', 
    827   fetch   => 'http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz'],
    828 [ dir     => $sources.'libogg-1.1.3',
    829   extract => $sources.'libogg-1.1.3.tar' ],
    830 [ file    => $mingw.'bin/libogg-0.dll',
    831   shell   => ["cd $unixsources/libogg-1.1.3",
    832               "./configure --prefix=/mingw",
    833               "make",
    834               "make install"],
    835   comment => 'building and installing: mingw libogg' ],
    836 
    837772# confirmed latest version as at 26-12-2008:
    838773[ archive => $sources.'libvorbis-1.2.0.tar.gz', 
    839774  fetch   => 'http://downloads.xiph.org/releases/'.
     
    847782              "make install"],
    848783  comment => 'building and installing: msys libvorbis' ],
    849784
    850 # definitely need mingw version for mythtv plugins to build
    851 [ archive => $sources.'libvorbis-1.2.0.tar.gz', 
    852   fetch   => 'http://downloads.xiph.org/releases/'.
    853              'vorbis/libvorbis-1.2.0.tar.gz'],
    854 [ dir     => $sources.'libvorbis-1.2.0',
    855   extract => $sources.'libvorbis-1.2.0.tar' ],
    856 [ file    => $mingw.'lib/libvorbis.a',
    857   shell   => ["cd $unixsources/libvorbis-1.2.0",
    858               "./configure --prefix=/mingw --disable-shared",
    859               "make",
    860               "make install"],
    861   comment => 'building and installing: mingw libvorbis' ],
    862 
    863785# confirmed latest source version as at 26-12-2008
    864786#( flac-win binary packages are unsuitable in this case)
    865787[ archive => $sources.'flac-1.2.1.tar.gz', 
     
    868790  extract => $sources.'flac-1.2.1.tar' ],
    869791[ grep    => ['\#define SIZE_T_MAX UINT_MAX',$mingw.'include/limits.h'],
    870792  shell   => "echo \\#define SIZE_T_MAX UINT_MAX >> $mingw/include/limits.h" ],
    871 [ file    => $mingw.'lib/libFLAC.a',
    872   shell   => ["cd $unixsources/flac-1.2.1",
    873               "./configure --prefix=/mingw",
    874               "make",
    875               "make install"],
    876   comment => 'building and installing: mingw flac/FLAC' ],
    877793[ file    => $msys.'lib/libFLAC.a',
    878794  shell   => ["cd $unixsources/flac-1.2.1",
    879795              "./configure --prefix=/usr",
     
    903819#              "make",
    904820#              "make install"],
    905821#  comment => 'building and installing:  msys libcdaudio' ], 
    906 #
    907 ## mingw version is needed, or mythmusic won't build
    908 #[ file    => $mingw.'bin/libcdaudio-config',
    909 #  shell   => ["cd ".$unixsources."libcdaudio-0.99.12p2",
    910 #              "./configure --prefix=/mingw",
    911 #              "make",
    912 #              "make install"],
    913 #  comment => 'building and installing:  mingw libcdaudio' ], 
    914822 
    915823#[ pause => 'flac, taglib, lame all done.... press [enter] to continue !'],
    916824
    917 # skip doing pthreads from source, we use binaries that were fetched earlier:
    918 #[ archive => $sources.'pthreads-w32-2-8-0-release.tar.gz', 
    919 #  fetch => 'ftp://sourceware.org/pub/pthreads-win32/'.
    920 #           'pthreads-w32-2-8-0-release.tar.gz'],
    921 #[ dir => $sources.'pthreads-w32-2-8-0-release',
    922 #  extract => $sources.'pthreads-w32-2-8-0-release.tar' ],
    923 
    924825# confirmed latest source version as at 26-12-2008:
    925826[ archive => $sources.'SDL-devel-1.2.13-mingw32.tar.gz', 
    926827  fetch   => 'http://www.libsdl.org/release/SDL-devel-1.2.13-mingw32.tar.gz'],
     
    1012913             "make",
    1013914             "make install"],
    1014915  comment => 'building and installing: msys fftw' ],
    1015 [ file    => $mingw.'lib/libfftw3.a',
    1016   shell  => ["cd $unixsources/fftw-3.2.1",
    1017              "./configure --prefix=/mingw",
    1018              "make",
    1019              "make install"],
    1020   comment => 'building and installing: mingw fftw' ],
    1021916
    1022917# typical template:
    1023918#[ archive => $sources.'xxx.tar.gz',  fetch => ''],
     
    1028923#            "make",
    1029924#            "make install"] ],
    1030925
    1031 #----------------------------------------
    1032 # Building QT3 is complicated!
    1033 #
     926;}
    1034927
    1035 ;
    1036 
    1037 if ( $qtver == 3  ) {
    1038 push @{$expect},
    1039 
    1040 #[ pause => 'press [enter] to build QT3 next!'],
    1041 [ archive => $sources.'qt-3.3.x-p8.tar.bz2', 
    1042   fetch => 'http://'.$sourceforge.'/sourceforge/qtwin/qt-3.3.x-p8.tar.bz2'],
    1043 [ dir => $msys.'qt-3.3.x-p8',
    1044   extract => [$sources.'qt-3.3.x-p8.tar', $msys] ],
    1045 
    1046 
    1047 # equivalent patch:
    1048 [ archive => $sources.'qt.patch' ,
    1049   'fetch' => 'http://tanas.ca/qt.patch',
    1050   comment => ' patch the QT sources'],
    1051 [ filesame => [$msys.'qt-3.3.x-p8/qt.patch',$sources."qt.patch"],
    1052   copy => [''=>''] ],
    1053 [ grep => ["\-lws2_32", $msys.'qt-3.3.x-p8/mkspecs/win32-g++/qmake.conf'],
    1054   shell => ["cd ".$unixmsys."qt-3.3.x-p8/","patch -p1 < qt.patch"],
    1055   comment => 'patch the qt3 qmake.conf' ],
    1056 
    1057 
    1058 [ file => $msys.'bin/sh_.exe',
    1059   shell => ["mv ".$unixmsys."bin/sh.exe ".$unixmsys."bin/sh_.exe"],
    1060   comment => 'rename msys sh.exe out of the way before building QT! ' ] ,
    1061 
    1062 # write a batch script for the QT environment under DOS:
    1063 [ file => $msys.'qt-3.3.x-p8/qt3_env.bat',
    1064   write => [$msys.'qt-3.3.x-p8/qt3_env.bat',
    1065 'rem a batch script for the QT environment under DOS:
    1066 set QTDIR='.$dosmsys.'qt-3.3.x-p8
    1067 set MINGW='.$dosmingw.'
    1068 set PATH=%QTDIR%\bin;%MINGW%\bin;%PATH%
    1069 set QMAKESPEC=win32-g++
    1070 cd %QTDIR%
    1071 '
    1072 ],comment=>'write a batch script for the QT3 environment under DOS'],
    1073 
    1074 
    1075 [ file => $msys.'qt-3.3.x-p8/lib/libqt-mt3.dll',
    1076   exec => $dosmsys.'qt-3.3.x-p8\qt3_env.bat && '.
    1077           'configure.bat -thread -plugin-sql-mysql -opengl -no-sql-sqlite',
    1078   comment => 'Execute qt3_env.bat  && the configure command to actually '.
    1079              'build QT now!  - ie configures qt and '.
    1080              'also makes it, hopefully! WARNING SLOW (MAY TAKE HOURS!)' ],
    1081 [ exists => $mingw.'bin/sh.exe',
    1082    shell => ["mv ".$unixmingw."bin/sh.exe ".$unixmingw."bin/sh_.exe"],
    1083  comment => 'rename mingw sh.exe out of the way before building QT! ' ] ,
    1084 
    1085 [ filesame => [$msys.'qt-3.3.x-p8/bin/libqt-mt3.dll',$msys.'qt-3.3.x-p8/lib/libqt-mt3.dll'],
    1086   copy => [''=>''],
    1087   comment => 'is there a libqt-mt3.dll in the "lib" folder of QT? if so, copy it to the the "bin" folder for uic.exe to use!' ],
    1088 
    1089 # did the configure finish?  - run mingw32-make to get it to finish
    1090 # properly.
    1091 # HINT: the very last file built in a successful QT build env is the C:\msys\1.0\qt-3.3.x-p8\examples\xml\tagreader-with-features\tagreader-with-features.exe
    1092 #[ file => $msys.'qt-3.3.x-p8/examples/xml/tagreader-with-features/tagreader-with-features.exe', exec => $dosmsys.'qt-3.3.x-p8\qt3_env.bat && mingw32-make',comment => 'we try to finish the build of QT with mingw32-make, incase it was just a build dependancy issue? WARNING SLOW (MAY TAKE HOURS!)' ],
    1093 
    1094 # TODO - do we have an action we can take to build just this one file/dll if it fails? 
    1095 # For now, we will just test if it built, and try to run 'make' again if it didn't!
    1096 [ file => $msys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll',
    1097   exec => $dosmsys.'qt-3.3.x-p8\qt3_env.bat && mingw32-make -j',
    1098   comment => 'lib\libqsqlmysql.dll - we are just validating some basics of '.
    1099              'the QT install, and if any of these components are missing, '.
    1100              'the build must have failed (is the sql driver built properly?) '],
    1101 [ file => $msys.'qt-3.3.x-p8/bin/qmake.exe',
    1102   exec => $dosmsys.'qt-3.3.x-p8\qt3_env.bat && mingw32-make',
    1103   comment => 'bin\qmake.exe - here we are just validating some basics of '.
    1104              'the QT install, and if any of these components are missing, '.
    1105              'the build must have failed (is the sql driver built properly?) '],
    1106 [ file => $msys.'qt-3.3.x-p8/bin/moc.exe',
    1107   exec => $dosmsys.'qt-3.3.x-p8\qt3_env.bat && mingw32-make',
    1108   comment => 'bin\moc.exe - here we are just validating some basics of '.
    1109              'the QT install, and if any of these components are missing, '.
    1110              'the build must have failed (is the sql driver built properly?) '],
    1111 [ file => $msys.'qt-3.3.x-p8/bin/uic.exe',
    1112   exec => $dosmsys.'qt-3.3.x-p8\qt3_env.bat && mingw32-make',
    1113   comment => 'bin\uic.exe - here we are just validating some basics of '.
    1114              'the QT install, and if any of these components are missing, '.
    1115              'the build must have failed (is the sql driver built properly?) '],
    1116 [ file => $msys.'qt-3.3.x-p8/lib/libqt-mt3.dll',
    1117   exec => $dosmsys.'qt-3.3.x-p8\qt3_env.bat && mingw32-make',
    1118   comment => 'bin\libqt-mt3.dll - here we are just validating some basics of '.
    1119              'the QT install, and if any of these components are missing, '.
    1120              'the build must have failed (is the sql driver built properly?) '],
    1121 
    1122 # a manual method for "installing" QT would be to put all the 'bin' files
    1123 # into /mingw/bin and similarly for the 'lib' and 'include' folders to their
    1124 # respective mingw folders, but we don't.  we run it from the build location!
    1125 
    1126 
    1127 #  (back to sh.exe ) now that we are done !
    1128 [ file => $msys.'bin/sh.exe',
    1129  shell => ["mv ".$unixmsys."bin/sh_.exe ".$unixmsys."bin/sh.exe"],
    1130  comment => 'rename msys sh_.exe back again!' ] ,
    1131 [ exists => $mingw.'bin/sh_.exe',
    1132    shell => ["mv ".$unixmingw."bin/sh_.exe ".$unixmingw."bin/sh.exe"],
    1133  comment => 'rename mingw sh_.exe back again!' ] ,
    1134 
    1135 #Copy libqt-mt3.dll to libqt-mt.dll  , if there is any date/size change!
    1136 [ filesame => [$msys.'qt-3.3.x-p8/lib/libqt-mt.dll',
    1137                $msys.'qt-3.3.x-p8/lib/libqt-mt3.dll'],
    1138   copy => [''=>''],
    1139   comment => 'Copy libqt-mt3.dll to libqt-mt.dll' ] ,
    1140 ;
    1141 }
    1142 
    1143928#
    1144929#----------------------------------------
    1145930# building QT4 is complicated too
     
    1149934#[ pause => 'press [enter] to extract and patch QT4 next!'],
    1150935
    1151936[ always => [],
    1152   write => [$sources.'qt-4.5.1.patch1',
    1153 "--- 4.5.1/qmake/option.cpp.bak 2009-06-28 16:35:29 -0500
    1154 +++ 4.5.1/qmake/option.cpp      2009-06-28 16:35:47 -0500
     937  write => [$sources.'qt-4.5.3.patch1',
     938"--- 4.5.3/qmake/option.cpp.bak 2009-06-28 16:35:29 -0500
     939+++ 4.5.3/qmake/option.cpp      2009-06-28 16:35:47 -0500
    1155940@@ -619,7 +619,10 @@
    1156941     Q_ASSERT(!((flags & Option::FixPathToLocalSeparators) && (flags & Option::FixPathToTargetSeparators)));
    1157942     if(flags & Option::FixPathToLocalSeparators) {
     
    1168953[ grep  => ['Option::shellPath.isEmpty',
    1169954            $qt4dir.'qmake/option.cpp'],
    1170955  shell => ['cd '.$unixqt4dir, 'dos2unix qmake/option.cpp',
    1171             'patch -p1 < '.$sources.'qt-4.5.1.patch1'] ],
     956            'patch -p1 < '.$sources.'qt-4.5.3.patch1'] ],
    1172957
    1173958
    1174959[ always => [],
    1175   write => [$sources.'qt-4.5.1.patch2',
    1176 "--- 4.5.1/mkspecs/win32-g++/qmake.conf.bak     2009-06-28 14:58:42 -0500
    1177 +++ 4.5.1/mkspecs/win32-g++/qmake.conf  2009-06-28 14:59:01 -0500
     960  write => [$sources.'qt-4.5.3.patch2',
     961"--- 4.5.3/mkspecs/win32-g++/qmake.conf.bak     2009-06-28 14:58:42 -0500
     962+++ 4.5.3/mkspecs/win32-g++/qmake.conf  2009-06-28 14:59:01 -0500
    1178963@@ -76,12 +76,15 @@
    1179964     MINGW_IN_SHELL      = 1
    1180965        QMAKE_DIR_SEP           = /
     
    1213998[ grep  => ['QMAKE_COPY_DIR.*?= cp -r',
    1214999            $qt4dir.'mkspecs/win32-g++/qmake.conf'],
    12151000  shell => ['cd '.$unixqt4dir, 'dos2unix mkspecs/win32-g++/qmake.conf',
    1216             'patch -p1 < '.$sources.'qt-4.5.1.patch2'] ],
     1001            'patch -p1 < '.$sources.'qt-4.5.3.patch2'] ],
    12171002
    12181003
    12191004# Write a batch script for the QT environment under DOS:
     
    12231008set MINGW='.$dosmingw.'
    12241009set PATH=%QTDIR%\bin;%MINGW%\bin;%SystemRoot%\System32
    12251010set QMAKESPEC=win32-g++
     1011set LIBRARY_PATH='.$dosmsys.'\lib
     1012set CPATH='.$dosmsys.'\include
    12261013cd %QTDIR%
    12271014goto SQLONLY
    12281015
     
    13311118push @{$expect},
    13321119# now lets write some build scripts to help with mythtv itself
    13331120
    1334 # Qt3
    1335 [ always => [],
    1336   write => [$mythtv.'qt3_env.sh',
    1337 'export QTDIR='.$unixmsys.'qt-3.3.x-p8
    1338 export QMAKESPEC=$QTDIR/mkspecs/win32-g++
    1339 export LD_LIBRARY_PATH=$QTDIR/lib:/usr/lib:/mingw/lib:/lib
    1340 export PATH=$QTDIR/bin:/usr/local/bin:$PATH
    1341 ' ],
    1342   comment => 'write a QT3 script that we can source later when inside msys '.
    1343              'to setup the environment variables'],
    1344 
    1345 
    13461121# Qt4
    13471122[ always => [],
    13481123  write => [$mythtv.'qt4_env.sh',
    13491124'export QTDIR='.$unixqt4dir.'
    13501125export QMAKESPEC=$QTDIR/mkspecs/win32-g++
    13511126export LD_LIBRARY_PATH=$QTDIR/lib:/usr/lib:/mingw/lib:/lib
    1352 export PATH=$QTDIR/bin:/usr/local/bin:$PATH
     1127export LIBRARY_PATH=/usr/lib
     1128export CPATH=/usr/include
     1129export PATH=$QTDIR/bin:/usr/bin:$PATH
    13531130' ],
    13541131  comment => 'write a QT4 script that we can source later when inside msys '.
    13551132             'to setup the environment variables'],
     
    13581135[ always => [],
    13591136  write => [$mythtv.'make_clean.sh',
    13601137'source '.$unixmythtv.'qt'.$qtver.'_env.sh
    1361 rm -f /usr/bin/myth*.exe
    1362 rm -f /usr/bin/libmyth*.dll
    1363 rm -f /usr/lib/libmyth*.*
    1364 rm -f /usr/lib/liblibmyth*.*
    1365 rm -fr /usr/include/mythtv
    1366 rm -fr /usr/lib/mythtv
    1367 rm -fr /usr/share/mythtv
    1368 rm -fr /lib/mythtv
    1369 rm -f /usr/bin/mtd.exe
    1370 rm -f /usr/bin/ignyte.exe
    13711138cd '.$unixmythtv.'mythtv
    1372 make clean
    1373 rm Makefile
     1139make distclean
    13741140cd '.$unixmythtv.'mythplugins
    1375 make clean
    1376 rm Makefile
     1141make distclean
     1142cd '.$unixmythtv.'myththemes
     1143make distclean
    13771144cd '.$unixmythtv.'oldthemes
    1378 make clean
    1379 rm Makefile
     1145make distclean
    13801146cd '.$unixmythtv.'
    1381 find . -type f -name \*.dll | grep -v build | grep -v setup | xargs -n1 rm
    1382 find . -type f -name \*.exe | grep -v build | grep -v setup | xargs -n1 rm
    1383 find . -type f -name \*.a | xargs -n1 rm
    1384 find . -type f -name \*.o | xargs -n1 rm
    1385 #find . -type f -name Makefile\.* | grep -v svn | xargs -n1 rm
    1386 find . -type f -name moc_\*.cpp |  grep -v svn | xargs -n1 rm
    1387 #rm -rf '.$unixmythtv.'mythtv/libs/libmythdb
     1147find . -type f -name \*.dll -o -name \*.exe -o -name \*.a \
     1148       -o -name \*.o -o -name moc_\*.cpp -o -name version.cpp \
     1149     | grep -v build | grep -v setup | grep -v svn | xargs -n1 rm -v
    13881150rm -f '.$mythtv.'delete_to_do_make_clean.txt
    13891151'],
    13901152  comment => 'write a script to clean up myth environment'],
     
    14371199# ... then SVN update every time, before patches
    14381200
    14391201  [ always  => [],
    1440     exec    => [$dosmsys."bin\\svn.exe -r $SVNRELEASE update $dosmythtv$comp"],
     1202    exec    => [$dosmsys."bin\\svn -r $SVNRELEASE update $dosmythtv$comp"],
    14411203    comment => "Getting SVN updates for:$comp on $svnlocation" ];
    14421204}
    14431205
     
    14461208# always get svn num
    14471209[ always   => [],
    14481210  exec     => ['cd '.$dosmythtv.'mythtv && '.
    1449                $dosmsys.'bin\svn.exe info > '.$dosmythtv.'mythtv\svn_info.new'],
     1211               $dosmsys.'bin\svn info > '.$dosmythtv.'mythtv\svn_info.new'],
    14501212 comment   => 'fetching the SVN number to a text file, if we can'],
    14511213[ filesame => [$mythtv.'mythtv/svn_info.txt',$mythtv.'mythtv/svn_info.new'],
    14521214  shell    => ['touch -r '.$unixmythtv.'mythtv/svn_info.txt '.
     
    14631225             .$unixmythtv.'mythtv/svn_info.txt'],
    14641226  comment => 'if the SVN number is changed, then remember that, AND arrange for a full re-make of mythtv. (overkill, I know, but safer)' ],
    14651227
    1466 # open up the permissions:
    1467 [ always   => [],
    1468   shell    => ['cd '.$unixmythtv.'mythtv',
    1469 #TODO - reenable               'chmod -R 777 .'
    1470 #               'cd '.$unixmythtv.'mythplugins',
    1471 #               'chmod -R 777 .'
    1472 #               'cd '.$unixmythtv.'mythtvthemes',
    1473 #               'chmod -R 777 .'
    1474                ],
    1475   comment   => 'loosening permissions on source code:'],
    14761228
    1477 
    1478 
    14791229#  [ pause => 'press [enter] to continue !'],
    14801230 
    14811231# apply any outstanding win32 patches - this section will be hard to keep upwith HEAD/SVN:
     
    14831233# expired patches
    14841234#----------------------------------------
    14851235
    1486 # 15586 and earlier need this patch:
    1487 #[ archive => $sources.'backend.patch.gz' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4392/backend.patch.gz', comment => 'backend.patch.gz - apply any outstanding win32 patches - this section will be hard to keep up with HEAD/SVN'],
    1488 #[ filesame => [$mythtv.'mythtv/backend.patch.gz',$sources."backend.patch.gz"], copy => [''=>'',comment => '4392: - backend connections being accepted patch '] ],
    1489 #[ grep => ['unsigned\* Indexes = new unsigned\[n\]\;',$mythtv.'mythtv/libs/libmyth/mythsocket.cpp'], shell => ["cd ".$unixmythtv."mythtv/","gunzip -f backend.patch.gz","patch -p0 < backend.patch"] ],
    1490 
    1491 # these next 3 patches are needed for 15528 (and earlier)
    1492 #[ archive => $sources.'importicons_windows_2.diff' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/3334/importicons_windows_2.diff', comment => 'importicons_windows_2.diff - apply any outstanding win32 patches - this section will be hard to keep up with HEAD/SVN'],
    1493 #[ filesame => [$mythtv.'mythtv/importicons_windows_2.diff',$sources."importicons_windows_2.diff"], copy => [''=>'',comment => '3334 fixes error with mkdir() unknown.'] ],
    1494 #
    1495 #[ grep => ['\#include <qdir\.h>',$mythtv.'mythtv/libs/libmythtv/importicons.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < importicons_windows_2.diff"] ],
    1496 #[ archive => $sources.'mingw.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4516/mingw.patch', comment => 'mingw.patch - apply any outstanding win32 patches - this section will be hard to keep up with HEAD/SVN'],
    1497 #[ filesame => [$mythtv.'mythtv/mingw.patch',$sources."mingw.patch"], copy => [''=>'',comment => '4516 fixes build'] ],
    1498 #[ grep => ['LIBS \+= -lmyth-\$\$LIBVERSION',$mythtv.'mythtv/libs/libmythui/libmythui.pro'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < mingw.patch"] ]
    1499 #
    1500 # (fixed in 15547)
    1501 #[ archive => $sources.'util_win32.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4497/util_win32.patch', comment => 'util_win32.patch - apply any outstanding win32 patches - this section will be hard to keep up with HEAD/SVN'],
    1502 #[ filesame => [$mythtv.'mythtv/util_win32.patch',$sources."util_win32.patch"], copy => [''=>'',comment => '4497 fixes build'] ],
    1503 #[ grep => ['\#include "compat.h"',$mythtv.'mythtv/libs/libmyth/util.h'], shell => ["cd ".$unixmythtv."mythtv/libs/libmyth/","patch -p0 < ".$unixmythtv."mythtv/util_win32.patch"] ],
    1504 
    1505 # post 15528, pre 15568  needs this: equivalent to: svn merge -r 15541:15540 .
    1506 #[ archive => $sources.'15541_undo.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/XXXX/15541_undo.patch', comment => 'util_win32.patch - apply any outstanding win32 patches - this section will be hard to keep up with HEAD/SVN'],
    1507 #[ filesame => [$mythtv.'mythtv/15541_undo.patch',$sources."15541_undo.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1508 #[ grep  => ['\#include \"compat.h\"',$mythtv.'mythtv/libs/libmythui/mythpainter.cpp'], shell => ["cd ".$unixmythtv."mythtv/libs/libmyth/","patch -p2 < ".$unixmythtv."mythtv/15541_undo.patch"] , comment => 'currently need this patch too, equivalemnt of: svn merge -r 15541:15540 .'],
    1509 
    1510 # Ticket 4984
    1511 #[ archive => $sources.'4984_mythcontext.patch6' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4984/mythcontext.patch6', comment => 'Applying Ticket 4984'],
    1512 #[ filesame => [$mythtv.'mythtv/4984_mythcontext.patch6',$sources."4984_mythcontext.patch6"], copy => [''=>'',comment => 'XXXX'] ],
    1513 #[ grep  => ['MYTHLIBDIR',$mythtv.'mythtv/libs/libmyth/mythcontext.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < ".$unixmythtv."mythtv/4984_mythcontext.patch6"] , comment => ' 4984'],
    1514 
    1515 
    1516 # Ticket 4699
    1517 #[ archive => $sources.'4699_win32_fs.patch', 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4699/win32_fs.patch', comment => 'win32_fs.patch'],
    1518 #[ filesame => [$mythtv.'mythtv/4699_win32_fs.patch',$sources."4699_win32_fs.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1519 #[ grep  => ['setCaption',$mythtv.'mythtv/libs/libmythui/mythmainwindow.cpp'], shell => ["cd ".$unixmythtv."mythtv","patch -p0 < ".$unixmythtv."mythtv/4699_win32_fs.patch"] , comment => ' 4699'],
    1520 
    1521 #  4718
    1522 #[ archive => $sources.'4718_undo.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4718/dvd_playback.patch', comment => 'Ticket 4718 dvdplayer.patch'],
    1523 #[ filesame => [$mythtv.'mythtv/4718_undo.patch',$sources."4718_undo.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1524 #[ grep  => ['filename.right(filename.length() -  4)',$mythtv.'mythtv/libs/libmythtv/RingBuffer.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' .'],
    1525 #[ archive => $sources.'4718_playback.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4718/dvd_playback_plugin.patch', comment => 'dvdplayer.patch - apply any outstanding win32 patches - this section will be hard to keep upwith HEAD/SVN'],
    1526 #[ filesame => [$mythtv.'mythtv/4718_playback.patch',$sources."4718_playback.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1527 #[ grep  => ['gc->setValue\("D:',$mythtv.'mythplugins/mythvideo/mythvideo/globalsettings.cpp'], shell => ["cd ".$unixmythtv."mythplugins/mythvideo","patch -p0 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' .'],
    1528 #[ grep  => ['\"dvd:\/\"',$mythtv.'mythplugins/mythvideo/mythvideo/main.cpp'], shell => ["cd ".$unixmythtv."mythplugins/mythvideo","patch -p1 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' 4718'],
    1529 
    15301236# Ticket 15831
    15311237#[ archive => $sources.'15831_win32_fs.patch', 'fetch' => 'http://svn.mythtv.org/trac/changeset/15831?format=diff&new=15831', comment => 'win32_fs.patch - apply any outstanding win32 patches - this section will be hard to keep upwith HEAD/SVN'],
    15321238#[ filesame => [$mythtv.'mythtv/15831_win32_fs.patch',$sources."15831_win32_fs.patch"], copy => [''=>'',comment => 'XXXX'] ],
     
    15761282foreach my $comp( @components ) {
    15771283  push @{$expect},
    15781284  [ file    => $mythtv.'delete_to_do_make_clean.txt',
    1579     exec    => [$dosmsys."bin\\svn.exe -R revert $dosmythtv$comp", "nocheck"],
     1285    exec    => [$dosmsys."bin\\svn -R revert $dosmythtv$comp", "nocheck"],
    15801286    comment => "reverting any local MODS from SVN - $comp on $svnlocation" ],
    15811287   
    15821288# this is now done as part of make_clean.sh, which happens EARLIER
     
    16151321
    16161322# make
    16171323
    1618 # fix a bug in Makefile and make COPY_DIR cp -fr instead of cp -f
    1619 # TODO Check if this is necessary. I suspect it was meant to fix #4949?
    1620 #
    1621 [ file => $mythtv.'mythtv/fix_makefile.sh',
    1622   write => [$mythtv.'mythtv/fix_makefile.sh',
    1623 'cd '.$unixmythtv.'mythtv
    1624 cat Makefile | sed  "s/\(^COPY_DIR\W*\=\W*cp\)\(\W\-f\)/\1 -fr/" > Makefile_new
    1625 cp Makefile_new Makefile
    1626 '],
    1627   comment => 'write a script to fix Makefile'],
    1628 
    16291324[ newer => [$mythtv."mythtv/libs/libmyth/libmyth-$version.dll",
    16301325            $mythtv.'mythtv/last_build.txt'],
    16311326  shell => ['rm '.$unixmythtv."mythtv/libs/libmyth/libmyth-$version.dll",
     
    16851380source '.$unixmythtv.'qt'.$qtver.'_env.sh
    16861381cd '.$unixmythtv.'
    16871382echo copying main QT dlls to build folder...
    1688 # mythtv probably needs the qt3 dlls at runtime:
    1689 cp '.$unixmsys.'qt-3.3.x-p8/lib/*.dll '.$unixmythtv.'build/bin
    16901383# mythtv needs the qt4 dlls at runtime:
    16911384cp '.$unixqt4dir.'bin/*.dll '.$unixmythtv.'build/bin
    16921385# qt mysql connection dll has to exist in a subfolder called sqldrivers:
     
    17011394# translations go into <installprefix>/share/mythtv/i18n
    17021395mkdir '.$unixmythtv.'/build/bin/sqldrivers
    17031396echo Copying QT plugin required dlls....
    1704 cp '.$unixmsys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll '.$unixmythtv.'build/bin/sqldrivers
    17051397cp '.$unixqt4dir.'plugins/sqldrivers/qsqlmysql*.dll '.$unixmythtv.'build/bin/sqldrivers
    17061398echo Copying ming and msys dlls to build folder.....
    17071399# pthread dlls and mingwm10.dll are copied from here:
    17081400cp /mingw/bin/*.dll '.$unixmythtv.'build/bin
    1709 # msys-1.0.dll dll is copied from here:
    1710 cp /bin/msys-1.0.dll '.$unixmythtv.'build/bin
     1401# msys-1.0.dll and library dlls are copied from here:
     1402cp /bin/*.dll '.$unixmythtv.'build/bin
    17111403echo copying lib files...
    17121404mv '.$unixmythtv.'build/lib/*.dll '.$unixmythtv.'build/bin/
    17131405mv '.$unixmythtv.'build/bin/*.a '.$unixmythtv.'build/lib/
    17141406
    1715 # because the install process failes to copy the .mak file (needed by the plugins), we copy it manually.
    1716 cp '.$unixmythtv.'mythtv/libs/libmyth/mythconfig.mak '.$unixmythtv.'build//include/mythtv/
    1717 
    17181407touch '.$unixmythtv.'/build/package_flag
    1719 cp '.$unixmythtv.'gdb_*.bat '.$unixmythtv.'build/bin
    17201408cp '.$unixmythtv.'packaging/Win32/debug/*.cmd '.$unixmythtv.'build/bin
    17211409'],
    17221410  comment => 'write a script to install mythtv to build folder'],
    17231411
    17241412
    1725 # Create file to install mythplugins
    1726 [ always => [],
    1727   write => [$mythtv.'setup_plugins.sh',
    1728 '#!/bin/bash
    1729 source '.$unixmythtv.'qt'.$qtver.'_env.sh
    1730 cd '.$unixmythtv.'
    1731 echo Copying exe files....
    1732 find /usr/bin -name \\myth*.exe  | grep -v build | xargs -n1 -i__ cp __ ./build/
    1733 echo Copying dll files....
    1734 find /usr/bin -name \\libmyth*.dll  | grep -v build | xargs -n1 -i__ cp __ ./build/ 
    1735 find /usr/lib -name \\libmyth*.dll  | grep -v build | xargs -n1 -i__ cp __ ./build/ 
    1736 echo Copying share files...
    1737 cp -ur /share/mythtv ./build/share/
    1738 echo Copying lib files...
    1739 cp -ur /lib/mythtv/* ./build/lib/mythtv
    1740 cp -ur /usr/lib/mythtv/* ./build/lib/mythtv
    1741 '],
    1742   comment => 'write a script to install plugins to build folder'],
    1743 
    1744 
    17451413# chmod the shell scripts, everytime
    17461414[ always  => [],
    17471415  shell   => ["cd $mythtv","chmod 755 *.sh"] ],
     
    19181586             ' --disable-mythgame --disable-mythnews'.
    19191587             ' --disable-mythzoneminder --enable-aac'.
    19201588             ' --enable-libvisual --enable-fftw --compile-type='.$compile_type,
    1921              #'touch '.$unixmythtv.'mythplugins/cleanup/cleanup.pro'
    19221589             ],
    19231590  comment => 'do we already have a Makefile for myth plugins?' ],
    19241591 
    19251592#[ pause => 'how does the mythplugins Makefile look? '.
    19261593#           '(did we get any errors on screen?)'],
    19271594
    1928 
    1929 [ grep    => ['win32:DEPENDS', $mythtv.'mythplugins/settings.pro'],
    1930   shell   => ['echo \'win32:DEPENDS += ./\' >> '.
    1931               $mythtv.'mythplugins/settings.pro','nocheck'],
    1932   comment => 'fix settings.pro' ],
    1933 
    1934 #hack mythconfig.mak to remove /usr
    1935 [ grep    => ['LIBDIR=/lib', $mythtv.'mythplugins/mythconfig.mak'],
    1936   shell   => ['cd '.$unixmythtv.'mythplugins',
    1937               'sed -e \'s|/usr||\' mythconfig.mak > mythconfig2.mak',
    1938               'cp mythconfig2.mak mythconfig.mak', 'nocheck'],
    1939   comment => 'hack mythconfig.mak'],
    1940 
    19411595# make
    19421596[ newer   => [$mythtv.'mythplugins/mythmovies/mythmovies/libmythmovies.dll',
    19431597              $mythtv.'mythtv/last_build.txt'],
     
    19461600  comment => 'PLUGINS! redo make if we need to '.
    19471601             '(see the  last_build.txt identifier)' ],
    19481602
    1949 # make cleanup/cleanup.pro as install fails without it
    1950 #[ file    => $mythtv.'mythplugins/cleanup/cleanup.pro',
    1951 #  shell   => ['touch '.$unixmythtv.'mythplugins/cleanup/cleanup.pro',
    1952 #              'nocheck'],
    1953 #  comment => 'make cleanup.pro'],
    1954 
    19551603# make install
    19561604[ newer   => [$mythtv.'build/lib/mythtv/plugins/libmythmovies.dll',
    19571605              $mythtv.'mythplugins/mythmovies/mythmovies/libmythmovies.dll'],
     
    19591607              'cd '.$unixmythtv.'mythplugins','make install'],
    19601608  comment => 'PLUGINS! make install' ],
    19611609
    1962 # Copy to build area
    1963 #[ newer => [$mythtv.'build/lib/mythtv/plugins/libmythmovies.dll',
    1964 #            $msys.'lib/mythtv/plugins/libmythmovies.dll'],
    1965 #  shell => [$unixmythtv.'setup_plugins.sh'],
    1966 #  comment => 'Copy mythplugins to ./build folder' ],
    1967 
    1968 # Qt3 can't cope with wildcards in the install targets:
    1969 [ file   => $build.'/share/mythtv/videomenu.xml',
    1970   shell  => ['cd '.$unixmythtv.'mythplugins',
    1971              'cp mythcontrols/mythcontrols/controls-ui.xml'.
    1972              '   mythcontrols/images/*.png '.
    1973              '   mythvideo/theme/default/*.xml'.
    1974              '   mythvideo/theme/default/images/*.png'.
    1975              '   mythweather/mythweather/weather-ui.xml'.
    1976              '   mythweather/mythweather/images/*.png'.
    1977              ' '.$unixbuild.'/share/mythtv/themes/default',
    1978              'cp mythmovies/mythmovies/theme-wide/*.xml'.
    1979              '   mythvideo/theme/default-wide/*.xml'.
    1980              '   mythvideo/theme/default-wide/images/*.png'.
    1981              '   mythweather/mythweather/theme-wide/weather-ui.xml'.
    1982              '   mythweather/mythweather/theme-wide/images/*.png'.
    1983              ' '.$unixbuild.'/share/mythtv/themes/default-wide',
    1984              'cp mythweather/mythweather/weather_settings.xml'.
    1985              '   mythvideo/theme/menus/*.xml'.
    1986              ' '.$unixbuild.'/share/mythtv',
    1987              'mkdir -p '.$unixbuild.'/share/mythtv/mythvideo/scripts',
    1988              'cp mythvideo/mythvideo/scripts/*'.
    1989              ' '.$unixbuild.'/share/mythtv/mythvideo/scripts',
    1990              'mkdir -p '.$unixbuild.'/share/mythtv/mythweather/scripts',
    1991              'cp mythweather/mythweather/weather-screens.xml'.
    1992              ' '.$unixbuild.'/share/mythtv/mythweather',
    1993              'cp -pr mythweather/mythweather/scripts/* '.
    1994              ' '.$unixbuild.'/share/mythtv/mythweather/scripts']
    1995 ]
    19961610;
    19971611}
    19981612
    19991613
    2000 if ( grep m/oldthemes/, @components ) {
     1614foreach my $themecomp ( grep m/themes/, @components ) {
    20011615# -------------------------------
    20021616# Make themes
    20031617# -------------------------------
    20041618push @{$expect},
    20051619## config:
    2006 [ file    => $mythtv.'oldthemes/Makefile',
     1620[ file    => $mythtv.$themecomp.'/Makefile',
    20071621  shell   => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh',
    2008             'cd '.$unixmythtv.'oldthemes','./configure --prefix='.$unixbuild],
    2009   comment => 'do we already have a Makefile for oldthemes?' ],
     1622            'cd '.$unixmythtv.$themecomp,'./configure --prefix='.$unixbuild],
     1623  comment => "do we already have a Makefile for $themecomp?" ],
    20101624
    2011 ## fix oldthemes.pro
    2012 [ grep    => ['^win32:QMAKE_INSTALL_DIR', $mythtv.'oldthemes/oldthemes.pro'],
    2013   shell   => ['echo \'win32:QMAKE_INSTALL_DIR = sh ./cpsvndir\' >> '.
    2014               $mythtv.'oldthemes/oldthemes.pro','nocheck'],
    2015   comment => 'fix oldthemes.pro' ],
    2016 [ grep    => ['win32:DEPENDS', $mythtv.'oldthemes/oldthemes.pro'],
    2017   shell   => ['echo \'win32:DEPENDS += ./\' >> '.
    2018               $mythtv.'oldthemes/oldthemes.pro','nocheck'],
    2019   comment => 'fix oldthemes.pro' ],
    2020 
    2021 #hack mythconfig.mak to remove /usr
    2022 [ grep    => ['LIBDIR=/lib', $mythtv.'oldthemes/mythconfig.mak'],
    2023   shell   => ['cd '.$unixmythtv.'oldthemes',
    2024              'sed -e \'s|/usr||\' mythconfig.mak > mythconfig2.mak',
    2025              'cp mythconfig2.mak mythconfig.mak', 'nocheck'],
    2026   comment => 'hack mythconfig.mak'],
    2027 
    20281625## make
    2029 [ dir     => [$mythtv.'/build/share/mythtv/themes/Retro'],
     1626[ file    => [$mythtv.'build/share/'.$themecomp.'.installed'],
    20301627  shell   => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh',
    2031               'cd '.$unixmythtv.'oldthemes','make', 'make install'],
     1628              'cd '.$unixmythtv.$themecomp,'make', 'make install',
     1629              'touch '.$unixmythtv.'build/share/'.$themecomp.'.installed'],
    20321630  comment => 'THEMES! redo make if we need to '.
    20331631             '(see the  last_build.txt identifier)' ],
    2034  
     1632;
     1633}
    20351634
     1635if ( grep m/themes/, @components ) {
     1636push @{$expect},       
    20361637# Get any extra Themes
    20371638#
    20381639
     
    20501651# Move ttf fonts to font directory
    20511652[ always  => [],
    20521653  shell   => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh',
    2053             'cd '.$unixmythtv.'oldthemes',
     1654            'cd '.$unixmythtv.'build',
    20541655            'find '.$unixmythtv.'build/share/mythtv/themes/ -name "*.ttf"'.
    20551656            ' | xargs -n1 -i__ cp __ '.$unixmythtv.'build/share/mythtv'],
    20561657  comment => 'move ttf files'],
     
    25572158          print FILE $_[0] or die "_fetch can't write to $file: $!\n";
    25582159      }
    25592160    );
    2560     close(FILE) || die "_fetch can't close $file: $!\n";
     2161    close(FILE) || print "_fetch can't close $file: $!\n";
    25612162    if (my $mtime = $res->last_modified) {
    25622163        utime time, $mtime, $file;
    25632164    }
     
    26912292
    26922293-h             This message
    26932294-v             Verbose output
    2694 -u all|mythtv|mythplugins|oldthemes
    2695                Revert instead of checkout !!
     2295-o             Include oldthemes in the build [default off]
     2296-g             Exclude mythplugins from the build [default off]
    26962297-k             Package win32 distribution
    26972298-p proxy:port  Your proxy
    26982299-r XXXX|head   Your prefered revision (to change revision)