Adium

Changeset 24354

Show
Ignore:
Timestamp:
07/15/2008 08:34:17 AM (5 months ago)
Author:
evands
Message:

Awesome updates to the builds scripts from Ryan Govostes, with the following changes:
=== copy_frameworks.sh ===

  • silenced the pushd / popd calls
  • now echos out the next step

=== README ===

  • changed some of the bash command lists to not go wild if something fails
  • added section on how to move the Pidgin source tree
  • clarified when you need to update PO files
  • updated libpurple build phase instructions

=== make_po_files.sh ===

  • now echos out the next step

=== purple_make.sh ===

  • adds --msn and --msn-pecan switches; default is --msn-pecan
  • adds --ppc and --i386 switches to limit the build to a single arch
  • supersedes purple_make_without_msn-pecan.sh
  • now performs incremental builds :) see note
  • adds --regenerate switch to force autoconf and automake
  • prints out reverts the same as it does for patches

Closes #10473

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Utilities/dep-build-scripts/copy_frameworks.sh

    r24050 r24354  
    44cp -r "`dirname $0`"/build/Frameworks/*.framework "$ADIUM/Frameworks/" 
    55 
    6 pushd "$ADIUM/build" 
     6pushd "$ADIUM/build" > /dev/null 2>&1 
    77        rm -rf */AdiumLibpurple.framework  
    88        rm -rf */*/Adium.app/Contents/Frameworks/lib* 
    9 popd 
     9popd > /dev/null 2>&1 
     10 
     11echo "Done - now build Adium" 
  • trunk/Utilities/dep-build-scripts/make_po_files.sh

    r23823 r24354  
    2828popd 
    2929 
     30echo "Done - now run ./copy_frameworks.sh" 
  • trunk/Utilities/dep-build-scripts/purple_make.sh

    r24243 r24354  
    55cd "$BUILDDIR" 
    66 
    7 # Note that msn-pecan needs the --enable-msnp14 flag 
    8 MSN=msn_pecan 
    9  
    10 DEBUG_SYMBOLS=TRUE 
    11 PROTOCOLS="bonjour gg irc jabber $MSN myspace novell oscar qq sametime simple yahoo zephyr" 
    12  
    13 if [ "x$PIDGIN_SOURCE" == "x" ] ; then 
     7if [ "x$PIDGIN_SOURCE" = "x" ] ; then 
    148        echo 'Error: you need to set PIDGIN_SOURCE to be the location of' \ 
    159        'your pidgin source tree.' 
     
    1913echo "Using Pidgin source from: $PIDGIN_SOURCE" 
    2014 
    21 # Apply our openssl patch - enables using OpenSSL and allows libgadu with SSL 
    22 # support. This is OK because OpenSSL is part of the base system on OS X. 
     15# Read in our parameters 
     16MSN=msn_pecan 
     17USER_REGENERATE=FALSE 
     18ARCHES=(ppc i386) 
     19while [ $# -gt 0 ] ; do 
     20        case $1 in 
     21                --regenerate) 
     22                        USER_REGENERATE=TRUE 
     23                        shift 1  
     24                        ;; 
     25                --msn-pecan) 
     26                        # Note that msn-pecan needs the --enable-msnp14 flag 
     27                        MSN=msn_pecan 
     28                        shift 1 
     29                        ;; 
     30                --msn) 
     31                        MSN=msn 
     32                        shift 1 
     33                        ;; 
     34                --ppc) 
     35                        ARCHES=(ppc) 
     36                        shift 1 
     37                        ;; 
     38                --i386) 
     39                        ARCHES=(i386) 
     40                        shift 1 
     41                        ;; 
     42                *) 
     43                        echo "Invalid argument: $1" 
     44                        shift 1 
     45                        ;; 
     46        esac 
     47done 
     48 
     49DEBUG_SYMBOLS=TRUE 
     50PROTOCOLS="bonjour gg irc jabber $MSN myspace novell oscar qq sametime simple yahoo zephyr" 
    2351 
    2452pushd $PIDGIN_SOURCE > /dev/null 2>&1 
     
    5583                                        "$PATCHDIR/libpurple_xmlnode_parser_error_handler.diff" \ 
    5684                                        "$PATCHDIR/libpurple_zephyr_fix_krb4_flags.diff" \ 
    57                                         "$PATCHDIR/libpurple_static_for_msn_pecan.diff" \ 
    5885                                        "$PATCHDIR/libpurple_jabber_use_builtin_digestmd5.diff" \ 
    5986                                        "$PATCHDIR/libpurple_jabber_fallback_to_auth_old_after_gssapi_only_fails.diff" \ 
    6087                                        "$PATCHDIR/libpurple_jabber_roster_debug.diff") 
     88 
     89## 
     90# msn-pecan specific patches 
     91## 
     92if [ x"$MSN" = x"msn_pecan" ] ; then 
     93        LIBPURPLE_PATCHES=( \ 
     94                        ${LIBPURPLE_PATCHES[@]} \ 
     95                        "$PATCHDIR/libpurple_static_for_msn_pecan.diff" \ 
     96                ) 
     97fi 
    6198 
    6299for patch in ${LIBPURPLE_PATCHES[@]} ; do 
     
    66103popd > /dev/null 2>&1 
    67104 
    68 for ARCH in ppc i386 ; do 
     105### 
     106# These files are overwritten during each build, which prevents us from 
     107# performing incremental builds. 
     108
     109# This list was generated by a DTrace script that watched files being written 
     110# to during a build of each architecture. I then narrowed the list to only the 
     111# files that were written during BOTH builds. 
     112
     113# It should be confirmed that these files all need to be copied. 
     114
     115# -- Ryan Govostes, July 15 '08 
     116## 
     117AUTOGEN_GREMLINS=("autom4te.cache" \ 
     118                                "config.guess" \ 
     119                                "config.sub" \ 
     120                                "configure" \ 
     121                                "intltool-extract.in" \ 
     122                                "intltool-merge.in" \ 
     123                                "intltool-update.in" \ 
     124                                "ltmain.sh" \ 
     125                                "mkinstalldirs" \ 
     126                                "po/Makefile.in.in" \ 
     127                                ) 
     128 
     129for ARCH in $ARCHES ; do 
    69130    case $ARCH in 
    70131                ppc) export HOST=powerpc-apple-darwin9 
     
    85146 
    86147    #Note that whether we use openssl or cdsa the same underlying workarounds (as seen in jabber.c, only usage at present 12/07) are needed 
    87     export CFLAGS="$BASE_CFLAGS -arch $ARCH -I$TARGET_DIR/include -I$SDK_ROOT/usr/include/kerberosIV -DHAVE_SSL -DHAVE_OPENSSL -fno-common -DLIBPURPLE_NEW_API " 
     148    export CFLAGS="$BASE_CFLAGS -arch $ARCH -I$TARGET_DIR/include -I$SDK_ROOT/usr/include/kerberosIV -DHAVE_SSL -DHAVE_OPENSSL -fno-common " 
     149        if [ x"$MSN" = x"msn_pecan" ] ; then 
     150                export CFLAGS="$CFLAGS -DLIBPURPLE_NEW_API " 
     151        fi 
    88152 
    89153    if [ "$DEBUG_SYMBOLS" = "TRUE" ] ; then 
     
    101165                echo LDFLAGS is $LDFLAGS 
    102166                echo PKG_CONFIG is $PKG_CONFIG 
    103  
    104         # this part is really ew. We actually re-run autogen.sh per-arch. 
    105         # we pass configure --help so that it bails out and doesn't fubar the source 
    106         # tree, because otherwise we'd have to un-configure it. Stupid autotools. 
    107         pushd $PIDGIN_SOURCE > /dev/null 2>&1 
    108            ./autogen.sh --help 
    109         popd > /dev/null 2>&1 
     167         
    110168        # we don't need pkg-config for this 
    111169        export LIBXML_CFLAGS='-I/usr/include/libxml2'  
     
    115173        export MEANWHILE_CFLAGS="-I$TARGET_DIR/include/meanwhile -I$TARGET_DIR/include/glib-2.0 -I$TARGET_DIR/lib/glib-2.0/include" 
    116174        export MEANWHILE_LIBS="-lmeanwhile -lglib-2.0 -liconv" 
    117          
    118         $PIDGIN_SOURCE/configure \ 
    119                 --disable-gtkui --disable-consoleui \ 
    120                 --disable-perl \ 
    121                 --enable-debug \ 
    122                 --disable-static --enable-shared \ 
    123                 --with-krb4 \ 
    124                 --enable-cyrus-sasl \ 
    125                 --prefix=$TARGET_DIR \ 
    126                 --enable-msnp14 \ 
    127                 --with-static-prpls="$PROTOCOLS" --disable-plugins \ 
    128                 --host=$HOST \ 
    129                 --disable-gstreamer \ 
    130                 --disable-avahi \ 
    131                 --disable-dbus \ 
    132                 --enable-gnutls=no --enable-nss=no --enable-openssl=no $@ 
     175 
     176                # If we're trying to use files we generated previously, make sure they're there 
     177                FORCE_REGENERATE="$USER_REGENERATE" 
     178                if [ x"$FORCE_REGENERATE" = x"FALSE" ] ; then 
     179                        if [ ! -e ./Makefile ] ; then 
     180                                echo "Makefile not found; forcing regenerate" 
     181                                FORCE_REGENERATE=TRUE 
     182                        fi 
     183                        if [ ! -e ./config.status ] ; then 
     184                                echo "config.status not found; forcing regenerate" 
     185                                FORCE_REGENERATE=TRUE 
     186                        fi 
     187                        if [ ! -d ./autogen_cache ] ; then 
     188                                echo "autogen_cache not found; forcing regenerate" 
     189                                FORCE_REGENERATE=TRUE 
     190                        else 
     191                                pushd autogen_cache > /dev/null 2>&1 
     192                                        for file in ${AUTOGEN_GREMLINS[@]} ; do 
     193                                                if [ ! -e $file ] ; then 
     194                                                        echo "autogen_cache/$file not found; forcing regenerate" 
     195                                                        FORCE_REGENERATE=TRUE 
     196                                                        break 
     197                                                fi 
     198                                        done 
     199                                popd > /dev/null 2>&1 
     200                        fi 
     201                fi 
     202                 
     203                # We only need to autogen if building from scratch or it's requested 
     204                if [ x"$FORCE_REGENERATE" = x"TRUE" ] ; then 
     205                        pushd $PIDGIN_SOURCE > /dev/null 2>&1 
     206                   ./autogen.sh --help 
     207                popd > /dev/null 2>&1 
     208                         
     209                        $PIDGIN_SOURCE/configure \ 
     210                    --disable-gtkui --disable-consoleui \ 
     211                    --disable-perl \ 
     212                    --enable-debug \ 
     213                    --disable-static --enable-shared \ 
     214                    --with-krb4 \ 
     215                    --enable-cyrus-sasl \ 
     216                    --prefix=$TARGET_DIR \ 
     217                    --enable-msnp14 \ 
     218                    --with-static-prpls="$PROTOCOLS" --disable-plugins \ 
     219                    --host=$HOST \ 
     220                    --disable-gstreamer \ 
     221                    --disable-avahi \ 
     222                    --disable-dbus \ 
     223                    --enable-gnutls=no --enable-nss=no --enable-openssl=no $@ 
     224                else 
     225                        echo "Restoring files from previous build" 
     226                        for file in ${AUTOGEN_GREMLINS[@]} ; do 
     227                                cp -pRv autogen_cache/$file $PIDGIN_SOURCE/`dirname $file` 
     228                        done 
     229                fi 
     230                 
    133231        pushd libpurple > /dev/null 2>&1 
    134232            make -j $NUMBER_OF_CORES && make install 
    135233        popd > /dev/null 2>&1 
    136     popd 
     234 
     235                # Now save the files for later 
     236                echo "Rescuing files for subsequent builds" 
     237                rm -Rf ./autogen_cache || true 
     238                mkdir autogen_cache 
     239                pushd autogen_cache > /dev/null 2>&1 
     240                        for file in ${AUTOGEN_GREMLINS[@]} ; do 
     241                                if [ x`dirname $file` != x"." ] ; then 
     242                                        mkdir `dirname $file` || true 
     243                                fi 
     244                                cp -pRv $PIDGIN_SOURCE/$file `dirname $file` || true 
     245                        done 
     246                popd > /dev/null 2>&1 
     247                 
     248    popd > /dev/null 2>&1 
     249 
    137250    # HACK ALERT! We use the following internal-only headers: 
    138251    cp $PIDGIN_SOURCE/libpurple/protocols/oscar/oscar.h \ 
     
    157270pushd $PIDGIN_SOURCE > /dev/null 2>&1 
    158271        for patch in ${LIBPURPLE_PATCHES[@]} ; do 
     272                echo "Reverting $patch" 
    159273                patch -R -p0 < $patch || true 
    160274        done 
  • trunk/Utilities/dep-build-scripts/README

    r24279 r24354  
    1212Alternatively, you can substitute curl and xargs: 
    1313 
    14 $ (mkdir source || true) && cd source && (cat ../urls.txt | xargs -I %url%
    15 curl -LO %url%) && (ls -1 *.tar.gz | xargs -I %file% tar xzf %file%) &&
    16 (ls -1 *.tar.bz2 | xargs -I %file% tar xjf %file%) && rm -f *.tar.* && cd .. 
     14$ mkdir source; cd source; (cat ../urls.txt | xargs -I %url% curl -LO %url%)
     15&& (ls -1 *.tar.gz | xargs -I %file% tar xzf %file%) && (ls -1 *.tar.bz2 |
     16xargs -I %file% tar xjf %file%); rm -f *.tar.*; cd .. 
    1717 
    1818 
     
    2020 
    2121The Pidgin source is not installed by the download script. Adium currently uses 
    22 libpurple 2.4.2mtn from branch im.pidgin.pidgin. Patches applied during the 
     22libpurple 2.4.3mtn from branch im.pidgin.pidgin. Patches applied during the 
    2323build process expect this version. 
    2424 
     
    3434process. Please note that this file is nearly 200 MB. 
    3535 
    36 $ cd source; (mkdir im.pidgin.pidgin || true); cd im.pidgin.pidgin; curl -LO \ 
    37 http://developer.pidgin.im/static/pidgin.mtn.bz2; bzip2 -d pidgin.mtn.bz2;
    38 mtn db -d pidgin.mtn migrate; mtn -d pidgin.mtn pull --set-default pidgin.im
    39 "im.pidgin.*"; mtn -d pidgin.mtn co -b im.pidgin.pidgin .; cd ../.. 
     36$ cd source; mkdir im.pidgin.pidgin; cd im.pidgin.pidgin; curl -LO \ 
     37http://developer.pidgin.im/static/pidgin.mtn.bz2 && bzip2 -d pidgin.mtn.bz2
     38&& mtn db -d pidgin.mtn migrate && mtn -d pidgin.mtn pull --set-default
     39pidgin.im "im.pidgin.*" && mtn -d pidgin.mtn co -b im.pidgin.pidgin .; cd ../.. 
    4040 
    4141 
     
    4747 
    4848 
     49==== MOVING ==== 
     50 
     51If you move the Pidgin source tree, you must update the absolute path of the 
     52pidgin.mtn database file in source/im.pidgin.pidgin/_MTN/options. Otherwise, 
     53you will be unable to pull changesets from the monotone repository. 
     54 
     55 
    4956=== DOWNLOADING MSN-PECAN SOURCE TREE === 
    5057 
    51 * Skip this step if you are building without msn-pecan. 
     58 * Skip these steps if you are building without msn-pecan. 
    5259 
    5360The msn-pecan source is not installed by the download script. Adium currently 
     
    6168==== INITIAL CHECKOUT ==== 
    6269 
    63 * Skip this step if you are building without msn-pecan. 
    64  
    65 To check out the adium-test branch of msn-pecan, run 
     70To check out the msn-pecan master source tree, run 
    6671 
    6772$ cd source/im.pidgin.pidgin/libpurple/protocols; git clone \ 
    68 git://github.com/felipec/msn-pecan.git msn_pecan; cd msn_pecan; git checkout
    69 -b adium_test origin/adium_test; cd ../../../../.. 
     73git://github.com/felipec/msn-pecan.git msn_pecan && ln
     74msn_pecan/adium/Makefile.am msn_pecan && cd ../../../.. 
    7075 
    7176 
    7277==== UPDATING ==== 
    73  
    74 * Skip this step if you are building without msn-pecan. 
    7578 
    7679To update the msn-pecan source, run 
     
    147150=== LIBPURPLE === 
    148151 
    149 * If you are building with msn-pecan. Official Adium releases are using 
    150   msn-pecan at the moment. 
    151 $ ./purple_make.sh 
    152  
    153 * If you are building with libpurple's msnp14/15 implementation. 
    154 $ ./purple_make_without_msn-pecan.sh 
     152$ ./purple_make.sh [--ppc | --i386 ] [--regenerate] [--msn-pecan | --msn] 
     153 
     154This phase builds libpurple. The output of the build process is written to 
     155STDOUT. 
     156 
     157The script to build libpurple accepts some options: 
     158 
     159 * You may limit the build to one architecture by using either --ppc or --i386, 
     160   but note that you cannot build a Universal Binary when using either option. 
     161   This is mainly useful for checking that code compiles. 
     162 
     163 * If you would like to force the script to rerun autoconf and automake, use 
     164   the --regenerate option. Otherwise, it will detect whether or not to run 
     165   them based on the presence or absence of needed files. 
     166 
     167 * If you are building with msn-pecan, use the --msn-pecan option. This is the 
     168   default. Note that current releases of Adium use msn-pecan. 
     169 
     170 * If you are building with libpurple's msnp14/15 implementation, use the --msn 
     171   option. 
    155172 
    156173You must have set the PIDGIN_SOURCE variable for this script to run; see 
    157174SETTING PIDGIN PATH above. 
    158175 
    159 This phase builds libpurple. The output of the build process is written to 
    160 STDOUT. 
    161  
    162176You must run this part of the build process each time you update libpurple. 
    163177 
     
    183197written to STDOUT. 
    184198 
    185 You must run this part of the build process after a clean build, or after you 
    186 update libpurple
     199You must run this part of the build process after a clean build, or whenever 
     200libpurple has received localization updates
    187201 
    188202