|
1 #!/bin/sh |
|
2 |
|
3 # Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. |
|
4 # |
|
5 # Redistribution and use in source and binary forms, with or without |
|
6 # modification, are permitted provided that the following conditions |
|
7 # are met: |
|
8 # |
|
9 # 1. Redistributions of source code must retain the above copyright |
|
10 # notice, this list of conditions and the following disclaimer. |
|
11 # 2. Redistributions in binary form must reproduce the above copyright |
|
12 # notice, this list of conditions and the following disclaimer in the |
|
13 # documentation and/or other materials provided with the distribution. |
|
14 # 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
|
15 # its contributors may be used to endorse or promote products derived |
|
16 # from this software without specific prior written permission. |
|
17 # |
|
18 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
|
19 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
21 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
|
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
25 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
|
27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
28 |
|
29 # A script to download the extra libraries needed to build WebKit on UNIX-based OSes. |
|
30 # libxml/libxslt need to be added, but so far I've had them on all the (UNIX) machines |
|
31 # I've tested on, so I don't have a machine to test the code on. |
|
32 |
|
33 DL_CMD="curl -L" |
|
34 |
|
35 DL_DIR=/tmp/webkit-deps |
|
36 # NOTE: If you change this, make sure the dir is on the path. |
|
37 DEPS_PREFIX=/usr/local |
|
38 |
|
39 mkdir -p $DL_DIR |
|
40 mkdir -p $DEPS_PREFIX |
|
41 |
|
42 ICU_VERSION="3.4.1" |
|
43 ICU_TARBALL="icu-$ICU_VERSION.tgz" |
|
44 ICU_URL="ftp://ftp.software.ibm.com/software/globalization/icu/$ICU_VERSION/$ICU_TARBALL" |
|
45 |
|
46 GPERF_VERSION="3.0.1" |
|
47 GPERF_TARBALL="gperf-$GPERF_VERSION.tar.gz" |
|
48 GPERF_URL="ftp://mirrors.kernel.org/gnu/gperf/$GPERF_TARBALL" |
|
49 |
|
50 PKG_CONFIG_VERSION="0.20" |
|
51 PKG_CONFIG_TARBALL="pkg-config-$PKG_CONFIG_VERSION.tar.gz" |
|
52 PKG_CONFIG_URL="http://pkgconfig.freedesktop.org/releases/$PKG_CONFIG_TARBALL" |
|
53 |
|
54 ICONV_VERSION="1.9.2" |
|
55 ICONV_TARBALL="libiconv-$ICONV_VERSION.tar.gz" |
|
56 ICONV_URL="http://ftp.gnu.org/pub/gnu/libiconv/$ICONV_TARBALL" |
|
57 |
|
58 cd $DL_DIR |
|
59 # build ICU |
|
60 if [ `which icu-config >/dev/null 2>&1` ]; then |
|
61 $DL_CMD -o $DL_DIR/$ICU_TARBALL $ICU_URL |
|
62 |
|
63 tar xzvf $DL_DIR/$ICU_TARBALL |
|
64 cd $DL_DIR/icu/source |
|
65 |
|
66 chmod +x configure install-sh |
|
67 ./configure --prefix=$DEPS_PREFIX |
|
68 |
|
69 make |
|
70 #make check |
|
71 make install |
|
72 |
|
73 cd $DL_DIR |
|
74 rm -rf icu |
|
75 fi |
|
76 |
|
77 if [ `which gperf >/dev/null 2>&1` ]; then |
|
78 $DL_CMD -o $DL_DIR/$GPERF_TARBALL $GPERF_URL |
|
79 |
|
80 tar xzvf $DL_DIR/$GPERF_TARBALL |
|
81 cd $DL_DIR/gperf-$GPERF_VERSION |
|
82 |
|
83 ./configure --prefix=$DEPS_PREFIX |
|
84 |
|
85 make |
|
86 make install |
|
87 |
|
88 cd $DL_DIR |
|
89 rm -rf $DL_DIR/gperf-$GPERF_VERSION |
|
90 fi |
|
91 |
|
92 # TODO: What would be a good way to test for this? |
|
93 if [ ! -f $DEPS_PREFIX/lib/libiconv.dylib ]; then |
|
94 $DL_CMD -o $DL_DIR/$ICONV_TARBALL $ICONV_URL |
|
95 |
|
96 tar xzvf $DL_DIR/$ICONV_TARBALL |
|
97 cd $DL_DIR/libiconv-$ICONV_VERSION |
|
98 |
|
99 ./configure --prefix=$DEPS_PREFIX |
|
100 |
|
101 make |
|
102 make install |
|
103 |
|
104 cd $DL_DIR |
|
105 rm -rf $DL_DIR/libiconv-$ICONV_VERSION |
|
106 fi |