aboutsummaryrefslogtreecommitdiff
path: root/standalone/android/buildchroot-inchroot-asuser
blob: a7bea231a8ad4965bd85e57210f8287662a8e066 (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
#!/bin/sh
# Runs inside the chroot set up by buildchroot, as the user it creates
set -e
set -x

# Put in /tmp by buildchroot, but when bootstrapping with propellor,
# this is run inside a checked out git-annex tree.
if [ -e /tmp/abiversion ]; then
	ABIVERSION=$(cat /tmp/abiversion)
else
	ABIVERSION=$(cat standalone/android/abiversion)
fi

cd
rm -rf .ghc .cabal .android
mkdir -p .android
cd .android
git clone https://github.com/joeyh/ghc-android
cd ghc-android
git checkout jessie-ghc-snapshot
./build

# This saves 2 gb, and the same sources are in build-*/ghc
rm -rf stage0

# Set up android SDK where the git-annex android Makefile
# expects to find it.
cd ..
ln -s ghc-android/android-ndk-* android-ndk
wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20130917.zip
unzip adt*.zip
rm adt*.zip
mv adt-bundle-linux-x86-* adt-bundle-linux-x86
rm -rf adt-bundle-linux-x86/eclipse

# The git-annex android Makefile needs this cc symlink.
ln -s arm-linux-androideabi-gcc $HOME/.ghc/$ABIVERSION/bin/cc

git config --global user.email androidbuilder@example.com
git config --global user.name androidbuilder