summaryrefslogtreecommitdiffstats
path: root/build/install-build-deps.sh
blob: 8ee3fc52818fa5763e039330f7bfc3c42ccf61e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/sh
# Script to install everything needed to build chromium (well, ideally, anyway)
# See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions
# and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit
set -ex

# Root can't access files on all filesystems, but /tmp should always be ok
# (unless it's full).  
DIR=`mktemp -d`
cd $DIR
touch .created

cleanup() {
  test -f $DIR/.created && rm -rf $DIR
}

# TODO(dkegel): add sha1sum verification
download() {
  dir=$1
  file=$2
  if ! test -f $file
  then
    wget $MIRROR/$dir/$file
  fi
}

unpack_deb() {
  file=$1
  ar x $file
  tar -xzvf data.tar.gz
  rm -f data.tar.gz control.tar.gz
}

download_deb() {
  download $1 $2
  unpack_deb $2
}

install_hardy() {
  sudo apt-get install subversion pkg-config python perl g++ g++-multilib \
       bison flex gperf libnss3-dev libglib2.0-dev libgtk2.0-dev \
       libnspr4-0d libnspr4-dev wdiff lighttpd php5-cgi msttcorefonts \
       sun-java6-fonts
}

install_hardy_64() {
  install_hardy

  # The packages libnspr4, libnss3, and libsqlite don't have 32
  # bit compabibility versions on 64 bit ubuntu hardy,
  # so install them packages the hard way
  # See https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/246911
  # TODO: There is no bug report yet for 32 bit sqlite runtime

  mkdir -p workdir-hardy64
  cd workdir-hardy64
  rm -rf usr

  MIRROR=http://mirrors.kernel.org/ubuntu
  download_deb pool/main/n/nspr libnspr4-0d_4.7.1~beta2-0ubuntu1_i386.deb
  download_deb pool/main/n/nss libnss3-1d_3.12.0~beta3-0ubuntu1_i386.deb
  download_deb pool/main/s/sqlite3 libsqlite3-0_3.4.2-2_i386.deb

  sudo rsync -v -a usr/lib/* /usr/lib32/
  sudo ldconfig

  # Make missing symlinks as described by 
  # https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/277772
  # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=492453 
  # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=497087
  cd /usr/lib32
  for lib in gio-2.0 gdk-x11-2.0 atk-1.0 gdk_pixbuf-2.0 \
           pangocairo-1.0 pango-1.0 pangoft2-1.0 \
           gobject-2.0 gmodule-2.0 glib-2.0 gtk-x11-2.0; do
    sudo ln -s -f lib$lib.so.0 lib$lib.so
  done
  for lib in z fontconfig
  do
    sudo ln -s -f lib$lib.so.1 lib$lib.so
  done
  for lib in cairo
  do
    sudo ln -s -f lib$lib.so.2 lib$lib.so
  done
  for lib in freetype
  do
    sudo ln -s -f lib$lib.so.6 lib$lib.so
  done
  for lib in plds4 plc4 nspr4
  do
    sudo ln -s -f /usr/lib32/lib$lib.so.0d /usr/lib32/lib$lib.so
  done

  for lib in nss3 nssutil3 smime3 ssl3
  do
    sudo ln -s -f /usr/lib32/lib$lib.so.1d /usr/lib32/lib$lib.so
  done
}

if egrep -q "Ubuntu 8.04|Ubuntu 8.10" /etc/issue && test `uname -m` = i686
then
  install_hardy
elif egrep -q "Ubuntu 8.04|Ubuntu 8.10" /etc/issue && test `uname -m` = x86_64
then
  install_hardy_64
else
  echo "Unsupported system"
  cleanup
  exit 1
fi
cleanup