Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 11 and Version 12 of SetupLinux

Show
Ignore:
Author:
keinfarbton (IP: 84.161.119.227)
Timestamp:
05/30/08 19:49:52 (10 years ago)
Comment:

change to curl

Legend:

Unmodified
Added
Removed
Modified
  • SetupLinux

    v11 v12  
    1818#!/bin/bash 
    1919 
    20 #test for required tools 
     20# exit with message and error code 
    2121function doExit { 
    2222    echo "$1" 
    2424} 
    2525 
     26# Test if a executable of name $1 exists 
    2627function testForTool { 
    2728    which $1 > /dev/null || doExit "Tool $1 is missing. Exit..." 1 
    2829} 
    2930 
    30  
    31 testForTool wget 
     31# download from-url to-file 
     32function download { 
     33    echo "Downloading $1 ..." 
     34    curl "-#" $1 -o $2 || doExit "Error while downloading. Exit..." 1 
     35
     36 
     37testForTool curl 
    3238testForTool tar 
    3339testForTool unzip 
    3440testForTool sed 
    3541testForTool patch 
     42 
     43EXE="" 
     44PLATFORM_PORT="dwt-linux" 
     45 
     46DMD_PLATFORM="linux" 
     47 
     48DSSS_PLATFORM="gnuWlinux-x86" 
     49DSSS_PROFILE="dmd-posix-tango" 
     50DSSS_VERSION="0.75" 
     51DSSS_ARCHIVE_EXT=".tar.gz" 
     52DSSS_ARCHIVE_BASE="dsss-$DSSS_VERSION-dmd-$DSSS_PLATFORM" 
     53DSSS_ARCHIVE="$DSSS_ARCHIVE_BASE$DSSS_ARCHIVE_EXT" 
     54DSSS_DIR="$DSSS_ARCHIVE_BASE" 
     55 
     56TANGO_PLATFORM="linux" 
     57TANGO_RELEASE="0.99.6" 
     58TANGO_DMD_RELEASE="1.029" 
     59TANGO_ARCHIVE_EXT=".tar.gz" 
     60TANGO_ARCHIVE_BASE="tango-$TANGO_RELEASE-bin-$TANGO_PLATFORM-dmd.$TANGO_DMD_RELEASE" 
     61TANGO_ARCHIVE="$TANGO_ARCHIVE_BASE$TANGO_ARCHIVE_EXT" 
     62TANGO_DIR="$TANGO_ARCHIVE_BASE" 
    3663 
    3764HG_EXISTS=0 
    5380read ok 
    5481 
    55 DSSS_VERSION=0.75 
    56 TANGO_RELEASE=0.99.6 
    57 TANGO_DMD_RELEASE=1.029 
    58 DSSS_DIR=dsss-$DSSS_VERSION-dmd-gnuWlinux-x86 
    59 DSSS_ARCHIVE=$DSSS_DIR.tar.gz 
    60 TANGO_DIR=tango-$TANGO_RELEASE-bin-linux-dmd.$TANGO_DMD_RELEASE 
    61 TANGO_ARCHIVE=$TANGO_DIR.tar.gz 
    62  
     82# create the archives directory, no error if already exists 
    6383mkdir -p archives 
    6484 
    6585# *** DSSS *** 
    66 # download dsss if that archive not already exists 
    6786if [ ! -f archives/$DSSS_ARCHIVE ] 
    6887then 
    69     wget http://svn.dsource.org/projects/dsss/downloads/$DSSS_VERSION/$DSSS_ARCHIVE -O archives/$DSSS_ARCHIVE 
    70 fi 
    71  
    72 # remove old version, extract the archive, rename it to simple name 
     88    echo "* download DSSS" 
     89    download http://svn.dsource.org/projects/dsss/downloads/$DSSS_VERSION/$DSSS_ARCHIVE archives/$DSSS_ARCHIVE 
     90fi 
     91 
     92echo "* removing old DSSS version, extract the archive, rename it to simple name" 
    7393rm -rf dsss 
    7494tar xzf archives/$DSSS_ARCHIVE 
    7696 
    7797# *** Tango *** 
    78 # download tango if that archive not already exists 
    7998if [ ! -f archives/$TANGO_ARCHIVE ] 
    8099then 
    81     wget http://downloads.dsource.org/projects/tango/$TANGO_RELEASE/$TANGO_ARCHIVE -O archives/$TANGO_ARCHIVE 
    82 fi 
    83  
    84 # remove old version, extract the archive, rename it to simple name 
     100    echo "* download Tango" 
     101    download http://downloads.dsource.org/projects/tango/$TANGO_RELEASE/$TANGO_ARCHIVE archives/$TANGO_ARCHIVE 
     102fi 
     103 
     104echo "* remove old tango version, extract the archive, rename it to simple name" 
    85105rm -rf tango 
    86106tar xzf archives/$TANGO_ARCHIVE 
    88108 
    89109# *** Jive **** 
    90 # download Jive if that archive not already exists 
    91110if [ ! -f archives/jive.zip ] 
    92111then 
    93     wget http://downloads.dsource.org/projects/dwt/jive.zip -O archives/jive.zip 
    94 fi 
    95  
    96 # remove old version, extract the archive 
     112    echo "* download Jive" 
     113    download http://downloads.dsource.org/projects/dwt/jive.zip archives/jive.zip 
     114fi 
     115 
     116echo "* remove old Jive version, extract the archive" 
    97117rm -rf jive 
    98 unzip archives/jive.zip 
     118unzip -q archives/jive.zip 
    99119 
    100120# Fixes and workarounds 
    101 echo "* Replace the DMD binary with 1.028 because of bug #2067" 
    102 if [ ! -f ./archives/dmd.1.028.zip ] 
    103 then 
    104     wget http://ftp.digitalmars.com/dmd.1.028.zip -O archives/dmd.1.028.zip 
    105 fi 
    106 unzip archives/dmd.1.028.zip dmd/bin/dmd 
    107 cp dmd/bin/dmd tango/bin/dmd 
    108 chmod +x tango/bin/dmd 
     121DMD_FIXUP_VERSION="1.028" 
     122echo "* Fix: Replace the DMD binary with $DMD_FIXUP_VERSION because of bug #2067" 
     123if [ ! -f ./archives/dmd.$DMD_FIXUP_VERSION.zip ] 
     124then 
     125    download http://ftp.digitalmars.com/dmd.$DMD_FIXUP_VERSION.zip archives/dmd.$DMD_FIXUP_VERSION.zip 
     126fi 
     127 
     128# extract compiler executable, copy it into the tango/bin folder and remove the extraction leftover dirs 
     129unzip -q archives/dmd.$DMD_FIXUP_VERSION.zip dmd/bin/dmd$EXE 
     130cp dmd/bin/dmd$EXE tango/bin/dmd$EXE 
     131chmod +x tango/bin/dmd$EXE 
    109132rm -rf dmd 
    110133 
    111 echo "* make dsss use the tango profile" 
    112 echo "profile=dmd-posix-tango" > dsss/etc/rebuild/default 
    113  
    114 echo "* make dsss use oneatatime=off" 
    115 sed -i s/oneatatime=yes/oneatatime=no/ dsss/etc/rebuild/dmd-posix-tango 
    116  
    117 echo "* create a dsss starter which prepends dsss/bin and tango/bin to PATH" 
     134echo "* Configure: make dsss use the tango profile" 
     135echo "profile=$DSSS_PROFILE" > dsss/etc/rebuild/default 
     136 
     137echo "* Configure: make dsss use oneatatime=off" 
     138sed -i s/oneatatime=yes/oneatatime=no/ dsss/etc/rebuild/$DSSS_PROFILE 
     139 
     140echo "* Configure: create a dsss starter which prepends dsss/bin and tango/bin to PATH" 
    118141DSSS_START=dsss.sh 
    119142echo "#!/bin/sh" > $DSSS_START 
    130153    if [ $HG_EXISTS -eq 0 ] 
    131154    then 
    132         echo "* download and extract $1" 
     155        echo "* download snapshot and extract $1" 
    133156        mkdir -p ./$1 
    134157        rm -f archives/$1.tar.gz 
    135         wget http://hg.dsource.org/projects/dwt-linux/archive/tip.tar.gz -O archives/$1.tar.gz 
     158        download http://hg.dsource.org/projects/$1/archive/tip.tar.gz archives/$1.tar.gz 
    136159        tar xz -C $1 --strip 1 --file archives/$1.tar.gz 
    137160        rm -f archive/$1.tar.gz 
    138161    else 
    139         echo "* clone Mercurial repository for $1" 
    140         hg clone http://hg.dsource.org/projects/$1 
     162        echo -n "* clone Mercurial repository for $1 ..." 
     163        hg clone -q http://hg.dsource.org/projects/$1 || doExit "Error while cloning $1" 1 
     164        echo " OK" 
    141165    fi 
    142166} 
    143167 
    144 doDwtRepos dwt-linux 
     168doDwtRepos $PLATFORM_PORT 
    145169doDwtRepos dwt-samples 
    146170doDwtRepos dwt-addons 
    147171 
    148 echo "* Patch the tango collections to work around the dmd 1.028 bug #1978" 
    149 echo "See also http://www.dsource.org/projects/dwt/wiki/JFace
    150  
    151 patch --no-backup-if-mismatch -p1 <<PATCHEND 
     172echo "* Fix: patch the tango collections to work around the dmd 1.028 bug #1978" 
     173echo "*  (See also http://www.dsource.org/projects/dwt/wiki/JFace)
     174 
     175patch -s -p1 << PATCHEND 
    152176diff -Naur old/tango/import/tango/util/collection/model/Seq.d new/tango/import/tango/util/collection/model/Seq.d 
    153177--- old/tango/import/tango/util/collection/model/Seq.d  2008-05-12 14:35:11.000000000 +0200 
    188212PATCHEND 
    189213 
    190 echo "* Building+installing dwt-linux
    191 cd dwt-linux 
    192 ../dsss.sh build >/dev/null 
    193 ../dsss.sh install >/dev/null 
     214echo "* Building+installing $PLATFORM_PORT
     215cd $PLATFORM_PORT 
     216../dsss.sh build >/dev/null || doExit "Compile failed" 1 
     217../dsss.sh install >/dev/null || doExit "DSSS $PLATFORM_PORT install failed" 1 
    194218cd .. 
    195219 
    205229echo "**************************************************" 
    206230 
     231 
    207232}}}