Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

android: Add dependency download script

  • Loading branch information...
commit 4de24dc4c2eaaf7328326bec9c7ce7edc1c987d9 1 parent be11896
@kmcallister authored
View
8 android/README.md
@@ -15,8 +15,16 @@ The script `android/build` runs on x86 GNU/Linux and builds the executable
[Android NDK]: http://developer.android.com/sdk/ndk/index.html
+The script `android/download` will fetch whichever of these are missing. It
+does verify checksums against some files I had lying around, but don't take
+this as ultimate trust!
+
You will need a fairly recent NDK. (How recent? Let's find out someday.)
+
+Build options
+-------------
+
You can do a parallel build like so:
$ MAKE_FLAGS=-j12 android/build
View
19 android/build
@@ -1,12 +1,7 @@
#!/bin/bash -xe
-arch=arm
-platform=arm-linux-androideabi
-android_version=14
-ncurses=ncurses-5.9.tar.gz
-protobuf=protobuf-2.4.1.tar.bz2
-
here="$(dirname "$(readlink -f "$0")")"
+source "$here"/vars
inputs="$here"/inputs
tool="$here"/tool
@@ -19,8 +14,8 @@ export PATH="$tool"/bin:"$PATH"
ndk="$(readlink -f "$inputs"/ndk)"
if ! [ -d "$ndk" \
- -a -f "$inputs/$ncurses" \
- -a -f "$inputs/$protobuf" ]; then
+ -a -f "$inputs/$ncurses_src" \
+ -a -f "$inputs/$protobuf_src" ]; then
set +x
echo
echo "Error: missing inputs"
@@ -56,8 +51,8 @@ function config {
}
function build_ncurses {
- unpack $ncurses
- cd "$libs"/${ncurses%.*.*}
+ unpack $ncurses_src
+ cd "$libs"/${ncurses_src%.*.*}
config \
--prefix="$prefix" \
--disable-shared \
@@ -80,8 +75,8 @@ EOF
}
function build_protobuf {
- unpack $protobuf
- cd "$libs"/${protobuf%.*.*}
+ unpack $protobuf_src
+ cd "$libs"/${protobuf_src%.*.*}
patch -p0 <<EOF
--- config.sub.orig 2012-03-18 03:49:52.000000000 -0400
+++ config.sub 2012-03-18 03:50:21.000000000 -0400
View
26 android/download
@@ -0,0 +1,26 @@
+#!/bin/bash -e
+
+here="$(dirname "$(readlink -f "$0")")"
+source "$here"/vars
+cd "$here"/inputs
+
+function fetch {
+ eval src=\$${1}_src
+ eval url=\$${1}_url
+ eval sha=\$${1}_sha
+
+ wget -O "$src" -c "$url"
+ echo "$sha $src" | sha1sum --check --quiet
+}
+
+fetch ncurses
+fetch protobuf
+
+if ! [ -d ndk ]; then
+ fetch ndk
+ echo "Extracting $ndk_src"
+ mkdir -p ndk
+ tar --strip-components=1 -Cndk -axf $ndk_src
+fi
+
+echo 'Success!'
View
15 android/vars
@@ -0,0 +1,15 @@
+arch=arm
+platform=arm-linux-androideabi
+android_version=14
+
+ncurses_src=ncurses-5.9.tar.gz
+ncurses_url=http://ftp.gnu.org/pub/gnu/ncurses/$ncurses_src
+ncurses_sha=3e042e5f2c7223bffdaac9646a533b8c758b65b5
+
+protobuf_src=protobuf-2.4.1.tar.bz2
+protobuf_url=http://protobuf.googlecode.com/files/$protobuf_src
+protobuf_sha=df5867e37a4b51fb69f53a8baf5b994938691d6d
+
+ndk_src=android-ndk-r7b-linux-x86.tar.bz2
+ndk_url=http://dl.google.com/android/ndk/$ndk_src
+ndk_sha=501ab78a8d98230153baacd49920142f65e97664

0 comments on commit 4de24dc

Please sign in to comment.
Something went wrong with that request. Please try again.