Ticket #10744: 0001-mythbuild.sh-sync-with-latest-version.patch

File 0001-mythbuild.sh-sync-with-latest-version.patch, 16.0 KB (added by Raymond Wagner, 9 years ago)

patch extracted from spam logs, triggered by links to external dependencies

  • Win32/mythbuild.sh

    From 9423dcb8494b5719ba93ce5806bcc220f48fc6e1 Mon Sep 17 00:00:00 2001
    From: Lawrence Rust <lvr@softsystem.co.uk>
    Date: Sun, 20 May 2012 20:43:41 +0200
    Subject: [PATCH] mythbuild.sh: sync with latest version
    
    Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
    ---
     Win32/mythbuild.sh |  190 ++++++++++++++++++++++++++++++++++++++--------------
     1 files changed, 139 insertions(+), 51 deletions(-)
     mode change 100644 => 100755 Win32/mythbuild.sh
    
    diff --git a/Win32/mythbuild.sh b/Win32/mythbuild.sh
    old mode 100644
    new mode 100755
    index 760e7e1..41b5c1c
    a b  
    99#   Click:
    1010#     Automated MinGW Installer > mingw-get-inst
    1111#   Then select a version e.g.
    12 #     mingw-get-inst-20101030 > mingw-get-inst-20101030.exe
    13 #     NB latest mingw-get-inst-20110211.exe doesn't work on Win2K & XP
     12#     mingw-get-inst-20111118 > mingw-get-inst-20111118.exe
     13#     NB mingw-get-inst-20110211.exe doesn't work on Win2K & XP
    1414#   Run the installer and ensure to add:
    1515#     C++
    1616#     MSYS basic system
     
    8282#   Host dependencies:
    8383#   Mac B/W G3: mythbuild.sh -c g3
    8484
    85 readonly version="0.6"
     85readonly version="0.7"
     86readonly myname="$0"
     87readonly myargs="$*"
    8688
    8789# Myth code repo
    8890: ${MYTHREPO:="http://mythtv-for-windows.googlecode.com/files"}
    readonly version="0.6" 
    9395: ${SOURCEFORGE:="downloads.sourceforge.net"}
    9496
    9597# The libraries to be installed:
     98: ${PKGCONFIG:="pkg-config_0.26-1_win32"}
     99: ${PKGCONFIG_URL:="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/$PKGCONFIG.zip"}
     100: ${GLIB:="glib_2.28.8-1_win32"}
     101: ${GLIB_URL:="http://ftp.gnome.org/pub/gnome/binaries/win32/glib/${GLIB:5:4}/$GLIB.zip"}
     102: ${GETTEXT:="gettext-runtime_0.18.1.1-2_win32"}
     103: ${GETTEXT_URL:="http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/$GETTEXT.zip"}
    96104: ${PTHREADS:="pthreads-w32-2-8-0-release"}
    97105: ${PTHREADS_URL:="ftp://sourceware.org/pub/pthreads-win32/$PTHREADS.tar.gz"}
    98106: ${ZLIB:="zlib-1.2.5"}
    readonly version="0.6" 
    126134: ${LIBDVDCSS_URL:="http://download.videolan.org/pub/libdvdcss/${LIBDVDCSS/libdvdcss-/}/$LIBDVDCSS.tar.bz2"}
    127135: ${LIBXML2:="libxml2-2.7.8"}
    128136: ${LIBXML2_URL:="ftp://xmlsoft.org/libxml2/$LIBXML2.tar.gz"}
    129 # 16-Dec-2010 latest: mysql-5.5.8
     137# 16-Sep-2011 latest: mysql-5.5.16
    130138: ${MYSQL:="mysql-5.1.58"}
    131139: ${MYSQL_URL:="http://mirrors.ircam.fr/pub/mysql/Downloads/MySQL-${MYSQL:6:3}/$MYSQL.tar.gz"}
    132140# Pre-built win32 install. NB mysql-5.1 requires winXP-SP2, 5.0 works on win2k
     141# 5.0.89 unavailable 11-feb-11
     142#: ${MYSQLW:="mysql-5.0.89-win32"}
     143# 5.1.55 unavailable 15-sep-11
     144#: ${MYSQLW:="mysql-5.1.55-win32"}
    133145: ${MYSQLW:="mysql-5.1.58-win32"}
    134146: ${MYSQLW_URL:="ftp://mirrors.ircam.fr/pub/mysql/Downloads/MySQL-${MYSQLW:6:3}/${MYSQLW/mysql-/mysql-noinstall-}.zip"}
    135147#: ${MYSQLW_URL:="ftp://ftp.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-${MYSQLW:6:3}/${MYSQLW/mysql-/mysql-noinstall-}.zip"}
    136148# Pre-built MacOSX install
    137 : ${MYSQLM:="mysql-5.1.58-osx10.4-i686"}
     149: ${MYSQLM:="mysql-5.1.58-osx10.6-x86"}
    138150: ${MYSQLM_URL:="ftp://mirrors.ircam.fr/pub/mysql/Downloads/MySQL-${MYSQLM:6:3}/$MYSQLM.tar.gz"}
    139151# Pre-built MacOSX powerpc
    140152: ${MYSQLX:="mysql-standard-4.1.22-apple-darwin7.9.0-powerpc"}
    141153: ${MYSQLX_URL:="ftp://mirrors.ircam.fr/pub/mysql/Downloads/MySQL-${MYSQLX:15:3}/$MYSQLX.tar.gz"}
     154#: ${QT:="qt-everywhere-opensource-src-4.7.4"} # Builds for host OK but win32 & mac need updated patches
    142155: ${QT:="qt-everywhere-opensource-src-4.7.0"}
    143156: ${QT_URL:="http://get.qt.nokia.com/qt/source/$QT.tar.gz"}
    144157# Configurable libraries
    fi 
    193206
    194207
    195208# Default parameters
    196 MYTHTARGET=
    197 MYTHBUILD=
    198 MYTHBRANCH=
     209unset MYTHTARGET
     210unset MYTHBUILD
     211unset MYTHBRANCH
    199212readtimeout=60
    200213logging="no"
    201 patches=
     214unset patches
    202215cleanbuild="no"
    203216reconfig="no"
    204217themes="no"
    205 cpu=
     218unset cpu
    206219if [ -n "$NUMBER_OF_PROCESSORS" ]; then
    207220    cpus=$NUMBER_OF_PROCESSORS
    208221elif [ -r "/proc/cpuinfo" ]; then
    else 
    212225fi
    213226[ $cpus -gt 1 ] && makejobs=`expr $cpus + 1` || makejobs=1
    214227verbose="no"
    215 dosudo=
    216 patchmaster="no"
     228unset dosudo
     229unset patchmaster
    217230: ${DXVA2:="no"}
    218231
    219232
    220233###############################################################
    221234# Parse the command line
    222235###############################################################
    223 readonly myname="$0"
    224 readonly myargs="$@"
    225236readonly currdir="$PWD"
    226237readonly logfile="mythbuild.log"
    227238
    228239# Get the current git branch
    229240# $1= path to .git
    230241function gitbranch() {
    231     [ -d "$1/.git" ] && git --git-dir="$1/.git" branch --no-color|grep "^\*"|cut -d ' ' -f 2
     242    [ -d "$1/.git" ] && git --git-dir="$1/.git" branch --no-color|grep "^\*"|cut -d ' ' -f 2 || true
    232243}
    233244
    234245function myhelp() {
    function myhelp() { 
    252263    echo "  -t <n>        Timeout after configure [$readtimeout Seconds]"
    253264    echo "  -v            Verbose build messages [$verbose]"
    254265    echo "  -C            Force a clean re-build"
    255     echo "  -F            Enable mythtv and mythplugins master patches [$patchmaster]"
     266    echo "  -F            Enable mythtv and mythplugins master patches [${patchmaster:-no}]"
    256267    echo "  -P            Apply all patches to mythtv and mythplugins then exit"
    257268    echo "  -R            Reverse all patches applied to mythtv & mythplugins then exit"
    258269    echo "  -S            Run make install/uninstall with sudo"
    do 
    305316        v) verbose="yes" ;;
    306317        l) logging="yes" ;;
    307318        C) cleanbuild="yes" ;;
    308         F) [ "$patchmaster" = "no" ] && patchmaster="yes" || patchmaster="no" ;;
     319        F) [ "$patchmaster" != "yes" ] && patchmaster="yes" || patchmaster="no" ;;
    309320        H) MYTHTARGET="Host" ;;
    310321        M) MYTHTARGET="MacOSX-i686" ;;
    311322        X) MYTHTARGET="MacOSX-PPC" ;;
    function download() { 
    353364    echo "*********************************************************************"
    354365    echo "wget $obj"
    355366    # Try the myth code repo first, if not use the full URL
    356     wget "$MYTHREPO/$obj" || wget $1
     367    if ! wget "$MYTHREPO/$obj" ; then
     368        wget $1
     369    fi
    357370}
    358371
    359372# FTP download. $1= URL
    function make_distclean() { 
    504517# make install
    505518function make_install() {
    506519    echo "make install..."
    507     $dosudo make -j1 -s install
     520    $dosudo $make -j1 install
    508521}
    509522
    510523# make uninstall
    branch=$MYTHBRANCH 
    655668[ -z "$branch" ] && branch=`gitbranch "$MYTHDIR/mythtv"`
    656669case "$branch" in
    657670    "") : ${MYTHVER:="master"} ;;
     671    master) : ${MYTHVER:="master"} ;;
    658672    fixes/*) : ${MYTHVER:=`branch2ver "$branch"`} ;;
    659673esac
    660674
    if [ "$MYTHTARGET" = "Windows" ] && ! which zip >/dev/null 2>&1 ; then 
    918932fi
    919933
    920934
     935# Need pkg-config
     936if ! pkg-config --version >/dev/null 2>&1 ; then
     937    if [ "$MSYSTEM" != "MINGW32" ]; then
     938        install_pkg pkg-config
     939    else
     940        name=$PKGCONFIG; url=$PKGCONFIG_URL; arc=`basename "$url"`
     941        [ ! -e "$arc" ] && download "$url"
     942        unzip -d "$name" "$arc"
     943        cp -p "$name/bin/pkg-config.exe" /usr/bin/
     944
     945        name=$GLIB; url=$GLIB_URL; arc=`basename "$url"`
     946        [ ! -e "$arc" ] && download "$url"
     947        unzip -d "$name" "$arc"
     948        cp -p "$name/bin/libglib-2.0-0.dll" /usr/bin/
     949
     950        name=$GETTEXT; url=$GETTEXT_URL; arc=`basename "$url"`
     951        [ ! -e "$arc" ] && download "$url"
     952        unzip -d "$name" "$arc"
     953        cp -p "$name/bin/intl.dll" /usr/bin/
     954    fi
     955fi
     956
     957
    921958# Need git to get myth sources
    922959if ! git --version >/dev/null 2>&1 ; then
    923960    if [ "$MSYSTEM" != "MINGW32" ]; then
    function patchmingw() { 
    10241061        EOF
    10251062}
    10261063
     1064function patchmingw32() {
     1065    local gccversion=$(gcc -dumpversion)
     1066    local path="/mingw/lib/gcc/mingw32/$gccversion/include"
     1067
     1068        $dosudo patch -p0 $@ <<-EOF
     1069                --- $path/float.h       2012-03-10 17:43:36 +0100
     1070                +++ $path/float.h       2012-03-10 17:25:34 +0100
     1071                @@ -28,6 +28,8 @@ see the files COPYING3 and COPYING.RUNTI
     1072                 #ifndef _FLOAT_H___
     1073                 #define _FLOAT_H___
     1074                 
     1075                +#include_next <float.h>
     1076                +
     1077                 /* Radix of exponent representation, b. */
     1078                 #undef FLT_RADIX
     1079                 #define FLT_RADIX      __FLT_RADIX__
     1080        EOF
     1081}
     1082
    10271083# Check if the mingw <float.h> patch for Qt is required
    10281084function check_float() {
    10291085    ${xprefix:+$xprefix-}gcc -c -x c++ - -o /dev/null >/dev/null 2>&1 <<-EOF
    if [ "$MYTHTARGET" = "Windows" ] && ! check_float ; then 
    10381094        case "$REPLY" in
    10391095            n|no|N) echo "NOTE: Qt may not build."; break ;;
    10401096            y|yes|Y|"")
    1041                 patchmingw "" -s --dry-run && patchmingw "sudo" || true
     1097                if [ "$MSYSTEM" == "MINGW32" ]; then
     1098                    patchmingw32 "" -s --dry-run && patchmingw32 || true
     1099                else
     1100                    patchmingw "" -s --dry-run && patchmingw "sudo" || true
     1101                fi
    10421102                if ! check_float ; then
    10431103                    echo ""
    10441104                    echo "WARNING: The patch failed. Qt may not build."
    fi 
    10541114###############################################################
    10551115# Start of build
    10561116###############################################################
    1057 # Set the pkg-config default directory
     1117# Set the pkg-config search path
    10581118export PKG_CONFIG_PATH="$libdir/pkgconfig"
    10591119mkdir -p "$PKG_CONFIG_PATH"
     1120# If cross-compiling set the pkg-config default search directory
     1121[ -n "$xprefix" ] && export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH"
    10601122
    10611123case "$arch" in
    10621124    ppc*)
    build LAME --disable-frontend 
    13331395#/usr/include/python2.7/pyconfig.h:1:27: fatal error: bits/wordsize.h: No such file or directoryIn file included from /usr/include/python2.7/Python.h:8:0,
    13341396
    13351397# Including path to zlib
     1398# --with-reader required by spumux (mytharhive util) link to xmlReaderForIO
    13361399CPPFLAGS="-I$incdir $CPPFLAGS" LDFLAGS="-L$libdir $LDFLAGS" \
    1337 build LIBXML2 --with-minimum --with-output
     1400build LIBXML2 --with-minimum --with-output --with-reader
    13381401#build LIBXML2 $( [ "$MSYSTEM" = "MINGW32" ] && echo "--without-threads") --without-python
    13391402
    13401403###############################################################################
    build LIBVORBIS 
    13901453# For MythMusic
    13911454FLAC_DEBUGFLAG="--enable-debug"
    13921455# --disable-cpplibs 'cos examples/cpp/encode/file/main.cpp doesn't #include <string.h> for memcmp
     1456# --disable-ogg 'cos otherwise need libogg in all config tests
    13931457# Need to set LD_LIBRARY_PATH so ld.so can find libogg when configure runs ogg test
    1394 LD_LIBRARY_PATH="$( [ "$MYTHTARGET" = "Host" ] && echo "${libdir}:" )$LD_LIBRARY_PATH" \
    1395 build FLAC --disable-cpplibs $( isAltivec || echo "--disable-altivec")
     1458#LD_LIBRARY_PATH="$( [ "$MYTHTARGET" = "Host" ] && echo "${libdir}:" )$LD_LIBRARY_PATH" \
     1459build FLAC --disable-cpplibs --disable-ogg $( isAltivec || echo "--disable-altivec")
    13961460
    13971461###############################################################################
    13981462# Install libcdio - http://www.gnu.org/software/libcdio/
    build LIBVISUAL --disable-threads 
    14361500# Install libdvdcss - http://www.videolan.org/developers/libdvdcss.html
    14371501# For MythVideo
    14381502# NB need LDFLAGS=-no-undefined to enable dll creation
    1439 LDFLAGS="-no-undefined $LDFLAGS" build LIBDVDCSS
     1503LDFLAGS="-Wl,-no-undefined $LDFLAGS" build LIBDVDCSS
    14401504
    14411505###############################################################################
    14421506# Install MySQL - http://mysql.com/
    if [ ! -e "$stampconfig.$debug" -o -n "${!compcfg}" -o ! -e Makefile ]; then 
    18011865                # Add -no-iconv else build fails on Mandriva with mingw iconv installed
    18021866                args="$args -no-iconv"
    18031867            ;;
    1804             MacOSX-i686) args="$args -arch x86 -little-endian" ;;
    1805             MacOSX-PPC) args="$args -arch powerpc -big-endian" ;;
    18061868            MacOSX*)
     1869                case "$MYTHTARGET" in
     1870                    MacOSX-i686) args="$args -arch x86 -little-endian" ;;
     1871                    MacOSX-PPC) args="$args -arch powerpc -big-endian" ;;
     1872                esac
     1873
    18071874                args="$args -no-framework"
    18081875
    18091876                # Dwarf2 symbols cause memory exhaustion in debug build
    banner "Building $name branch $branch ($MYTHBUILD)" 
    19061973
    19071974# Apply patches
    19081975case "$MYTHVER" in
     1976    0.[0-9]|0.[1-9]*|[1-9].*|[1-9][0-9].*)
     1977        [ "$patchmaster" != "no" ] &&  { dopatches "$name-$MYTHVER" || rm -f $stampconfig* ; }
     1978        ;;
    19091979    master)
    19101980        [ "$patchmaster" = "yes" ] && { dopatches "$name-$MYTHVER" || rm -f $stampconfig* ; }
    19111981        ;;
    1912     [0-9].[1-9]*)
    1913         dopatches "$name-$MYTHVER" || rm -f $stampconfig*
     1982    *)
    19141983        ;;
    1915     *) ;;
    19161984esac
    19171985
    19181986pushd "$name" >/dev/null
    if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHTV_CFG" \ 
    19352003        --disable-avdevice --disable-avfilter \
    19362004        --enable-libfftw3 --disable-joystick-menu"
    19372005    case "$MYTHVER" in
    1938         0.23*|0.24*) args="$args --disable-directfb" ;;
     2006        0.23*) args="$args --disable-directfb" ;;
     2007        0.24*) args="$args --disable-directfb --enable-vaapi" ;;
     2008        ""|0.25*|master) args="$args --enable-vaapi" ;;
    19392009    esac
    19402010    rprefix=".."
    19412011    case "$MYTHTARGET" in
    1942         [Hh]ost) targetos= ;;
     2012        [Hh]ost)
     2013            targetos=""
     2014            # Enable x264 for mythffmpeg transcoding
     2015            args="$args --enable-libx264 --enable-libmp3lame"
     2016        ;;
    19432017        [Ww]indows)
    19442018            targetos="mingw32"
    19452019            rprefix="."
    if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHTV_CFG" \ 
    19492023            args="$args --disable-lirc --disable-hdhomerun"
    19502024
    19512025            # DXVA2
    1952             [ "$DXVA2" == "yes" ] && args="$args --enable-dxva2"
     2026            [ "$DXVA2" = "no" ] || args="$args --enable-dxva2"
    19532027
    19542028            # Disable symbol-visibility or build problems on 0.24 & 0.23
    19552029            # Also disabled on master to quieten warnings which otherwise hide real probs
    19562030            args="$args --disable-symbol-visibility"
    19572031        ;;
    1958         # BUG the ppc x-compiler defines __vector but the SDK expects vector
    1959         # in CarbonCore/MachineExceptions.h so disable altivec
    1960         MacOSX-PPC) : ${cpu:=g3} ;;
    1961         MacOSX*) targetos="darwin" ;;
     2032        MacOSX*)
     2033            targetos="darwin"
     2034
     2035            # BUG the ppc x-compiler defines __vector but the SDK expects vector
     2036            # in CarbonCore/MachineExceptions.h so disable altivec
     2037            [ "$MYTHTARGET" == "MacOSX-PPC" ] && : ${cpu:=g3}
     2038        ;;
    19622039        *) die "Unknown target: $MYTHTARGET" ;;
    19632040    esac
    19642041
    if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHTV_CFG" \ 
    19862063    # This allows warning messages to be more easily seen
    19872064    precis="$bindir/makelessnoise"
    19882065    cat >> config.mak <<-EOF
    1989                 QMAKE_CC=@$precis CC \$(abspath \$<) \$\$QMAKE_CC
    1990                 QMAKE_CXX=@$precis CXX \$(abspath \$<) \$\$QMAKE_CXX
    1991                 QMAKE_LINK=@$precis LINK \$@ \$\$QMAKE_LINK
    1992                 QMAKE_AR=@$precis AR \$@ \$\$QMAKE_AR
    1993                 QMAKE_MOC=@$precis MOC \$(abspath \$<) \$\$QMAKE_MOC
     2066                 QMAKE_CC=@$precis CC \$(abspath \$<) \$\$QMAKE_CC
     2067                 QMAKE_CXX=@$precis CXX \$(abspath \$<) \$\$QMAKE_CXX
     2068                 QMAKE_LINK=@$precis LINK \$@ \$\$QMAKE_LINK
     2069                 QMAKE_AR=@$precis AR \$@ \$\$QMAKE_AR
     2070                 QMAKE_MOC=@$precis MOC \$(abspath \$<) \$\$QMAKE_MOC
    19942071        EOF
    19952072    cat > "$precis" <<-EOF && chmod +x "$precis"
    19962073                #!/bin/sh
    if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHPLUGINS_CFG" \ 
    20532130    rm -f $stampconfig*
    20542131    [ -e Makefile ] && { make_uninstall; make_distclean; } || true
    20552132
    2056     plugins="--enable-all --enable-libvisual --enable-fftw"
     2133    plugins="--enable-all --enable-fftw"
     2134    case "$MYTHVER" in
     2135        0.23*|0.24*) plugins="$plugins --enable-libvisual" ;;
     2136        ""|0.25*|master) ;;
     2137    esac
    20572138
    20582139    if ! isdebug QT ; then
    20592140        # These plugins require a debug build of Qt in .pro file
    if [ ! -e "$stampconfig${MYTHBUILD:+.$MYTHBUILD}" -o -n "$MYTHPLUGINS_CFG" \ 
    20652146        esac
    20662147    fi
    20672148
    2068     args="--prefix=$MYTHINSTALL --qmake=$MYTHWORK/$QT/bin/qmake --sysroot=$MYTHINSTALL --compile-type=$MYTHBUILD"
     2149    args="--prefix=$MYTHINSTALL --qmake=$MYTHWORK/$QT/bin/qmake --compile-type=$MYTHBUILD"
     2150    [ -n "$xprefix" ] && args="$args --cross-prefix=${xprefix}- --sysroot=$MYTHINSTALL"
    20692151    case "$MYTHTARGET" in
    20702152    [Ww]indows)
    2071         [ -n "$xprefix" ] && args="$args --cross-prefix=${xprefix}- --targetos=MINGW32"
     2153        [ -n "$xprefix" ] && args="$args --targetos=MINGW32"
    20722154        plugins="$plugins --d