summaryrefslogtreecommitdiffstats
path: root/chroot-scripts/build-e.sh
blob: 79ec81270828de580a79da0c62f829286d1a9c7a (plain) (blame)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#!/bin/bash

###
# this is a convenience script for getting/updating e17 from svn.
# (this is what you need to build e17 and entrance).
###

###
# settings - feel free to change these...
###
# the directory to install into (a full path to where on the system to install)
PREFIX="/usr/local"
# install as root ("yes" or "no") - note. you CAN install as a user too, but
# only into directories you have permission to install into. also you will
# need to modify your LD_LIBRARY_PATH shell variable to access things
ROOT_INSTALL="yes"
# build enlightenment - the window manager ("yes" or "no")
BUILD_E="no"
###
# end config
###






# modules
CORE_MODULES="eina eet evas ecore e_dbus efreet embryo edje"
E_MODULES="e"

MODULES=$CORE_MODULES
if [ $BUILD_E == "yes" ]; then
  MODULES=$MODULES" "$E_MODULES
fi

# actual working parts of the script (no need to really touch this)
if [ $ROOT_INSTALL == "yes" ]; then
  echo "---------------------------------------------------------------------"
  echo ""
  # test sudo
  echo "Check sudo access"
  NOSUDO="no"
  sudo ls /root || NOSUDO="yes"

  if [ $NOSUDO == "yes" ]; then
    echo "You have no sudo access. You need this to install on the system."
    echo "Try add this line to your /etc/sudoers file:"
    echo ""
    echo $USER" ALL=(ALL) NOPASSWD: ALL"
    exit -1
  fi

  # check ldo.so.conf
  echo "Check /etc/ld.so.conf sanity"
  LDCONF=`grep $PREFIX/lib /etc/ld.so.conf /etc/ld.so.conf.d/*`
  if [ -z "$LDCONF" ]; then
    echo "Add "$PREFIX"/lib to /etc/ld.so.conf please."
    exit -1
  fi
fi

if [ "$NOSUDO" == "no" ]; then
  # detect distribution here
  if [ -f "/etc/apt/sources.list" ]; then
    F=`grep "gutsy" "/etc/apt/sources.list"`
    if [ -n "$F" ]; then
      DISTRO="ubuntu-gutsy"
    else
      F=`grep "feisty" "/etc/apt/sources.list"`
      if [ -n "$F" ]; then
        DISTRO="ubuntu-feisty"
      else
	F=`grep "hardy" "/etc/apt/sources.list"`
	if [ -n "$F" ]; then
          DISTRO="ubuntu-hardy"
      else
	F=`grep "intrepid" "/etc/apt/sources.list"`
	if [ -n "$F" ]; then
          DISTRO="ubuntu-intrepid"
	else
          F=`grep "unstable" "/etc/apt/sources.list"`
          if [ -n "$F" ]; then
            DISTRO="debian-unstable"
          else
            F=`grep " sid" "/etc/apt/sources.list"`
            if [ -n "$F" ]; then
              DISTRO="debian-unstable"
		  fi
	    fi
	  fi
	fi
      fi
    fi
  fi
  echo "Detected distribution: $DISTRO"
  if   [ "$DISTRO" == "debian-unstable" ]; then
## FIXME: unknown is this works or not
    sudo apt-get update
    sudo apt-get install \
      xterm make gcc bison flex subversion \
      automake1.10 autoconf autoconf-archive libtool gettext \
      libc6-dev \
      zlib1g-dev libjpeg62-dev \
      libpng12-dev libfreetype6-dev \
      libxrender-dev libx11-dev libxinerama-dev \
      libxss-dev libxext-dev libxrandr-dev libxp-dev \
      libxfixes-dev libxdamage-dev libxcursor-dev \
      libpam0g-dev
  elif [ "$DISTRO" == "ubuntu-feisty" ]; then
    sudo apt-get update
    sudo apt-get install \
      xterm make gcc bison flex subversion automake1.10 autoconf autotools-dev \
      autoconf-archive libtool gettext \
      libpam0g-dev libfreetype6-dev libpng12-dev zlib1g-dev libjpeg-dev \
      libtiff-dev libungif4-dev librsvg2-dev libx11-dev libxcursor-dev \
      libxrender-dev libxrandr-dev libxfixes-dev libxdamage-dev \
      libxcomposite-dev libxss-dev libxp-dev libxext-dev libxinerama-dev \
      libxft-dev libxfont-dev libxi-dev libxv-dev libxkbfile-dev \
      libxkbui-dev libxres-dev libxtst-dev libltdl3-dev libglu1-xorg-dev \
      libglut3-dev xserver-xephyr libdbus-1-dev
  elif [ "$DISTRO" == "ubuntu-gutsy" ]; then
    sudo apt-get update
    sudo apt-get install \
      xterm make gcc bison flex subversion automake1.10 autoconf autotools-dev \
      autoconf-archive libtool gettext \
      libpam0g-dev libfreetype6-dev libpng12-dev zlib1g-dev libjpeg-dev \
      libtiff-dev libungif4-dev librsvg2-dev libx11-dev libxcursor-dev \
      libxrender-dev libxrandr-dev libxfixes-dev libxdamage-dev \
      libxcomposite-dev libxss-dev libxp-dev libxext-dev libxinerama-dev \
      libxft-dev libxfont-dev libxi-dev libxv-dev libxkbfile-dev \
      libxkbui-dev libxres-dev libxtst-dev libltdl3-dev libglu1-xorg-dev \
      libglut3-dev xserver-xephyr libdbus-1-dev
  elif [ "$DISTRO" == "ubuntu-hardy" ]; then
    sudo apt-get update
    sudo apt-get install \
      xterm make gcc bison flex subversion automake1.10 autoconf autotools-dev \
      autoconf-archive libtool gettext \
      libpam0g-dev libfreetype6-dev libpng12-dev zlib1g-dev libjpeg-dev \
      libtiff-dev libungif4-dev librsvg2-dev libx11-dev libxcursor-dev \
      libxrender-dev libxrandr-dev libxfixes-dev libxdamage-dev \
      libxcomposite-dev libxss-dev libxp-dev libxext-dev libxinerama-dev \
      libxft-dev libxfont-dev libxi-dev libxv-dev libxkbfile-dev \
      libxkbui-dev libxres-dev libxtst-dev libltdl3-dev libglu1-xorg-dev \
      libglut3-dev xserver-xephyr libdbus-1-dev
  elif [ "$DISTRO" == "ubuntu-intrepid" ]; then
    #sudo apt-get update
    sudo apt-get install \
      xterm make gcc bison flex subversion automake1.10 autoconf autotools-dev \
      autoconf-archive libtool gettext \
      libpam0g-dev libfreetype6-dev libpng12-dev zlib1g-dev libjpeg62-dev \
      libtiff4-dev libungif4-dev librsvg2-dev libx11-dev libxcursor-dev \
      libxrender-dev libxrandr-dev libxfixes-dev libxdamage-dev \
      libxcomposite-dev libxss-dev libxp-dev libxext-dev libxinerama-dev \
      libxft-dev libxfont-dev libxi-dev libxv-dev libxkbfile-dev \
      libxkbui-dev libxres-dev libxtst-dev libltdl7-dev libglu1-xorg-dev \
      libglut3-dev xserver-xephyr libdbus-1-dev
  elif [ "$DISTRO" == "sample-distribution" ]; then
    echo "sample distro"
    # FIXME:  put in whatever commands are needed to get a good list of
    # dependencies for e and install themb - svn build tools etc. too. only
    # put what is needed - there are optional libs like libtiiff/gif etc.
    # but they hve no direct required to really suggested usefulness.
  else
    echo "Your distribution is not supported. Please adit this script and"
    echo "add a section to detect your distribution and then to install"
    echo "required packages for it."
  fi
fi

# make sure we have the prefix in the PATH for now
export PATH="$PREFIX/bin:$PATH"
export LD_LIBRARY_PATH="$PREFIX/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"

CLEAN="no"

# check if we have a svn tree already
if [ -d ./e/e/.svn ]; then
  echo "---------------------------------------------------------------------"
  echo ""
  echo "Updating SVN"
  CLEAN="yes"
  cd ./e
  for I in $MODULES; do
    cd $I
    svn update
    cd ..
  done
  cd ..
else
  # get svn
  echo "---------------------------------------------------------------------"
  echo ""
  echo "Checking out SVN"
  mkdir e
  cd e
  for I in $MODULES; do
    svn co http://svn.enlightenment.org/svn/e/trunk/$I
  done
  cd ..
fi

# enable error abort from now on
set -e

# build and install it all
echo "---------------------------------------------------------------------"
echo ""
echo "Build..."
for I in $MODULES; do
  pushd e/$I
  echo "---------------------------------------------------------------------"
  echo ""
  echo "Building: "$I
  echo ""
  if [ $CLEAN == "yes" ]; then
    make clean distclean || true
  fi
  echo ""
  echo "Autofoo: "$I
  echo ""
  ./autogen.sh --prefix=$PREFIX
  echo ""
  echo "Compiling: "$I
  echo ""
  make
  echo ""
  echo "Installing: "$I
  echo ""
  if [  $ROOT_INSTALL == "yes" ]; then
    sudo make install
    sudo ldconfig
  else
    make install
  fi
  popd
done

echo "---------------------------------------------------------------------"
echo ""
echo "NOTE: you will want to add "$PREFIX"/bin to your user's (and maybe"
echo "      root's) PATH variable. (see your documentation on the PATH shell"
echo "      variable for more information on how to do this)."
if [ $ROOT_INSTALL == "no" ]; then
echo "NOTE: you will want to add "$PREFIX"/lib to your user's (and maybe"
echo "      root's) LD_LIBRARY_PATH variable. (see your documentation on the"
echo "      LD_LIBRARY_PATH shell variable for more information on how to do"
echo "      this)."
fi