Ticket #4397: win32-packager.25.patch
File win32-packager.25.patch, 14.9 KB (added by , 17 years ago) |
---|
-
win32-packager.pl
126 126 127 127 print "Config:\n\tQT version: $qtver\n\tDLL's will be labeled as: $version\n"; 128 128 print "\tSVN location is: $svnlocation\n\tSVN revision is: $SVNRELEASE\n\n"; 129 print "Press [enter] to continue, or [ctrl]-c to exit now....\n"; 129 130 130 131 # TODO - use this list to define the components to build - only the first of these currently works well. 131 132 my @components = ( 'mythtv', 'myththemes', 'mythplugins' ); … … 225 226 # execute the action only if a file or directory exists [exists] 226 227 # stop the run, useful for script debugging [stop] 227 228 # pause the run, await a enter [pause] 229 # always execute the action (try to minimise the use of this!) [always] 228 230 229 231 #build actions (events) are: 230 232 # fetch a file from the web (to a location) [fetch] … … 355 357 # cp /c/Program\ Files/MySQL/MySQL\ Server\ 5.0/lib/opt/libmysql.lib /c/MinGW/lib 356 358 357 359 # 358 # TIP: we use a special file (with an extra _ ) as a marker to do this 359 # action every the time, it's harmless to do it more often that required. 360 # 'nocheck' means continue even if the cause doesn't exist after. 361 [ file => $mingw.'lib/libmysql.lib__', shell => ["cd /mingw/lib","reimp -d libmysql.lib","dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a",'nocheck'],comment => ' rebuild libmysql.a' ], 360 # TIP: we use a special file (with two extra _'s ) as a marker to say this acton is already done! 361 [ file => $mingw.'lib/libmysql.lib__', shell => ["cd /mingw/lib","reimp -d libmysql.lib","dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a","touch ".$unixmingw.'lib/libmysql.lib__'],comment => ' rebuild libmysql.a' ], 362 362 363 363 # grep => [pattern,file] , actions/etc 364 364 [ file => $mingw.'include/mysql___h.patch', write => [$mingw.'include/mysql___h.patch', … … 642 642 comment => 'rename mingw sh.exe out of the way before building QT! ' ] , 643 643 644 644 # Write a batch script for the QT environment under DOS: 645 [ file => $msys.'qt-win-opensource-src-4.3.4/qt4_env.bat_', 646 write => [$msys.'qt-win-opensource-src-4.3.4/qt4_env.bat', 645 [ always => [], write => [$msys.'qt-win-opensource-src-4.3.4/qt4_env.bat', 647 646 'rem a batch script for the QT environment under DOS: 648 647 set QTDIR='.$dosmsys.'qt-win-opensource-src-4.3.4 649 648 set MINGW='.$dosmingw.' … … 652 651 cd %QTDIR% 653 652 '.$dosmsys.'bin\yes | configure -plugin-sql-mysql -no-sql-sqlite -debug-and-release -fast -no-sql-odbc -no-qdbus 654 653 rem mingw32-make 655 ', 'nocheck'654 ', 656 655 ],comment=>'write a batch script for the QT4 environment under DOS'], 657 656 658 657 # test if the core .dll is built, and build QT if it isn't! … … 741 740 742 741 743 742 # chmod the shell scripts, everytime 744 [ file => $mythtv.'_' , shell => ["cd $mythtv","chmod 755 *.sh",'nocheck'] ],743 [ always => [] , shell => ["cd $mythtv","chmod 755 *.sh"] ], 745 744 746 745 #---------------------------------------- 747 746 # now we prep for the build of mythtv! … … 749 748 ; 750 749 if ($makeclean) { 751 750 push @{$expect}, 752 [ file => $mythtv.'make_clean.sh_', shell => ['source '.$unixmythtv.'make_clean.sh','nocheck'], comment => 'cleaning environment'],751 [ always => [], shell => ['source '.$unixmythtv.'make_clean.sh'], comment => 'cleaning environment'], 753 752 ; 754 753 } 755 754 # SVN update every time, before patches 756 755 foreach my $comp( @components ) { 757 756 push @{$expect}, 758 [ file => 'always', 759 exec => [$dosmsys."bin\\svn.exe -r $SVNRELEASE update $dosmythtv$comp", 760 'nocheck'], 757 [ always => [], 758 exec => [$dosmsys."bin\\svn.exe -r $SVNRELEASE update $dosmythtv$comp"], 761 759 comment => "Getting SVN updates for:$comp on $svnlocation" ]; 762 760 } 763 761 push @{$expect}, 764 762 765 763 # always get svn num 766 [ file => $mythtv.'_', exec => ['cd '.$dosmythtv.'mythtv && '.$dosmsys.'bin\svn.exe info > '.$dosmythtv.'mythtv\svn_info.new','nocheck'], comment => 'fetching the SVN number to a text file, if we can'],764 [ always => [], exec => ['cd '.$dosmythtv.'mythtv && '.$dosmsys.'bin\svn.exe info > '.$dosmythtv.'mythtv\svn_info.new'], comment => 'fetching the SVN number to a text file, if we can'], 767 765 [ filesame => [$mythtv.'mythtv\svn_info.txt',$mythtv.'mythtv\svn_info.new'], shell => ['touch -r '.$unixmythtv.'mythtv/svn_info.txt '.$unixmythtv.'mythtv/svn_info.new'], comment => 'match the datetime of these files, so that the contents only can be compared next' ], 768 766 769 767 # is svn num (ie file contents) changed since last run, if so, do a 'make … … 865 863 comment => 'do we already have a Makefile for mythtv?' ], 866 864 867 865 # make 866 867 # fix a bug in Makefile and make COPY_DIR cp -fr instead of cp -f 868 # TODO Check if this is necessary. I suspect it was meant to fix #4949? 869 # 870 [ file => $mythtv.'mythtv/fix_makefile.sh', write => [$mythtv.'mythtv/fix_makefile.sh', 871 'cd '.$unixmythtv.'mythtv 872 cat Makefile | sed "s/\(^COPY_DIR\W*\=\W*cp\)\(\W\-f\)/\1 -fr/" > Makefile_new 873 cp Makefile_new Makefile 874 ' 875 ],comment => 'write a script to fix Makefile'], 876 868 877 [ newer => [$mythtv."mythtv/libs/libmyth/libmyth-$version.dll", 869 878 $mythtv.'mythtv/last_build.txt'], 870 879 shell => ['rm '.$unixmythtv."mythtv/libs/libmyth/libmyth-$version.dll", … … 891 900 comment => 'programs/mythbackend/mythbackend.exe - redo make unless all these files exist, and are newer than the last_build.txt identifier' ], 892 901 893 902 894 # fix a bug in Makefile and make COPY_DIR cp -fr instead of cp -f895 # TODO Check if this is necessary. I suspect it was meant to fix #4949?896 #897 [ file => $mythtv.'mythtv/fix_makefile.sh', write => [$mythtv.'mythtv/fix_makefile.sh',898 'cd '.$unixmythtv.'mythtv899 cat Makefile | sed "s/\(^COPY_DIR\W*\=\W*cp\)\(\W\-f\)/\1 -fr/" > Makefile_new900 cp Makefile_new Makefile901 ', 'nocheck',902 ],comment => 'write a script to fix Makefile'],903 904 903 # Archive old build before we create a new one with make install: 905 [ exists => $ mythtv.'build_old',906 shell => ['rm -fr '.$unix mythtv.'build_old'],904 [ exists => $build.'_old', 905 shell => ['rm -fr '.$unixbuild.'_old'], 907 906 comment => 'Deleting old build backup'], 908 907 [ exists => $build, 909 shell => ['mv '.$unixbuild.' '.$unix mythtv.'build_old'],908 shell => ['mv '.$unixbuild.' '.$unixbuild.'_old'], 910 909 comment => 'Renaming build to build_old for backup....'], 911 910 912 911 # re-install to /c/mythtv/build if we have a newer mythtv build 913 912 # ready: 914 913 [ newer => [$build.'bin/mythfrontend.exe', … … 925 924 comment => 'copy the basic themes somewhere that mythtv can get at it.' ], 926 925 927 926 # setup_build creates the build area and copies results (apart from themes) 928 [ file => $mythtv.'setup_build.sh_', write => [$mythtv.'setup_build.sh',927 [ always => [], write => [$mythtv.'setup_build.sh', 929 928 '#!/bin/bash 930 929 source '.$unixmythtv.'qt'.$qtver.'_env.sh 931 930 cd '.$unixmythtv.' … … 958 957 touch '.$unixmythtv.'/build/package_flag 959 958 cp '.$unixmythtv.'gdb_*.bat '.$unixmythtv.'build/bin 960 959 cp '.$unixmythtv.'mythtv/contrib/Win32/debug/*.cmd '.$unixmythtv.'build/bin 961 ' ,'nocheck'960 ' 962 961 ],comment => 'write a script to install mythtv to build folder'], 963 962 964 963 965 964 # Create file to install myththemes 966 [ file => $mythtv.'setup_plugins.sh_', write => [$mythtv.'setup_plugins.sh',965 [ always => [], write => [$mythtv.'setup_plugins.sh', 967 966 '#!/bin/bash 968 967 source '.$unixmythtv.'qt'.$qtver.'_env.sh 969 968 cd '.$unixmythtv.' … … 977 976 echo Copying lib files... 978 977 cp -ur /lib/mythtv/* ./build/lib/mythtv 979 978 cp -ur /usr/lib/mythtv/* ./build/lib/mythtv 980 ' ,'nocheck'979 ' 981 980 ],comment => 'write a script to install plugins to build folder'], 982 981 983 982 # Create file to install myththemes 984 [ file => $mythtv.'setup_themes.sh_', write => [$mythtv.'setup_themes.sh',983 [ always => [], write => [$mythtv.'setup_themes.sh', 985 984 '#!/bin/bash 986 985 source '.$unixmythtv.'qt'.$qtver.'_env.sh 987 986 cd '.$unixmythtv.' … … 990 989 cp /usr/share/mythtv/mythweather/* ./build/share/mythtv/mythweather 991 990 echo Copying international files.... 992 991 cp /usr/share/mythtv/i18n/* ./build/share/mythtv/i18n 993 ' , 'nocheck'992 ' 994 993 ],comment => 'write a script that will install themes to build folder'], 995 994 996 995 # chmod the shell scripts, everytime 997 [ file => $mythtv.'_' , shell => ["cd $mythtv","chmod 755 *.sh",'nocheck'] ],996 [ always => [], shell => ["cd $mythtv","chmod 755 *.sh"] ], 998 997 999 998 # Change - don't run this until mythplugins are complete - otherwise dll/exe are copied twice 1000 999 # Run setup_build.sh which creates the build area and copies executables 1001 [ file => [$mythtv.'build/package_flag_'], shell => [$unixmythtv.'setup_build.sh', 'nocheck'],1000 [ always => [], shell => [$unixmythtv.'setup_build.sh' ], 1002 1001 comment => 'Copy mythtv into ./build folder' ], 1003 1002 ; 1004 1003 … … 1020 1019 # if this is doing an anonymous connection, so the BEST we should expect is 1021 1020 # an "access denied" message if the server is running properly. 1022 1021 push @{$expect}, 1023 [ file => $mythtv.'testmysqlsrv.bat_', exec => [ 'sc query mysql > '.$mythtv.'testmysqlsrv.bat','nocheck']],1022 [always => [], exec => [ 'sc query mysql > '.$mythtv.'testmysqlsrv.bat']], 1024 1023 [grep => ['SERVICE_NAME',$mythtv.'testmysqlsrv.bat'], exec => ['sc start mysql','nocheck']], 1025 1024 [grep => ['does not exist',$mythtv.'testmysqlsrv.bat'], exec =>['C:\Program Files\MySQL\MySQL Server 5.0\bin\MySQLd-nt.exe --standalone -console','nocheck']], 1026 1025 1027 1026 1028 [ file => $mythtv.'testmysql.bat_', write => [ $mythtv.'testmysql.bat',1027 [ always => [], write => [ $mythtv.'testmysql.bat', 1029 1028 '@echo off 1030 1029 echo testing connection to a local mysql server... 1031 1030 sleep 5 … … 1034 1033 type '.$dosmythtv.'_mysqlshow_out.txt >> '.$dosmythtv.'_mysqlshow_err.txt 1035 1034 del '.$dosmythtv.'_mysqlshow_out.txt 1036 1035 sleep 1 1037 ' ,'nocheck']],1036 ']], 1038 1037 1039 1038 # try to connect as mythtv/mythtv first (the best case scenario) 1040 1039 [ file => $mythtv.'skipping_db_tests.txt', exec => [$mythtv.'testmysql.bat','nocheck'], comment => 'First check - is the local mysql server running, accepting connections, and all that? (follow the bouncing ball on the install, a standard install is OK, remember the root password that you set, start it as a service!)' ], … … 1049 1048 1050 1049 1051 1050 #set/reset mythtv/mythtv password! 1052 [ file => $mythtv.'resetmythtv.bat_', write => [ $mythtv.'resetmythtv.bat',1051 [ always => [], write => [ $mythtv.'resetmythtv.bat', 1053 1052 "\@echo off 1054 1053 echo stopping mysql service: 1055 1054 net stop MySQL … … 1072 1071 echo. 1073 1072 echo Password for user 'mythtv' was reset to 'mythtv' 1074 1073 echo. 1075 " ,'nocheck'],1074 "], 1076 1075 comment => 'writing a script to create the mysql user (mythtv/mythtv) without needing to ask you for the root password ...'], 1077 1076 1078 1077 # reset passwords, this give the myhttv user FULL access to the entire mysql … … 1091 1090 [ grep => ['mythconverg',$mythtv.'_mysqlshow_err.txt'], exec => [ 'echo create database mythconverg; | "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe" -u mythtv --password=mythtv','nocheck'], comment => ' does the mythconverg database exist? (and can this user see it?) '], 1092 1091 1093 1092 # Make mysql.txt file required for testing 1094 [ file => $ ENV{APPDATA}.'\.mythtv\mysql.txt', write => [$ENV{APPDATA}.'\.mythtv\mysql.txt',1093 [ file => $home.'.mythtv\mysql.txt', write => [$home.'.mythtv\mysql.txt', 1095 1094 'DBHostName=127.0.0.1 1096 1095 DBHostPing=no 1097 1096 DBUserName=mythtv 1098 1097 DBPassword=mythtv 1099 1098 DBName=mythconverg 1100 1099 DBType=QMYSQL3 1101 LocalHostName='.$ENV{COMPUTERNAME} .'1102 ','nocheck'],1100 LocalHostName='.$ENV{COMPUTERNAME} 1101 ], 1103 1102 comment => 'create a mysql.txt file at: %HOMEPATH%\.mythtv\mysql.txt' ], 1104 1103 1105 1104 ; … … 1114 1113 push @{$expect}, 1115 1114 # 1116 1115 # hack location of //include/mythtv/mythconfig.mak so that configure is successful 1117 [ file => $msys.'include/mythtv/mythconfig.mak',1116 [ always => [], 1118 1117 shell => ['mkdir /include/mythtv', 1119 'cp '.$unix mythtv.'build/include/mythtv/mythconfig.mak'.1120 ' /include/mythtv/mythconfig.mak' , 'nocheck'],1118 'cp '.$unixbuild.'include/mythtv/mythconfig.mak'. 1119 ' /include/mythtv/mythconfig.mak'], 1121 1120 comment => 'link mythconfig.mak'], 1122 1121 ## config: 1123 1122 [ file => $mythtv.'mythplugins/Makefile', … … 1201 1200 [ file => $mythtv.'build/share/mythtv/themes/MePo-wide/ui.xml', shell => ['cp -fr '.$unixsources.'MePo-wide '.$unixmythtv.'build/share/mythtv/themes','nocheck'], comment => 'install MePo-wide'], 1202 1201 1203 1202 # Move ttf fonts to font directory 1204 [ file => $mythtv.'qt'.$qtver.'_env.sh_', shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'myththemes','find '.$unixmythtv.'build/share/mythtv/themes/ -name "*.ttf" | xargs -n1 -i__ cp __ '.$unixmythtv.'build/share/mythtv', 'nocheck'], comment => 'move ttf files'],1203 [always => [], shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'myththemes','find '.$unixmythtv.'build/share/mythtv/themes/ -name "*.ttf" | xargs -n1 -i__ cp __ '.$unixmythtv.'build/share/mythtv'], comment => 'move ttf files'], 1205 1204 ; 1206 1205 } 1207 1206 … … 1268 1267 write => [$mythtv.'build/isfiles/configuremysql.vbs', 1269 1268 'WScript.Echo "Currently Unimplemented" 1270 1269 ' ], comment => 'Write a VB script to configure MySQL' ], 1271 [ file => $mythtv.'build/isfiles/versioninfo.iss',1270 [ always => [], 1272 1271 write => [$mythtv.'build/isfiles/versioninfo.iss', ' 1273 1272 #define MyAppName "MythTv" 1274 1273 #define MyAppVerName "MythTv '.$version.'(svn_'.$SVNRELEASE .')" 1275 1274 #define MyAppPublisher "Mythtv" 1276 1275 #define MyAppURL "http://www.mythtv.org" 1277 1276 #define MyAppExeName "Win32MythTvInstall.exe" 1278 ' ,'nocheck'], comment => 'write the version information for the setup'],1277 ' ], comment => 'write the version information for the setup'], 1279 1278 [ file => $mythtv.'genfiles.sh', write => [$mythtv.'genfiles.sh',' 1280 1279 cd '.$unixmythtv.'build 1281 1280 find . -type f -printf "Source: '.$mythtv.'build/%h/%f; Destdir: {app}/%h\n" | sed "s/\.\///" | grep -v ".svn" | grep -v "isfiles" | grep -v "include" > '.$unixmythtv.'/build/isfiles/files.iss … … 1449 1448 if ( -e $cause[0] ) { 1450 1449 effect($effecttype,@nocheckeffectparams); 1451 1450 } 1452 1451 } elsif ( $causetype eq 'always' ) { 1452 effect($effecttype,@nocheckeffectparams); 1453 1453 } elsif ( $causetype eq 'stop' ){ 1454 1454 die "Stop found \n"; 1455 1455 } elsif ( $causetype eq 'pause' ){ … … 1519 1519 } else { 1520 1520 die " unknown effecttype $effecttype from cause 'dir'\n"; 1521 1521 } 1522 return; # which ever one we actioned, we don't want to action anything else 1522 1523 } 1523 1524 1524 1525 #------------------------------------------------------------------------------ … … 1643 1644 if (! $NOISY ) { 1644 1645 # skip known spurious messages from going to the screen unnecessarily 1645 1646 next if /redeclared without dllimport attribute after being referenced with dllimpo/; 1647 next if /declared as dllimport: attribute ignored/; 1646 1648 next if /warning: overriding commands for target `\.\'/; 1647 1649 next if /warning: ignoring old commands for target `\.\'/; 1648 1650 next if /Nothing to be done for `all\'/;