83 | | #NOTE: ITS IMPORTANT THAT ALL PATHS use FORWARD SLASHES in the declarations below, the code depends on it. |
84 | | # ... and much of the path separator code is fragile! |
85 | | # In some places we regex these into double backslashes, and at other times to a single |
86 | | # backslash so that the call-outs to different environments (DOS/msys/perlticks) work. hopefully. |
87 | | # (The only exception to "always forwardslash" is the contents of the file/s that are created with the 'write' action.) |
88 | | |
89 | | #NOTE: [exec] actions should always refer to $dosXXX paths |
90 | | # [shell] actions should always refer to $unixXXX paths |
| 84 | #NOTE: ITS IMPORTANT that the PATHS use the correct SLASH-ing method for the type of action: |
| 85 | # for [exec] actions, use standard DOS paths, with single BACK-SLASHES '\' (unless in double quotes, then double the backslashes) |
| 86 | # for [shell] actions, use standard UNIX paths, with single FORWARD-SLASHES '/' |
| 87 | # |
| 88 | #NOTE: when refering to variables in paths, try to keep them out of double quotes, or the slashing can get confused: |
| 89 | # [exec] actions should always refer to $dosXXX path variables |
| 90 | # [shell] actions should always refer to $unixXXX path variables |
148 | | [ dir => $mingw, exec => $sources.'MinGW-5.1.3.exe',comment => 'install MinGW (be sure to install g++, g77 and ming make too) - 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? |
149 | | [ file => $mingw."bin/gcc.exe", exec => $sources.'MinGW-5.1.3.exe',comment => 'unable to gind a gcc.exe where expected, rerunning MinGW installer!' ], # interactive, supposed to install g++ and ming make too, but people forget to select them? |
| 153 | [ dir => $mingw, exec => $dossources.'MinGW-5.1.3.exe',comment => 'install MinGW (be sure to install g++, g77 and ming make too) - 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? |
| 154 | [ file => $mingw."bin/gcc.exe", exec => $dossources.'MinGW-5.1.3.exe',comment => 'unable to gind a gcc.exe where expected, rerunning MinGW installer!' ], # interactive, supposed to install g++ and ming make too, but people forget to select them? |
166 | | [ file => $mingw.'bin/mingw32-make.exe', exec => $sources.'MinGW-5.1.3.exe',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.' ], |
167 | | [ file => $mingw.'bin/g++.exe', exec => $sources.'MinGW-5.1.3.exe',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.' ], |
168 | | [ file => $mingw.'bin/g77.exe', exec => $sources.'MinGW-5.1.3.exe',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.' ], |
| 170 | [ file => $mingw.'bin/mingw32-make.exe', exec => $dossources.'MinGW-5.1.3.exe',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.' ], |
| 171 | [ file => $mingw.'bin/g++.exe', exec => $dossources.'MinGW-5.1.3.exe',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.' ], |
| 172 | [ file => $mingw.'bin/g77.exe', exec => $dossources.'MinGW-5.1.3.exe',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.' ], |
200 | | [ file => $msys.'lib/libz.a', exec => "copy /Y ".$dossources."zlib/usr/lib/* ".$dosmsys."lib/" ], |
201 | | [ file => $msys.'bin/msys-z.dll', exec => "copy /Y ".$dossources."zlib/usr/bin/* ".$dosmsys."bin/" ], |
202 | | [ file => $msys.'include/zlib.h', exec => "copy /Y ".$dossources."zlib/usr/include/* ".$dosmsys."include/" ], |
| 204 | [ file => $msys.'lib/libz.a', exec => ["copy /Y ".$dossources.'zlib\usr\lib\* '.$dosmsys."lib"] ], |
| 205 | [ file => $msys.'bin/msys-z.dll', exec => ["copy /Y ".$dossources.'zlib\usr\bin\* '.$dosmsys."bin"] ], |
| 206 | [ file => $msys.'include/zlib.h', exec => ["copy /Y ".$dossources.'zlib\usr\include\*', $dosmsys."include"] ], |
204 | | [ file => $msys.'lib/libz.a', exec => "copy /Y ".$dossources."zlib/usr/lib/* ".$dosmingw."lib/" ], |
205 | | [ file => $msys.'bin/msys-z.dll', exec => "copy /Y ".$dossources."zlib/usr/bin/* ".$dosmingw."bin/" ], |
206 | | [ file => $msys.'include/zlib.h', exec => "copy /Y ".$dossources."zlib/usr/include/* ".$dosmingw."include/" ], |
| 208 | [ file => $msys.'lib/libz.a', exec => ["copy /Y ".$dossources.'zlib\usr\lib\* '.$dosmingw."lib"] ], |
| 209 | [ file => $msys.'bin/msys-z.dll', exec => ["copy /Y ".$dossources.'zlib\usr\bin\*', $dosmingw."bin"] ], |
| 210 | [ file => $msys.'include/zlib.h', exec => ["copy /Y ".$dossources.'zlib\usr\include\* '.$dosmingw."include"] ], |
| 211 | |
| 212 | |
213 | | # TODO after install (not done yet) |
214 | | [ file => $mingw.'bin/libmySQL.dll', exec => "copy /Y \"c:/Program Files/MySQL/MySQL Server 5.0/bin/libmySQL.dll\" $dosmingw/bin/",comment => 'post-mysql-install' ], |
215 | | [ file => $mingw.'include/mysql.h', exec => "copy /Y \"c:/Program Files/MySQL/MySQL Server 5.0/include/*\" $dosmingw/include/" ], |
216 | | [ file => $mingw.'lib/libmysql.lib', exec => "copy /Y \"c:/Program Files/MySQL/MySQL Server 5.0/lib/opt/libmysql.lib\" $dosmingw/lib/" ], |
| 219 | # after mysql install |
| 220 | [ filesame => [$mingw.'bin/libmySQL.dll','c:/Program Files/MySQL/MySQL Server 5.0/bin/libmySQL.dll'], copy => [''=>'',comment => 'post-mysql-install'] ], |
| 221 | [ filesame => [$mingw.'lib/libmySQL.dll','c:/Program Files/MySQL/MySQL Server 5.0/bin/libmySQL.dll'], copy => [''=>'',comment => 'post-mysql-install'] ], |
| 222 | [ filesame => [$mingw.'lib/libmysql.lib','c:/Program Files/MySQL/MySQL Server 5.0/lib/opt/libmysql.lib'], copy => [''=>''] ], |
| 223 | [ file => $mingw.'include/mysql.h' , exec => 'copy /Y "c:\Program Files\MySQL\MySQL Server 5.0\include\*" '.$dosmingw."include" ], |
221 | | # |
222 | | # TIP: we use a special file (with an extra _ ) as a marker to do this action every the time, it's harmless to do it more often that required. "nocheck" means continue even if the cause doesn't exist after. |
223 | | [ file => $mingw.'lib/libmysql.lib__', shell => ["cd $unixmingw/lib","reimp -d libmysql.lib","dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a","nocheck"],comment => ' rebuild libmysql.a' ], |
224 | | |
| 228 | # |
| 229 | # TIP: we use a special file (with an extra _ ) as a marker to do this action every the time, it's harmless to do it more often that required. 'nocheck' means continue even if the cause doesn't exist after. |
| 230 | [ 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' ], |
228 | | [ file => $mingw.'include/mysql__h.patch', write => [$mingw.'include/mysql__h.patch', |
229 | | '*** orig_mysql.h Fri Jul 6 13:24:56 2007 |
230 | | *** mysql.h_orig Fri Jan 4 19:35:33 2008 |
231 | | --- mysql.h Fri Jan 4 16:45:46 2008 |
232 | | *************** |
233 | | *** 45,51 **** |
234 | | #include <winsock.h> /* For windows */ |
235 | | #endif |
236 | | typedef char my_bool; |
237 | | ! #if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) |
238 | | #define __WIN__ |
239 | | #endif |
240 | | #if !defined(__WIN__) |
241 | | --- 45,51 ---- |
242 | | #include <winsock.h> /* For windows */ |
243 | | #endif |
244 | | typedef char my_bool; |
245 | | ! #if (defined(_WIN32) || defined(_WIN64) || defined(__MINGW32__)) && !defined(__WIN__) |
246 | | #define __WIN__ |
247 | | #endif |
248 | | #if !defined(__WIN__) |
249 | | ' ],comment => 'write the patch to the the mysql.h file'], |
| 234 | [ file => $mingw.'include/mysql___h.patch', write => [$mingw.'include/mysql___h.patch', |
| 235 | '--- mysql.h_orig Fri Jan 4 19:35:33 2008 |
| 236 | +++ mysql.h Tue Jan 8 14:48:36 2008 |
| 237 | @@ -41,11 +41,9 @@ |
| 238 | |
| 239 | #ifndef _global_h /* If not standard header */ |
| 240 | #include <sys/types.h> |
| 241 | -#ifdef __LCC__ |
| 242 | #include <winsock.h> /* For windows */ |
| 243 | -#endif |
| 244 | typedef char my_bool; |
| 245 | -#if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) |
| 246 | +#if (defined(_WIN32) || defined(_WIN64) || defined(__MINGW32__)) && !defined(__WIN__) |
| 247 | #define __WIN__ |
| 248 | #endif |
| 249 | #if !defined(__WIN__) |
| 250 | |
| 251 | ' ],comment => 'write the patch for the the mysql.h file'], |
264 | | [ file => $mingw.'lib/libpthread.a', exec => "copy /Y ".$dossources."pthread/libpthread.a ".$dosmingw.'lib/libpthread.a',comment => 'install pthread' ], |
265 | | [ file => $mingw.'bin/pthreadGC2.dll', exec => "copy /Y ".$dossources."pthread/pthreadGC2.dll ".$dosmingw.'bin/pthreadGC2.dll' ], |
266 | | [ file => $mingw.'bin/pthread.dll', exec => "copy /Y ".$dossources."pthread/pthread.dll ".$dosmingw.'bin/pthread.dll' ], |
267 | | [ file => $mingw.'include/pthread.h', exec => "copy /Y ".$dossources."pthread/pthread.h ".$dosmingw.'include/pthread.h' ], |
268 | | [ file => $mingw.'include/sched.h', exec => "copy /Y ".$dossources."pthread/sched.h ".$dosmingw.'include/sched.h' ], |
269 | | [ file => $mingw.'include/semaphore.h', exec => "copy /Y ".$dossources."pthread/semaphore.h ".$dosmingw.'include/semaphore.h' ], |
270 | | |
271 | | |
272 | | ## download the MS directX SDK |
273 | | ## believe it or not, the above exe(dxsdk_november2007.exe) is actually just a zip archive(containing dxsdk_nov2007.exe) with |
274 | | ## a "read the licence and click OK to unzip", so we just unzip it with a few magic incantations of command lines: |
275 | | ## and the contents (dxsdk_nov2007.exe) is actually just a zip file too, so we unzip it (again) in a subfolder. finally, the files! |
276 | | #[ archive => $sources.'dxsdk_november2007.exe','fetch' => 'http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=4b78a58a-e672-4b83-a28e-72b5e93bd60a&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fb%2fe%2f7%2fbe7ffe34-903c-410b-bdbc-ee6c018df45c%2fdxsdk_november2007.exe' ], |
277 | | #[ dir => $sources."dxsdk/", mkdirs => $sources.'dxsdk' ], |
278 | | ## command to extract this .zip file to a folder (this outer wrapper is NOT unzip.exe compatible!): |
279 | | #[ file => $sources."dxsdk/dxsdk_nov2007.exe", exec => $dossources."dxsdk_november2007.exe /C /Q /T:".$dossources."dxsdk" ], |
280 | | ## extract this - it's a "winzip self extracter" - which IS "unzip.exe compatible" |
281 | | #[ file => $sources."dxsdk/Include/dsound.h", exec => "cd ".$dossources."dxsdk/ && ".$dossources."unzip/unzip.exe dxsdk_nov2007.exe" ], |
282 | | ## relocate the dxsdk header files to the folder : |
283 | | ## put ddraw.h dinput.h dsound.h into C:\MinGW\Include |
284 | | #[ file => $mingw.'include/dsound.h', exec => "copy /Y ".$dossources."dxsdk/Include/dsound.h $dosmingw/include/dsound.h" ], |
285 | | #[ file => $mingw.'include/dinput.h', exec => "copy /Y ".$dossources."dxsdk/Include/dinput.h $dosmingw/include/dinput.h" ], |
286 | | #[ file => $mingw.'include/ddraw.h', exec => "copy /Y ".$dossources."dxsdk/Include/ddraw.h $dosmingw/include/ddraw.h" ], |
287 | | ## not sure if we need this too, but it doesn't hurt: |
288 | | #[ file => $mingw.'include/dsetup.h', exec => "copy /Y ".$dossources."dxsdk/Include/dsetup.h $dosmingw/include/dsetup.h" ], |
| 266 | [ filesame => [$mingw.'lib/libpthread.a', $sources."pthread/libpthread.a"], copy => [''=>'',comment => 'install pthread'] ], |
| 267 | [ filesame => [$mingw.'bin/pthreadGC2.dll', $sources."pthread/pthreadGC2.dll"], copy => [''=>''] ], |
| 268 | [ filesame => [$mingw.'bin/pthread.dll', $sources."pthread/pthread.dll"], copy => [''=>''] ], |
| 269 | [ filesame => [$mingw.'include/pthread.h', $sources."pthread/pthread.h"], copy => [''=>''] ], |
| 270 | [ filesame => [$mingw.'include/sched.h', $sources."pthread/sched.h"], copy => [''=>''] ], |
| 271 | [ filesame => [$mingw.'include/semaphore.h',$sources."pthread/semaphore.h"], copy => [''=>''] ], |
| 272 | |
293 | | [ file => $mingw.'include/dsound.h', exec => "copy /Y ".$dossources."DX9SDK_dsound_Include_subset/dsound.h ".$dosmingw."include/dsound.h" ], |
294 | | [ file => $mingw.'include/dinput.h', exec => "copy /Y ".$dossources."DX9SDK_dsound_Include_subset/dinput.h ".$dosmingw."include/dinput.h" ], |
295 | | [ file => $mingw.'include/ddraw.h', exec => "copy /Y ".$dossources."DX9SDK_dsound_Include_subset/ddraw.h ".$dosmingw."include/ddraw.h" ], |
296 | | [ file => $mingw.'include/dsetup.h', exec => "copy /Y ".$dossources."DX9SDK_dsound_Include_subset/dsetup.h ".$dosmingw."include/dsetup.h" ], |
297 | | |
| 277 | [ filesame => [$mingw.'include/dsound.h',$sources."DX9SDK_dsound_Include_subset/dsound.h"], copy => [''=>''] ], |
| 278 | [ filesame => [$mingw.'include/dinput.h',$sources."DX9SDK_dsound_Include_subset/dinput.h"], copy => [''=>''] ], |
| 279 | [ filesame => [$mingw.'include/ddraw.h', $sources."DX9SDK_dsound_Include_subset/ddraw.h"], copy => [''=>''] ], |
| 280 | [ filesame => [$mingw.'include/dsetup.h',$sources."DX9SDK_dsound_Include_subset/dsetup.h"], copy => [''=>''] ], |
310 | | [ file => $sources.'freetype-2.3.5/Makefile_', shell => ["cd $unixsources/freetype-2.3.5","./configure --prefix=/mingw","make","make install","touch $unixsources/freetype-2.3.5/Makefile_"] ], |
| 293 | [ file => $sources.'freetype-2.3.5/Makefile_', shell => ["cd $unixsources/freetype-2.3.5","./configure --prefix=/mingw","touch $unixsources/freetype-2.3.5/Makefile_"] ], |
| 294 | # here's an example of specifying the make and make install steps separately, for apps that can't be relied on to have the make step work! |
| 295 | [ file => $sources.'freetype-2.3.5/objs/.libs/libfreetype.a', shell => ["cd $unixsources/freetype-2.3.5","make"] ], |
| 296 | [ file => $mingw.'lib/libfreetype.a', shell => ["cd $unixsources/freetype-2.3.5","make install"] ], |
411 | | rem rename '.$dosmsys.'bin\sh.exe sh_.exe |
412 | | configure.bat -thread -plugin-sql-mysql -opengl -no-sql-sqlite |
413 | | mingw32-make |
414 | | mingw32-make install |
415 | | rem rename '.$dosmsys.'bin\sh_.exe sh.exe |
416 | | ']], |
| 395 | ' |
| 396 | ],comment=>'write a batch script for the QT environment under DOS'], |
| 397 | |
| 398 | |
| 399 | [ file => $msys.'qt-3.3.x-p8/lib/libqt-mt3.dll', exec => $dosmsys.'qt-3.3.x-p8\qt_env.bat && configure.bat -thread -plugin-sql-mysql -opengl -no-sql-sqlite',comment => 'Execute qt_env.bat && the configure command to actually build QT now! - ie configures qt and also makes it, hopefully! WARNING SLOW (MAY TAKE HOURS!)' ], |
| 400 | |
| 401 | [ filesame => [$msys.'qt-3.3.x-p8/bin/libqt-mt3.dll',$msys.'qt-3.3.x-p8/lib/libqt-mt3.dll'], copy => [''=>''], 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!' ], |
| 402 | |
| 403 | # did the configure finish? - run mingw32-make to get it to finish properly. |
| 404 | # 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 |
| 405 | [ file => $msys.'qt-3.3.x-p8/examples/xml/tagreader-with-features/tagreader-with-features.exe', exec => $dosmsys.'qt-3.3.x-p8\qt_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!)' ], |
| 407 | # TODO - do we have an action we can take to build just this one file/dll if it fails? |
| 408 | # For now, we will just test if it built, and abort if it didn't! |
| 409 | [ file => $msys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll', exec => '', comment => 'lib\libqsqlmysql.dll - here we are just validating some basics of the the QT install, and if any of these components are missing, the build must have failed ( is the sql driver built properly?) '], |
| 410 | [ file => $msys.'qt-3.3.x-p8/bin/qmake.exe', exec => '', comment => 'bin\qmake.exe - here we are just validating some basics of the the QT install, and if any of these components are missing, the build must have failed'], |
| 411 | [ file => $msys.'qt-3.3.x-p8/bin/moc.exe', exec => '', comment => 'bin\moc.exe - here we are just validating some basics of the the QT install, and if any of these components are missing, the build must have failed'], |
| 412 | [ file => $msys.'qt-3.3.x-p8/bin/uic.exe', exec => '', comment => 'bin\uic.exe - here we are just validating some basics of the the QT install, and if any of these components are missing, the build must have failed'], |
457 | | # |
458 | | [ file => $mythtv.'make_run.sh', write => [$mythtv.'make_run.sh', |
459 | | '#!/bin/bash |
460 | | source '.$unixmythtv.'qt_env.sh |
461 | | cd '.$unixmythtv.'/mythtv |
462 | | # keep around just one earlier verion in run_old: |
463 | | rm -rf run_old |
464 | | mv run run_old |
465 | | mkdir run |
466 | | # copy exes and dlls to the run folder: |
467 | | find . -name \\*.exe | xargs -n1 -i__ cp __ ./run/ |
468 | | find . -name \\*.dll | xargs -n1 -i__ cp __ ./run/ |
469 | | # mythtv expects the dll to NOT have the 3 in it. |
470 | | cp '.$unixmsys.'qt-3.3.x-p8/lib/libqt-mt3.dll '.$unixmsys.'qt-3.3.x-p8/lib/libqt-mt.dll |
471 | | # mythtv needs the qt dlls at runtime: |
472 | | cp '.$unixmsys.'qt-3.3.x-p8/lib/*.dll '.$unixmythtv.'mythtv/run |
473 | | # qt mysql connection dll has to exist in a subfolder called sqldrivers: |
474 | | mkdir '.$unixmythtv.'mythtv/run/sqldrivers |
475 | | cp '.$unixmsys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll '.$unixmythtv.'mythtv/run/sqldrivers |
476 | | # pthread dlls and mingwm10.dll are copied from here: |
477 | | cp '.$unixmingw.'bin/*.dll '.$unixmythtv.'mythtv/run |
478 | | ' ],comment => 'script that will copy all the files necessary for running mythtv out of the build folder into the ./run folder'], |
479 | | |
480 | | # |
481 | | [ file => $mythtv.'build_myth.sh', write => [$mythtv.'build_myth.sh', |
482 | | '#!/bin/bash |
483 | | source '.$unixmythtv.'qt_env.sh |
484 | | cd '.$unixmythtv.'mythtv |
485 | | make clean |
486 | | make distclean |
487 | | touch '.$unixmythtv.'mythtv/config/config.pro |
488 | | ./configure --prefix=/usr --disable-dbox2 --disable-hdhomerun --disable-dvb --disable-ivtv --disable-iptv --disable-joystick-menu --disable-xvmc-vld --disable-x11 --disable-xvmc --enable-directx --enable-memalign-hack --cpu=k8 --compile-type=debug && make && make install |
489 | | #make |
490 | | #make install |
491 | | #cd .. |
492 | | ' ],comment => 'write a script to build main mythtv'], |
| 455 | ## |
| 456 | #[ file => $mythtv.'make_run.sh', write => [$mythtv.'make_run.sh', |
| 457 | #'#!/bin/bash |
| 458 | #source '.$unixmythtv.'qt_env.sh |
| 459 | #cd '.$unixmythtv.'/mythtv |
| 460 | ## keep around just one earlier verion in run_old: |
| 461 | #rm -rf run_old |
| 462 | #mv run run_old |
| 463 | #mkdir run |
| 464 | ## copy exes and dlls to the run folder: |
| 465 | #find . -name \\*.exe | grep -v run | xargs -n1 -i__ cp __ ./run/ |
| 466 | #find . -name \\*.dll | grep -v run | xargs -n1 -i__ cp __ ./run/ |
| 467 | ## mythtv needs the qt dlls at runtime: |
| 468 | #cp '.$unixmsys.'qt-3.3.x-p8/lib/*.dll '.$unixmythtv.'mythtv/run |
| 469 | ## qt mysql connection dll has to exist in a subfolder called sqldrivers: |
| 470 | #mkdir '.$unixmythtv.'mythtv/run/sqldrivers |
| 471 | #cp '.$unixmsys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll '.$unixmythtv.'mythtv/run/sqldrivers |
| 472 | ## pthread dlls and mingwm10.dll are copied from here: |
| 473 | #cp /mingw/bin/*.dll '.$unixmythtv.'mythtv/run |
| 474 | #' ],comment => 'script that will copy all the files necessary for running mythtv out of the build folder into the ./run folder'], |
522 | | |
523 | | #4390 - stuff |
524 | | #[ archive => $sources.'videoout_embedding.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4390/videoout_embedding.patch'], |
525 | | #[ file => $mythtv.'mythtv/videoout_embedding.patch', exec => "copy /Y $sources/videoout_embedding.patch $mythtv/mythtv/" ], |
526 | | #[ file => $mythtv.'mythtv/videoout_embedding.patch_', shell => ["cd /c/mythtv/mythtv/","patch -p0 < videoout_embedding.patch","touch videoout_embedding.patch_"] ], |
527 | | |
528 | | # in SVN at 7th Jan 2008 |
529 | | #[ archive => $sources.'setup.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4391/setup.patch'], |
530 | | #[ file => $mythtv.'mythtv/setup.patch', exec => "copy /Y ".$dossources."setup.patch ".$dosmythtv."mythtv",comment => '4391: - configgroups patch' ], |
531 | | #[ grep => ['children\[i\] \&\& children\[i\]->isVisible\(\)',$mythtv.'mythtv/libs/libmyth/mythconfiggroups.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < setup.patch"] ], |
532 | | |
533 | | ## |
534 | | |
535 | | # in SVN at 7th Jan 2008 |
536 | | #[ archive => $sources.'mythwelcome.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4409/mythwelcome.patch'], |
537 | | #[ file => $mythtv.'mythtv/mythwelcome.patch', exec => "copy /Y ".$dossources."mythwelcome.patch ".$dosmythtv."mythtv",comment => '4409 mythwelcome patch: (MinGW SIGHUP undefined)' ], |
538 | | #[ grep => ['\#include \"libmyth\/compat\.h\"',$mythtv.'mythtv/programs/mythwelcome/main.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < mythwelcome.patch"] ], |
539 | | |
540 | | # no longer required as at [15335] - 7th jan 2008 |
541 | | #[ archive => $sources.'themereload_win32.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4411/themereload_win32.patch'], |
542 | | #[ file => $mythtv.'mythtv/themereload_win32.patch', exec => "copy /Y ".$dossources."themereload_win32.patch ".$dosmythtv."mythtv",comment => '4411 changeset 15290 is incompatible with Win32' ], |
543 | | #[ grep => ['\#ifndef _WIN32',$mythtv.'mythtv/programs/mythfrontend/main.cpp'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < themereload_win32.patch"] ], |
544 | | |
545 | | # in SVN at 7th Jan 2008 |
546 | | #[ archive => $sources.'dlerr.win.patch' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4422/dlerr.win.patch'], |
547 | | #[ file => $mythtv.'mythtv/dlerr.win.patch', exec => "copy /Y ".$dossources."dlerr.win.patch ".$dosmythtv."mythtv",comment => '4422 fixes error: "call of overloaded QString(DWORD) is ambiguous" ' ], |
548 | | #[ grep => ['inline const char \*dlerror(void)',$mythtv.'mythtv/libs/libmyth/compat.h'], shell => ["cd ".$unixmythtv."mythtv/","patch -p0 < dlerr.win.patch"] ], |
549 | | |
550 | | |
551 | | [ archive => $sources.'backend.patch.gz' , 'fetch' => 'http://svn.mythtv.org/trac/raw-attachment/ticket/4392/backend.patch.gz'], |
552 | | [ file => $mythtv.'mythtv/backend.patch.gz', exec => "copy /Y ".$dossources."backend.patch.gz ".$dosmythtv."mythtv",comment => '4392: - backend connections being accepted patch ' ], |
| 504 | [ 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 upwith HEAD/SVN'], |
| 505 | [ filesame => [$mythtv.'mythtv/backend.patch.gz',$sources."backend.patch.gz"], copy => [''=>'',comment => '4392: - backend connections being accepted patch '] ], |
| 517 | # the old way: |
| 518 | #[ file => $mythtv.'no_rebuild_mythtv.txt', shell => ["cd ".$unixmythtv,'./build_myth.sh','touch no_rebuild_mythtv.txt'],comment => 'execute the mythtv build script (we wrote it earlier), unless its already been built once before ( ie the no_rebuild_mythtv.txt file exists! )' ], |
| 519 | |
| 520 | # the new way, with a bit better dependancy resolution: |
| 521 | # total cleanup: |
| 522 | #[ file => $mythtv.'mythtv/Makefile', shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make distclean','nocheck'], comment => 'do a "make clean" first? not strictly necessary, and the build will be MUCH faster without it, but it is safer with it...'], |
| 523 | # minor cleanup (keep the configuration) |
| 524 | #[ file => $mythtv.'mythtv/Makefile', shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make clean','make distclean','nocheck'], comment => 'do a "make clean" first? not strictly necessary, and the build will be MUCH faster without it, but it is safer with it...'], |
| 525 | # config |
| 526 | [ file => $mythtv.'mythtv/Makefile', shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','./configure --prefix=/usr --disable-dbox2 --disable-hdhomerun --disable-dvb --disable-ivtv --disable-iptv --disable-joystick-menu --disable-xvmc-vld --disable-x11 --disable-xvmc --enable-directx --enable-memalign-hack --cpu=k8 --compile-type=debug'], comment => 'do we already have a Makefile for mythtv?' ], |
| 527 | # make |
| 528 | [ newer => [$mythtv.'mythtv/libs/libmyth/libmyth-0.20.dll',$mythtv.'mythtv/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'libs/libmyth/libmyth-0.20.dll - redo make unless all these files exist, and are newer than the Makefile' ], |
| 529 | [ newer => [$mythtv.'mythtv/libs/libmythtv/libmythtv-0.20.dll',$mythtv.'mythtv/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'libs/libmythtv/libmythtv-0.20.dll - redo make unless all these files exist, and are newer than the Makefile' ], |
| 530 | [ newer => [$mythtv.'mythtv/programs/mythfrontend/mythfrontend.exe',$mythtv.'mythtv/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'programs/mythfrontend/mythfrontend.exe - redo make unless all these files exist, and are newer than the Makefile' ], |
| 531 | [ newer => [$mythtv.'mythtv/programs/mythbackend/mythbackend.exe',$mythtv.'mythtv/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'programs/mythbackend/mythbackend.exe - redo make unless all these files exist, and are newer than the Makefile' ], |
| 532 | |
| 533 | # re-install to msys /usr/bin folders etc, if we have a newer mythtv build ready: |
| 534 | [ newer => [$msys.'bin/mythfrontend.exe',$mythtv.'mythtv/programs/mythfrontend/mythfrontend.exe'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make install'], comment => 'was the last configure successful? then install mythtv ' ], |
| 535 | |
| 536 | # install some themes? does a 'make install' do that adequately (no, not if running outside msys)? |
| 537 | |
| 538 | |
562 | | [ file => $mythtv.'no_rebuild_mythtv.txt', shell => ["cd ".$unixmythtv,'./build_myth.sh','touch no_rebuild_mythtv.txt'],comment => 'execute the mythtv build script (we wrote it earlier), unless its already been built once before ( ie the no_rebuild_mythtv.txt file exists! )' ], |
| 540 | [ file => $mythtv.'make_run.sh', write => [$mythtv.'make_run.sh', |
| 541 | '#!/bin/bash |
| 542 | source '.$unixmythtv.'qt_env.sh |
| 543 | cd '.$unixmythtv.'mythtv |
| 544 | # keep around just one earlier verion in run_old: |
| 545 | rm -rf run_old |
| 546 | mv run run_old |
| 547 | mkdir run |
| 548 | # copy exes and dlls to the run folder: |
| 549 | find . -name \\*.exe | grep -v run | xargs -n1 -i__ cp __ ./run/ |
| 550 | find . -name \\*.dll | grep -v run | xargs -n1 -i__ cp __ ./run/ |
| 551 | # mythtv needs the qt dlls at runtime: |
| 552 | cp '.$unixmsys.'qt-3.3.x-p8/lib/*.dll '.$unixmythtv.'mythtv/run |
| 553 | # qt mysql connection dll has to exist in a subfolder called sqldrivers: |
| 554 | mkdir '.$unixmythtv.'mythtv/run/sqldrivers |
| 555 | cp '.$unixmsys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll '.$unixmythtv.'mythtv/run/sqldrivers |
| 556 | # pthread dlls and mingwm10.dll are copied from here: |
| 557 | cp /mingw/bin/*.dll '.$unixmythtv.'mythtv/run |
| 558 | ' |
| 559 | ],comment => 'write a script that will copy all the files necessary for running mythtv out of the build folder into the ./run folder'], |
655 | | |
| 658 | } elsif ( $causetype eq 'filesame' ) { |
| 659 | # TODO - currently we check file mtime, and byte size, but not MD5/CRC32 or contents, this is "good enough" for most circumstances. |
| 660 | my ( $size,$mtime)=(0,0); |
| 661 | if ( -f $cause[0] ) { |
| 662 | $size = (stat($cause[0]))[7]; |
| 663 | $mtime = (stat($cause[0]))[9]; |
| 664 | } |
| 665 | if (! (-f $cause[1] ) ) { die "cause: $causetype requires its SECOND filename to exist for comparison: $cause[1] \n"; } |
| 666 | my $size2 = (stat($cause[1]))[7]; |
| 667 | my $mtime2 = (stat($cause[1]))[9]; |
| 668 | if ( $mtime != $mtime2 || $size != $size2) { |
| 669 | if ( ! $nocheckeffectparams[0] ) { |
| 670 | die "sorry but you can not leave the arguments list empty for anything except the 'copy' action (and only when used with the 'filesame' cause)" unless $effecttype eq 'copy'; |
| 671 | print "no parameters defined, so applying effect($effecttype) as ( 2nd src parameter => 1st src parameter)!\n"; |
| 672 | effect($effecttype,$cause[1],$cause[0]); #copy the requested file[1] to the requested destn[0], now the [0] file exists and is the same. |
| 673 | } else { |
| 674 | effect($effecttype,@nocheckeffectparams); # do something else if the files are not 100% identical? |
| 675 | } |
| 676 | }else { |
| 677 | print "effect not requiredm files already up-to-date/identical: ($cause[0] => $cause[1]) \n"; |
| 678 | } |
| 679 | undef $size; undef $mtime; |
| 680 | undef $size2; undef $mtime2; |
| 681 | |
| 682 | } elsif ( $causetype eq 'newer' ) { |
| 683 | my $mtime = 0; |
| 684 | if ( -f $cause[0] ) { |
| 685 | $mtime = (stat($cause[0]))[9]; |
| 686 | } |
| 687 | if (! ( -f $cause[1]) ) { die "cause: $causetype requires it's SECOND filename to exist for comparison: $cause[1]\n"; } |
| 688 | my $mtime2 = (stat($cause[1]))[9]; |
| 689 | if ( $mtime < $mtime2 ) { |
| 690 | effect($effecttype,@nocheckeffectparams); |
| 691 | if ( $nocheck == 0 ) { |
| 692 | # confirm it worked, mtimes should have changed now: |
| 693 | my $mtime3 = (stat($cause[0]))[9]; |
| 694 | my $mtime4 = (stat($cause[1]))[9]; |
| 695 | if ( $mtime3 < $mtime4 ) { |
| 696 | die "file -> EFFECT FAILED: $causetype,$cause[0],$cause[1],$effecttype\n"; |
| 697 | } |
| 698 | } |
| 699 | } else { |
| 700 | print "file ($cause[0]) has same or newer mtime than ($cause[1]) already, no action taken\n"; |
| 701 | } |
| 702 | undef $mtime; |
| 703 | undef $mtime2; |
| 704 | |
697 | | |
698 | | $cmd =~ s#/#\\#g; # convert all forward to SINGLE backward slashes |
699 | | # (TODO - might be overkill to do all slashes ?) |
700 | | |
701 | | # this next set of regex's is YUCK, but it actually works well, |
702 | | # if it breaks, we'll just add another special case like these: |
703 | | |
704 | | $cmd =~ s#\s\\Y\s# /Y #ig; # it is overkill, so undo specific case/s |
705 | | # (eg: the /Y flag to the copy command) |
706 | | $cmd =~ s#\s\\C\s# /C #ig; # the /C /Q and /T options |
707 | | # used to extract the dxsdk |
708 | | $cmd =~ s#\s\\Q\s# /Q #ig; |
709 | | $cmd =~ s#\s\\T# /T#ig; |
710 | | $cmd =~ s#http:\\\\#http://#ig; # dont backslash web addresses |
711 | | if ($cmd =~ m/http:/ ) { |
712 | | # next three lines will return any incorrectly backslashed |
713 | | # slashes in a URL like: http://blah\blah\blah |
714 | | # to http://blah/blah/blah as it should be: |
715 | | $cmd =~ s#^(.*)(http://.*$)#$2#i; |
716 | | my $pre = $1; |
717 | | $cmd =~ s#\\#/#g; |
718 | | print "pre:$pre\ncmd:$cmd\n"; |
719 | | $cmd = $pre.$cmd; |
720 | | } |
721 | | |