Ticket #4397: win32-packager.29.patch

File win32-packager.29.patch, 16.1 KB (added by Buzz <davidbuzz@…>, 16 years ago)

latest patch for win32-packager

  • win32-packager.pl

     
    141141print "Press [enter] to continue, or [ctrl]-c to exit now....\n";
    142142getc();
    143143
    144 # TODO -  use this list to define the components to build - only the first of
    145 #         these currently works well.
     144# this list defines the components to build , to build everything, leave as-is
    146145my @components = ( 'mythtv', 'myththemes', 'mythplugins' );
    147146
    148147
     
    153152#  my $sources = $ENV{SOURCES};
    154153# TODO - although theoretically possible to change these paths,
    155154#        it has NOT been tested much, and will with HIGH PROBABILITY fail somewhere.
    156 # TODO - Only $mingw is tested and most likely is safe to change.
     155#     - Only $mingw is tested and most likely is safe to change.
    157156
    158157# Perl compatible paths. DOS style, but forward slashes, and must end in slash:
    159158my $msys    = 'C:/MSys/1.0/';
     
    214213#        an event/action.
    215214#        There are a number of different actions that can be taken.
    216215#
    217 # eg: [ dir  => "c:/MinGW", exec => $dossources.'MinGW-5.1.3.exe' ],
     216# eg: [ dir  => "c:/MinGW", exec => $dossources.'MinGW-5.1.4.exe' ],
    218217#
    219218# means: expect there to be a dir called "c:/MinGW", and if there isn't
    220 # execute the file MinGW-5.1.3.exe. (clearly there needs to be a file
    221 # MinGW-5.1.3.exe on disk for that to work, so there is an earlier
     219# execute the file MinGW-5.1.4.exe. (clearly there needs to be a file
     220# MinGW-5.1.4.exe on disk for that to work, so there is an earlier
    222221# declaration to 'fetch' it)
    223222
    224223
     
    255254#  copy a new version of a file, set mtime to the original           [copy]
    256255
    257256#TODO:
    258 #  copy a set of files (path/filespec,  destination)                 not-yet-impl.  use exec => 'copy /Y xxx.* yyy'
    259 #  apply a diff                                                      not-yet-impl   use shell => 'patch -p0 < blah.patch'
    260 #  search-replace text in a file                                     not-yet-impl   use grep => ['pattern',subject], exec => shell 'patch < etc to replace it'
     257#  copy a set of files (path/filespec,  destination)                 not-yet-impl.
     258#   =>  use exec => 'copy /Y xxx.* yyy'
     259#  apply a diff                                                      not-yet-impl
     260#   =>   use shell => 'patch -p0 < blah.patch'
     261#  search-replace text in a file                                     not-yet-impl
     262#   =>   use grep => ['pattern',subject], exec => shell 'patch < etc to replace it'
    261263
    262264
    263265# NOTES on specific actions:
     
    286288  comment => 'We download all the files from the web, and save them here:'],
    287289
    288290
    289 [ archive => $sources.'MinGW-5.1.3.exe',
    290   'fetch' => 'http://'.$sourceforge.'/sourceforge/mingw/MinGW-5.1.3.exe',
     291[ archive => $sources.'MinGW-5.1.4.exe',
     292  'fetch' => 'http://'.$sourceforge.'/sourceforge/mingw/MinGW-5.1.4.exe',
    291293  comment => 'Get mingw and addons first, or we cant do [shell] requests!' ],
    292294[ archive => $sources.'mingw-utils-0.3.tar.gz',
    293295  'fetch' => 'http://'.$sourceforge.'/sourceforge/mingw/mingw-utils-0.3.tar.gz' ],
    294296
    295297
    296298[ dir     => $mingw,
    297   exec    => $dossources.'MinGW-5.1.3.exe',
     299  exec    => $dossources.'MinGW-5.1.4.exe',
    298300  comment => 'install MinGW (be sure to install g++, g77 and ming make too. Leave the default directory at c:\mingw ) - it will require user interaction, but once completed, will return control to us....' ], # interactive, supposed to install g++ and ming make too, but people forget to select them?
    299301[ file    => $mingw."bin/gcc.exe",
    300   exec    => $dossources.'MinGW-5.1.3.exe',
     302  exec    => $dossources.'MinGW-5.1.4.exe',
    301303  comment => 'unable to find a gcc.exe where expected, rerunning MinGW installer!' ], # interactive, supposed to install g++ and ming make too, but people forget to select them?
    302304
    303305[ archive => $sources.'MSYS-1.0.10.exe',
     
    325327# if you did a default-install of MingW, then you need to try again, as we
    326328# really need g++ and mingw32-make, and g77 is needed for fftw
    327329[ file    => $mingw.'bin/mingw32-make.exe', 
    328   exec    => $dossources.'MinGW-5.1.3.exe',
     330  exec    => $dossources.'MinGW-5.1.4.exe',
    329331  comment => 'Seriously?  You must have done a default install of MinGW.  go try again! You MUST choose the custom installed and select the mingw make, g++ and g77 optional packages.' ],
    330332[ file    => $mingw.'bin/g++.exe',
    331   exec    => $dossources.'MinGW-5.1.3.exe',
     333  exec    => $dossources.'MinGW-5.1.4.exe',
    332334  comment => 'Seriously?  You must have done a default install of MinGW.  go try again! You MUST choose the custom installed and select the mingw make, g++ and g77 optional packages.' ],
    333335[ file    => $mingw.'bin/g77.exe',
    334   exec    => $dossources.'MinGW-5.1.3.exe',
     336  exec    => $dossources.'MinGW-5.1.4.exe',
    335337  comment => 'Seriously?  You must have done a default install of MinGW.  go try again! You MUST choose the custom installed and select the mingw make, g++ and g77 optional packages.' ],
    336338
    337339#[ file => 'C:/MinGW/bin/mingw32-make.exe',  extract =>
     
    416418
    417419# after mysql install
    418420[ filesame => [$mingw.'bin/libmySQL.dll','c:/Program Files/MySQL/MySQL Server 5.0/bin/libmySQL.dll'], 
    419   copy     => [''=>'',
     421  copy     => setup_themes.sh[''=>'',
    420422  comment  => 'post-mysql-install'] ],
    421423[ filesame => [$mingw.'lib/libmySQL.dll','c:/Program Files/MySQL/MySQL Server 5.0/bin/libmySQL.dll'], 
    422424  copy     => [''=>'',
     
    426428[ file     => $mingw.'include/mysql.h'  ,   
    427429  exec     => 'copy /Y "c:\Program Files\MySQL\MySQL Server 5.0\include\*" '.$dosmingw."include" ],
    428430 
     431 
     432# make sure that /mingw is mounted in MSYS properly before trying to use the /mingw folder
     433# this is supposed to happen as part of the MSYS post-install, but doesnt always work.
     434[ file    => $msys.'etc/fstab',
     435  write   => [$msys.'etc/fstab',
     436"$mingw /mingw
     437" ],comment => 'correct a MinGW bug that prevents the /etc/fstab from existing'],
     438
    429439#
    430440# TIP: we use a special file (with two extra _'s )
    431441#      as a marker to say this acton is already done!
     
    11541164#[ filesame => [$mythtv.'mythtv/15541_undo.patch',$sources."15541_undo.patch"], copy => [''=>'',comment => 'XXXX'] ],
    11551165#[ 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 .'],
    11561166
     1167# Ticket 4984
     1168#[ archive => $sources.'4984_mythcontext.patch6' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4984/mythcontext.patch6', comment => 'Applying Ticket 4984'],
     1169#[ filesame => [$mythtv.'mythtv/4984_mythcontext.patch6',$sources."4984_mythcontext.patch6"], copy => [''=>'',comment => 'XXXX'] ],
     1170#[ grep  => ['MYTHLIBDIR',$mythtv.'mythtv/libs/libmyth/mythcontext.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < ".$unixmythtv."mythtv/4984_mythcontext.patch6"] , comment => ' 4984'],
     1171
     1172
     1173# Ticket 4699
     1174#[ archive => $sources.'4699_win32_fs.patch', 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4699/win32_fs.patch', comment => 'win32_fs.patch'],
     1175#[ filesame => [$mythtv.'mythtv/4699_win32_fs.patch',$sources."4699_win32_fs.patch"], copy => [''=>'',comment => 'XXXX'] ],
     1176#[ grep  => ['setCaption',$mythtv.'mythtv/libs/libmythui/mythmainwindow.cpp'], shell => ["cd ".$unixmythtv."mythtv","patch -p0 < ".$unixmythtv."mythtv/4699_win32_fs.patch"] , comment => ' 4699'],
     1177
     1178#  4718
     1179#[ archive => $sources.'4718_undo.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4718/dvd_playback.patch', comment => 'Ticket 4718 dvdplayer.patch'],
     1180#[ filesame => [$mythtv.'mythtv/4718_undo.patch',$sources."4718_undo.patch"], copy => [''=>'',comment => 'XXXX'] ],
     1181#[ grep  => ['filename.right(filename.length() -  4)',$mythtv.'mythtv/libs/libmythtv/RingBuffer.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' .'],
     1182#[ 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'],
     1183#[ filesame => [$mythtv.'mythtv/4718_playback.patch',$sources."4718_playback.patch"], copy => [''=>'',comment => 'XXXX'] ],
     1184#[ grep  => ['gc->setValue\("D:',$mythtv.'mythplugins/mythvideo/mythvideo/globalsettings.cpp'], shell => ["cd ".$unixmythtv."mythplugins/mythvideo","patch -p0 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' .'],
     1185#[ grep  => ['\"dvd:\/\"',$mythtv.'mythplugins/mythvideo/mythvideo/main.cpp'], shell => ["cd ".$unixmythtv."mythplugins/mythvideo","patch -p1 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' 4718'],
     1186
     1187# Ticket 15831
     1188#[ 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'],
     1189#[ filesame => [$mythtv.'mythtv/15831_win32_fs.patch',$sources."15831_win32_fs.patch"], copy => [''=>'',comment => 'XXXX'] ],
     1190#[ grep  =>  ['\+', $mythtv.'mythtv/15831_win32_fs.patch'], shell => ["cd ".$unixmythtv."mythtv","dos2unix 15831_win32_fs.patch"], comment => ' .'],
     1191#[ grep  => ['LOCALAPPDATA',$mythtv.'mythtv/libs/libmyth/mythcontext.cpp'], shell => ["cd ".$unixmythtv."mythtv","patch -p0 < ".$unixmythtv."mythtv/15831_win32_fs.patch"] , comment => ' 15831'],
     1192
    11571193;
    11581194#
    11591195if ($tickets == 1) {
    11601196 push @{$expect},
    1161 # Ticket 4984
    1162 [ archive => $sources.'4984_mythcontext.patch6' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4984/mythcontext.patch6', comment => 'Applying Ticket 4984'],
    1163 [ filesame => [$mythtv.'mythtv/4984_mythcontext.patch6',$sources."4984_mythcontext.patch6"], copy => [''=>'',comment => 'XXXX'] ],
    1164 [ grep  => ['MYTHLIBDIR',$mythtv.'mythtv/libs/libmyth/mythcontext.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < ".$unixmythtv."mythtv/4984_mythcontext.patch6"] , comment => ' .'],
    11651197
    1166 # Ticket 4699
    1167 [ archive => $sources.'4699_win32_fs.patch', 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4699/win32_fs.patch', comment => 'win32_fs.patch'],
    1168 [ filesame => [$mythtv.'mythtv/4699_win32_fs.patch',$sources."4699_win32_fs.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1169 [ grep  => ['setCaption',$mythtv.'mythtv/libs/libmythui/mythmainwindow.cpp'], shell => ["cd ".$unixmythtv."mythtv","patch -p0 < ".$unixmythtv."mythtv/4699_win32_fs.patch"] , comment => ' .'],
    1170 
    11711198# Ticket 4702
    11721199[ archive => $sources.'4702_mingw.patch', 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4702/mingw.patch', comment => 'mingw.patch - apply any outstanding win32 patches - this section will be hard to keep upwith HEAD/SVN'],
    11731200[ filesame => [$mythtv.'mythtv/4702_mingw.patch',$sources."4702_mingw.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1174 [ grep  => ['\$\$\{PREFIX\}\/bin',$mythtv.'mythtv/libs/libmythui/libmythui.pro'], shell => ["cd ".$unixmythtv."mythtv","patch -p0 < ".$unixmythtv."mythtv/4702_mingw.patch"] , comment => ' .'],
     1201[ grep  => ['\$\$\{PREFIX\}\/bin',$mythtv.'mythtv/libs/libmythui/libmythui.pro'], shell => ["cd ".$unixmythtv."mythtv","patch -p0 < ".$unixmythtv."mythtv/4702_mingw.patch"] , comment => ' 4702'],
    11751202
    1176 # Ticket 4718
    1177 [ archive => $sources.'4718_undo.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4718/dvd_playback.patch', comment => 'Ticket 4718 dvdplayer.patch'],
    1178 [ filesame => [$mythtv.'mythtv/4718_undo.patch',$sources."4718_undo.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1179 [ grep  => ['filename.right(filename.length() -  4)',$mythtv.'mythtv/libs/libmythtv/RingBuffer.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' .'],
    1180 [ 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'],
    1181 [ filesame => [$mythtv.'mythtv/4718_playback.patch',$sources."4718_playback.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1182 [ grep  => ['gc->setValue("D:',$mythtv.'mythplugins/mythvideo/mythvideo/globalsettings.cpp'], shell => ["cd ".$unixmythtv."mythplugins/mythvideo","patch -p0 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' .'],
    1183 [ grep  => ['\"dvd:\/\"',$mythtv.'mythplugins/mythvideo/mythvideo/main.cpp'], shell => ["cd ".$unixmythtv."mythplugins/mythvideo","patch -p1 < ".$unixmythtv."mythtv/4718_undo.patch"] , comment => ' .'],
    11841203
    1185 
    1186 # Ticket 15831
    1187 
    1188 [ 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'],
    1189 [ filesame => [$mythtv.'mythtv/15831_win32_fs.patch',$sources."15831_win32_fs.patch"], copy => [''=>'',comment => 'XXXX'] ],
    1190 [ grep  =>  ['\+', $mythtv.'mythtv/15831_win32_fs.patch'], shell => ["cd ".$unixmythtv."mythtv","dos2unix 15831_win32_fs.patch"], comment => ' .'],
    1191 [ grep  => ['LOCALAPPDATA',$mythtv.'mythtv/libs/libmyth/mythcontext.cpp'], shell => ["cd ".$unixmythtv."mythtv","patch -p0 < ".$unixmythtv."mythtv/15831_win32_fs.patch"] , comment => ' .'],
    11921204;
    11931205
    11941206} # End if for $ticket
     
    13021314echo Creating build-folder Directories...
    13031315# Assumptions
    13041316# <installprefix> = ./mythtv
    1305 # themese go into <installprefix>/share/mythtv/themes
     1317# themes go into <installprefix>/share/mythtv/themes
    13061318# fonts go into <installprefix>/share/mythtv
    13071319# libraries go into installlibdir/mythtv
    13081320# plugins go into installlibdir/mythtv/plugins
     
    13501362'
    13511363],comment => 'write a script to install plugins to build folder'],
    13521364
    1353 # Create file to install myththemes
    1354 [ always => [],
    1355   write => [$mythtv.'setup_themes.sh',
    1356 '#!/bin/bash
    1357 source '.$unixmythtv.'qt'.$qtver.'_env.sh
    1358 cd '.$unixmythtv.'
    1359 echo Copying themes ...
    1360 cp -ur /usr/share/mythtv/themes ./build/share/mythtv/
    1361 cp /usr/share/mythtv/mythweather/* ./build/share/mythtv/mythweather
    1362 echo Copying international files....
    1363 cp /usr/share/mythtv/i18n/* ./build/share/mythtv/i18n
    1364 '
    1365 ],comment => 'write a script that will install themes to build folder'],
    13661365
    13671366# chmod the shell scripts, everytime
    13681367[ always  => [],
     
    16211620  shell   => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh',
    16221621              'cd '.$unixmythtv.'myththemes','make', 'make install'],
    16231622  comment => 'THEMES! redo make if we need to (see the  last_build.txt identifier)' ],
     1623 
    16241624
    1625 # Copy to build area
    1626 #[ filesame => [$mythtv.'build/share/mythtv/themes/Retro/theme.xml',$dosmsys.'/share/mythtv/themes/Retro/theme.xml'], shell => ['source '.$unixmythtv.'setup_themes.sh'], comment => 'Copy new themes to a build directory' ],
    1627 
    16281625# Get any extra Themes
    16291626#
    16301627
     
    16431640            'find '.$unixmythtv.'build/share/mythtv/themes/ -name "*.ttf"'.
    16441641            ' | xargs -n1 -i__ cp __ '.$unixmythtv.'build/share/mythtv'],
    16451642  comment => 'move ttf files'],
     1643 
     1644 
     1645# install fixup for redundant themes folders/folders/folders:
     1646[ always => '',
     1647  shell => [ 'cd /c/mythtv/build/share/mythtv/themes',
     1648             'for f in *; do mv $f/$f/* ./$f; done' ],
     1649  comment => 'relocate badly installed THEMES! ' ],
     1650
    16461651;
    16471652}
    16481653
     
    16571662'README for Win32 Installation of MythTV version: '.$version.' svn '.$SVNRELEASE.'
    16581663=============================================================
    16591664The current installation very basic:
    1660  - All exe and dlls are %PROGRAMFILES%\mythtv
     1665 - All exe and dlls are %PROGRAMFILES%\mythtv\bin
    16611666 - share/mythtv is copied to %PROGRAMFILES%\mythtv\share\mythtv
    16621667 - lib/mythtv is copied to %PROGRAMFILES%\mythtv\lib\mythtv
    16631668 - mysql.txt and user configuration files are set to %APPDATA%\mythtv
     
    16741679MYTHLIBDIR  = defaulting to %PROGRAMFILES%\mythv\lib
    16751680MYTHTVDIR   = defaulting to %APPDATA%\mythtv
    16761681','nocheck'],comment => ''],
    1677 [ file => $mythtv.'build/readme.txt_', shell => ['unix2dos '.$unixmythtv.'build/readme.txt', 'nocheck'],comment => '' ],
     1682[ file => $mythtv.'build/readme.txt_',
     1683  shell => ['unix2dos '.$unixmythtv.'build/readme.txt', 'nocheck'],comment => '' ],
    16781684;
    16791685
    16801686if ($package == 1) {