Ticket #5213: win32-packager.diff

File win32-packager.diff, 14.9 KB (added by arnonm@…, 16 years ago)

Update to win32-packager to resolve win32 QT3 bugs

  • win32-packager.pl

     
    103103{   $qtver = 4   }
    104104
    105105# force us to label the DLL's as 0.21 if we are on the release 21 branch!
    106 $version = '0.21' if   $svnlocation eq "branches/release-0-21-fixes";
     106# 0.22-fixes doesn't exist yet.
     107if ($svnlocation eq "branches/release-0-22-fixes") {
     108        $version = '0.21';
     109        $svnlocation = "branches/release-0-21-fixes";
     110        $qtver = 3;
     111       
     112}
    107113
    108114print "Config:\n\tQT version: $qtver\n\tDLL's will be labeled as: $version\n\tSVN location is: $svnlocation\n\n";
    109115
     
    694700export QMAKESPEC=$QTDIR/mkspecs/win32-g++
    695701export LD_LIBRARY_PATH=$QTDIR/lib:/usr/lib:/mingw/lib:/lib
    696702export PATH=$QTDIR/bin:/usr/local/bin:$PATH
     703export INSTALL_ROOT='.$unixmythtv.'build
    697704' ],comment => 'write a QT3 script that we can source later when inside msys to setup the environment variables'],
    698705
    699706
     
    703710export QMAKESPEC=$QTDIR/mkspecs/win32-g++
    704711export LD_LIBRARY_PATH=$QTDIR/lib:/usr/lib:/mingw/lib:/lib
    705712export PATH=$QTDIR/bin:/usr/local/bin:$PATH
     713export INSTALL_ROOT='.$unixmythtv.'build
    706714' ],comment => 'write a QT4 script that we can source later when inside msys to setup the environment variables'],
    707715
    708716
     
    846854[ grep => ['Makefile|MAKEFILE',$mythtv.'mythtv/Makefile'], shell => ['rm '.$unixmythtv.'mythtv/Makefile','nocheck'], comment => 'broken Makefile, delete it' ],
    847855
    848856# configure
    849 [ file => $mythtv.'mythtv/Makefile', shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'mythtv','./configure --prefix=/usr --disable-dbox2 --disable-hdhomerun --disable-iptv --disable-joystick-menu --disable-xvmc-vld --disable-xvmc --enable-directx --cpu=k8 --compile-type='.$compile_type], comment => 'do we already have a Makefile for mythtv?' ],
     857[ file => $mythtv.'mythtv/Makefile', shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'mythtv','./configure --prefix=/ --disable-dbox2 --disable-hdhomerun --disable-iptv --disable-joystick-menu --disable-xvmc-vld --disable-xvmc --enable-directx --cpu=k8 --enable-memalign-hack --compile-type='.$compile_type], comment => 'do we already have a Makefile for mythtv?' ],
     858# fix depends bug
     859[ grep => ['cpsvndir', $mythtv.'mythtv/settings.pro'], shell => ['echo "win32:QMAKE_INSTALL_DIR = sh ./cpsvndir" >> '.$mythtv.'mythtv/settings.pro','nocheck'], comment => 'fix myththemes.pro' ],
     860
    850861# make
    851862[ newer => [$mythtv."mythtv/libs/libmyth/libmyth-$version.dll",
    852863            $mythtv.'mythtv/last_build.txt'],
     
    885896
    886897# re-install to msys /usr/bin folders etc, if we have a newer mythtv build
    887898# ready:
    888 [ newer => [$msys.'bin/mythfrontend.exe',
     899[ newer => [$mythtv.'build/bin/mythfrontend.exe',
    889900            $mythtv.'mythtv/programs/mythfrontend/mythfrontend.exe'],
    890901  shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh',
    891902            'cd '.$unixmythtv.'mythtv','make install'],
     
    896907# copy the basic themes somewhere that mythtv can get at it.
    897908# TODO this should really be independent of the msys folders, but it's not
    898909# at present?
     910[dir => [$msys.'share\mythtv\themes\G.A.N.T'], shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh',
     911            'cd '.$unixmythtv.'mythtv','make install_themes'], comment => 'copy the basic themes somewhere that mythtv can get at it.' ],
    899912
    900 [ dir => $msys.'share\mythtv\themes\G.A.N.T', shell => ['mkdir /usr/share/mythtv','mkdir /usr/share/mythtv/themes','cp -r /c/mythtv/mythtv/themes/* /usr/share/mythtv/themes/'], comment => 'copy the basic themes somewhere that mythtv can get at it.' ],
     913#[ dir => $msys.'share\mythtv\themes\G.A.N.T', shell => ['mkdir /usr/share/mythtv','mkdir /usr/share/mythtv/themes','cp -r /c/mythtv/mythtv/themes/* /usr/share/mythtv/themes/'], comment => 'copy the basic themes somewhere that mythtv can get at it.' ],
    901914
    902915# setup_build creates the build area and copies results (apart from themes)
    903916[ file => $mythtv.'setup_build.sh_', write => [$mythtv.'setup_build.sh',
     
    906919cd '.$unixmythtv.'
    907920echo renaming build to build_old for backup....
    908921# keep around just one earlier verion in build_old:
    909 rm -rf build_old
    910 mv build build_old
    911 mkdir build
     922#rm -rf build_old
     923#mv build build_old
     924#mkdir build
    912925echo copying exes and dlls to the build folder...
    913 find . -name \\*.exe  | grep -v build | xargs -n1 -i__ cp __ ./build/
    914 find . -name \\*.dll  | grep -v build | xargs -n1 -i__ cp __ ./build/ 
     926#find . -name \\*.exe  | grep -v build | xargs -n1 -i__ cp __ ./build/
     927#find . -name \\*.dll  | grep -v build | xargs -n1 -i__ cp __ ./build/ 
    915928echo copying main QT dlls to build folder...
    916929# mythtv probably needs the qt3 dlls at runtime:
    917 cp '.$unixmsys.'qt-3.3.x-p8/lib/*.dll '.$unixmythtv.'build
     930cp      '.$unixmsys.'qt-3.3.x-p8/lib/*.dll '.$unixmythtv.'build/bin
    918931# mythtv probably needs the qt4 dlls at runtime:
    919 cp '.$unixmsys.'qt-win-opensource-4.3.4/lib/*.dll '.$unixmythtv.'build
     932cp '.$unixmsys.'qt-win-opensource-4.3.4/lib/*.dll '.$unixmythtv.'build/bin
    920933# qt mysql connection dll has to exist in a subfolder called sqldrivers:
    921934echo Creating build-folder Directories...
    922935# Assumptions
     
    927940# plugins go into installlibdir/mythtv/plugins
    928941# filters go into installlibdir/mythtv/filters
    929942# translations go into <installprefix>/share/mythtv/i18n
    930 mkdir '.$unixmythtv.'/build/sqldrivers
    931 mkdir '.$unixmythtv.'/build/share
     943mkdir '.$unixmythtv.'/build/bin/sqldrivers
     944#mkdir '.$unixmythtv.'/build/share
    932945# mkdir $unixmythtv/build/include - dont nead headers at runtime
    933 mkdir '.$unixmythtv.'/build/lib
    934 mkdir '.$unixmythtv.'/build/lib/mythtv
    935 mkdir '.$unixmythtv.'/build/share/mythtv
    936 mkdir '.$unixmythtv.'/build/share/mythtv/themes
    937 mkdir '.$unixmythtv.'build/share/mythtv/mythweather
    938 mkdir '.$unixmythtv.'build/share/mythtv/i18n
     946#mkdir '.$unixmythtv.'/build/lib
     947#mkdir '.$unixmythtv.'/build/lib/mythtv
     948#mkdir '.$unixmythtv.'/build/share/mythtv
     949#mkdir '.$unixmythtv.'/build/share/mythtv/themes
     950#mkdir '.$unixmythtv.'build/share/mythtv/mythweather
     951#mkdir '.$unixmythtv.'build/share/mythtv/i18n
    939952echo Copying QT plugin required dlls....
    940 cp '.$unixmsys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll '.$unixmythtv.'build/sqldrivers
    941 cp '.$unixmsys.'qt-win-opensource-4.3.4/plugins/sqldrivers/qsqlmysql4.dll '.$unixmythtv.'build/sqldrivers
     953cp '.$unixmsys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll '.$unixmythtv.'build/bin/sqldrivers
     954cp '.$unixmsys.'qt-win-opensource-4.3.4/plugins/sqldrivers/qsqlmysql4.dll '.$unixmythtv.'build/bin/sqldrivers
    942955echo Copying ming and msys dlls to build folder.....
    943956# pthread dlls and mingwm10.dll are copied from here:
    944 cp /mingw/bin/*.dll '.$unixmythtv.'build
     957cp /mingw/bin/*.dll '.$unixmythtv.'build/bin
    945958# msys-1.0.dll dll is copied from here:
    946 cp /bin/msys-1.0.dll '.$unixmythtv.'build
     959cp /bin/msys-1.0.dll '.$unixmythtv.'build/bin
    947960# copy exes and dlls to the build folder:
    948961#echo Copying exe files....
    949962#find . -name \\*.exe  | grep -v build | xargs -n1 -i__ cp __ ./build/
     
    952965#echo Copying language files
    953966#find . -name \\*.qm | grep -v build | xargs -n -i__ cp __ ./build/share/mythtv/i18n
    954967echo copying share files...
    955 cp -r /share/mythtv ./build/share/
     968#cp -r /share/mythtv ./build/share/
    956969echo copying lib files...
    957 cp -r /lib/mythtv/ ./build/lib/
    958 cp -r /usr/lib/mythtv/ ./build/lib/
     970mv '.$unixmythtv.'build/lib/*.dll '.$unixmythtv.'build/bin/
     971#cp -r /lib/mythtv/ ./build/lib/
     972#cp -r /usr/lib/mythtv/ ./build/lib/
    959973#echo copying include files...
    960974#cp -r /include/mythtv ./build/include/
    961 cp /usr/bin/myth*.exe ./build/
    962 cp /usr/bin/libmyth*.dll ./build/
    963 cp /usr/bin/mtd.exe ./build/
    964 cp /usr/bin/ignyte.exe ./build/
     975#cp /usr/bin/myth*.exe ./build/
     976#cp /usr/bin/libmyth*.dll ./build/
     977#cp /usr/bin/mtd.exe ./build/
     978#cp /usr/bin/ignyte.exe ./build/
    965979touch '.$unixmythtv.'/build/package_flag
    966 cp '.$unixmythtv.'gdb_*.bat '.$unixmythtv.'build
    967 cp '.$unixmythtv.'mythtv/contrib/Win32/debug/*.cmd '.$unixmythtv.'build
     980cp '.$unixmythtv.'gdb_*.bat '.$unixmythtv.'build/bin
     981cp '.$unixmythtv.'mythtv/contrib/Win32/debug/*.cmd '.$unixmythtv.'build/bin
    968982','nocheck'
    969983],comment => 'write a script to install mythtv to build folder'],
    970984
     
    10051019
    10061020# Change - don't run this until mythplugins are complete - otherwise dll/exe are copied twice
    10071021# Run setup_build.sh which creates the build area and copies executables
    1008 [ file => [$mythtv.'build/package_flag'], shell => [$unixmythtv.'setup_build.sh'],
     1022[ file => [$mythtv.'build/package_flag_'], shell => [$unixmythtv.'setup_build.sh', 'nocheck'],
    10091023  comment => 'Copy mythtv into ./build folder' ],
    10101024;
    10111025
     
    11201134#
    11211135push @{$expect},
    11221136#
     1137# hack location of //include/mythtv/mythconfig.mak so that configure is successful
     1138[ file => $msys.'include/mythtv/mythconfig.mak',
     1139          shell => ['mkdir /include/mythtv', 'cp '.$unixmythtv.'build/include/mythtv/mythconfig.mak /include/mythtv/mythconfig.mak', 'nocheck'],
     1140                comment => 'link mythconfig.mak'],
    11231141## config:
    1124 [ file => $mythtv.'mythplugins/Makefile', shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'mythplugins','./configure --prefix=/usr --disable-mythgallery --disable-mythmusic --disable-mytharchive --disable-mythbrowser --disable-mythflix --disable-mythgame --disable-mythnews --disable-mythphone --disable-mythzoneminder --disable-mythweb --enable-aac --enable-libvisual --enable-fftw --compile-type='.$compile_type,'touch '.$unixmythtv.'mythplugins/cleanup/cleanup.pro'], comment => 'do we already have a Makefile for myth plugins?' ],
     1142[ file => $mythtv.'mythplugins/Makefile',
     1143                shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh',
     1144                                'cd '.$unixmythtv.'mythplugins',
     1145                                './configure --prefix= --disable-mythgallery --disable-mythmusic --disable-mytharchive --disable-mythbrowser --disable-mythflix --disable-mythgame --disable-mythnews --disable-mythphone --disable-mythzoneminder --disable-mythweb --enable-aac --enable-libvisual --enable-fftw --compile-type='.$compile_type,
     1146                                'touch '.$unixmythtv.'mythplugins/cleanup/cleanup.pro'],
     1147                comment => 'do we already have a Makefile for myth plugins?' ],
    11251148
     1149#add cpsvndir
     1150[ grep => ['cpsvndir', $mythtv.'mythplugins/settings.pro'], shell => ['echo \'win32:QMAKE_INSTALL_DIR = sh ./cpsvndir\' >> '.$mythtv.'mythplugins/settings.pro','nocheck'], comment => 'fix settings.pro' ],
     1151[ grep => ['win32:DEPENDS', $mythtv.'mythplugins/settings.pro'], shell => ['echo \'win32:DEPENDS += ./\' >> '.$mythtv.'mythplugins/settings.pro','nocheck'], comment => 'fix settings.pro' ],
    11261152
     1153#hack mythconfig.mak to remove /usr
     1154[ grep => ['LIBDIR=/lib', $mythtv.'mythplugins/mythconfig.mak'],
     1155                shell => ['cd '.$unixmythtv.'mythplugins','sed -e \'s|/usr||\' mythconfig.mak > mythconfig2.mak', 'cp mythconfig2.mak mythconfig.mak', 'nocheck'],
     1156                comment => 'hack mythconfig.mak'],
    11271157## make
    1128 [ newer => [$mythtv.'mythplugins/mythmovies/mythmovies/libmythmovies.dll',$mythtv.'mythtv/last_build.txt'], shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'mythplugins','make'], comment => 'PLUGINS! redo make if we need to (see the  last_build.txt identifier)' ],
     1158[ newer => [$mythtv.'mythplugins/mythmovies/mythmovies/libmythmovies.dll',$mythtv.'mythtv/last_build.txt'],
     1159                shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'mythplugins','make'],
     1160                comment => 'PLUGINS! redo make if we need to (see the  last_build.txt identifier)' ],
    11291161
     1162# make cleanup/cleanup.pro as install fails without it
     1163[ file => $mythtv.'mythplugins/cleanup/cleanup.pro',
     1164                shell => ['touch '.$unixmythtv.'mythplugins/cleanup/cleanup.pro', 'nocheck'],
     1165                comment => 'make cleanup.pro'],
    11301166## make install
    1131 [ newer => [$msys.'lib/mythtv/plugins/libmythmovies.dll',$mythtv.'mythplugins/mythmovies/mythmovies/libmythmovies.dll'], shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'mythplugins','make install'], comment => 'PLUGINS! make install' ],
     1167[ newer => [$mythtv.'build/lib/mythtv/plugins/libmythmovies.dll',$mythtv.'mythplugins/mythmovies/mythmovies/libmythmovies.dll'], shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'mythplugins','make install'], comment => 'PLUGINS! make install' ],
    11321168
    11331169# Copy to build area
    1134 [ newer => [$mythtv.'build/lib/mythtv/plugins/libmythmovies.dll',$msys.'lib/mythtv/plugins/libmythmovies.dll'], shell => [$unixmythtv.'setup_plugins.sh'], comment => 'Copy mythplugins to ./build folder' ],
     1170#[ newer => [$mythtv.'build/lib/mythtv/plugins/libmythmovies.dll',$msys.'lib/mythtv/plugins/libmythmovies.dll'], shell => [$unixmythtv.'setup_plugins.sh'], comment => 'Copy mythplugins to ./build folder' ],
    11351171;
    11361172}
    11371173
     
    11421178# -------------------------------
    11431179push @{$expect},
    11441180## config:
    1145 [ file => $mythtv.'myththemes/Makefile', shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'myththemes','./configure --prefix=/usr '], comment => 'do we already have a Makefile for myththemes?' ],
     1181[ file => $mythtv.'myththemes/Makefile', shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'myththemes','./configure --prefix= '], comment => 'do we already have a Makefile for myththemes?' ],
    11461182
     1183## fix myththemes.pro
     1184[ grep => ['^win32:QMAKE_INSTALL_DIR', $mythtv.'myththemes/myththemes.pro'], shell => ['echo \'win32:QMAKE_INSTALL_DIR = sh ./cpsvndir\' >> '.$mythtv.'myththemes/myththemes.pro','nocheck'], comment => 'fix myththemes.pro' ],
     1185[ grep => ['win32:DEPENDS', $mythtv.'myththemes/myththemes.pro'], shell => ['echo \'win32:DEPENDS += ./\' >> '.$mythtv.'myththemes/myththemes.pro','nocheck'], comment => 'fix myththemes.pro' ],
     1186
     1187#hack mythconfig.mak to remove /usr
     1188[ grep => ['LIBDIR=/lib', $mythtv.'myththemes/mythconfig.mak'],
     1189                shell => ['cd '.$unixmythtv.'myththemes','sed -e \'s|/usr||\' mythconfig.mak > mythconfig2.mak', 'cp mythconfig2.mak mythconfig.mak', 'nocheck'],
     1190                comment => 'hack mythconfig.mak'],
     1191
    11471192# fix a bug in Makefile and make COPY_DIR cp -fr instead of cp -f
    11481193#[ file => $mythtv.'myththemes/fix_makefile.sh', write => [$mythtv.'myththemes/fix_makefile.sh',
    11491194#'cd '.$unixmythtv.'myththemes
     
    11541199#[ grep => ['COPY_DIR\W*=\W*cp -fr',$mythtv.'myththemes/Makefile'], shell => ['cd '.$unixmythtv.'myththemes','source ./fix_makefile.sh'], comment => 'fix Makefile'],
    11551200
    11561201## make
    1157 #[ newer => [$dosmsys.'/share/mythtv/themes/Retro/theme.xml',$mythtv.'mythtv/last_build.txt'], shell => ['rm /usr/share/mythtv/themes/Retro/base.xml','source '.$unixmythtv.'qt'.$qtver.'_env.sh','cd '.$unixmythtv.'myththemes','make', 'make install_themes'], comment => 'THEMES! redo make if we need to (see the  last_build.txt identifier)' ],
     1202[ dir => [$mythtv.'/build/share/mythtv/themes/Retro'],
     1203                shell => ['source '.$unixmythtv.'qt'.$qtver.'_env.sh',
     1204                                'cd '.$unixmythtv.'myththemes','make', 'make install'],
     1205                                comment => 'THEMES! redo make if we need to (see the  last_build.txt identifier)' ],
    11581206
    11591207# Copy to build area
    11601208#[ 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' ],