summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-12 14:24:53 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-12 14:24:53 -0400
commit6b1536a9af254d4f010fcc8acf11262154b90bdd (patch)
tree4fec56faf10a12c9f716838a2c923d3c86cd5aa9
parentef4d1f04322d9af0239222e13cd782d01c1e6d05 (diff)
separate android 4.0 and 4.3 builds needed
Also, parameterize the abdroid abi version
-rw-r--r--Makefile14
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/git-annex_broken_on_Android_4.3.mdwn4
-rw-r--r--doc/install/Android.mdwn11
-rw-r--r--git-annex.cabal2
-rw-r--r--standalone/android/Makefile13
-rw-r--r--standalone/android/abiversion1
-rwxr-xr-xstandalone/android/buildchroot1
-rwxr-xr-xstandalone/android/buildchroot-inchroot-asuser3
-rwxr-xr-xstandalone/android/clean-haskell-packages4
-rwxr-xr-xstandalone/android/install-haskell-packages2
11 files changed, 37 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index eb53ac843..3f3ed350a 100644
--- a/Makefile
+++ b/Makefile
@@ -189,14 +189,16 @@ android: Build/EvilSplicer
sed -i 's/GHC-Options: \(.*\)-Wall/GHC-Options: \1-Wall -fno-warn-unused-imports /i' tmp/androidtree/git-annex.cabal
# Cabal cannot cross compile with custom build type, so workaround.
sed -i 's/Build-type: Custom/Build-type: Simple/' tmp/androidtree/git-annex.cabal
+# Build just once, but link twice, for 2 different versions of Android.
+ mkdir -p tmp/androidtree/dist/build/git-annex/4.0 tmp/androidtree/dist/build/git-annex/4.3
if [ ! -e tmp/androidtree/dist/setup/setup ]; then \
- cd tmp/androidtree && $$HOME/.ghc/android-14/arm-linux-androideabi-4.8/arm-linux-androideabi/bin/cabal configure -fAndroid $(ANDROID_FLAGS); \
+ cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal configure -fAndroid $(ANDROID_FLAGS); \
fi
- cd tmp/androidtree && $$HOME/.ghc/android-14/arm-linux-androideabi-4.8/arm-linux-androideabi/bin/cabal build
-
-adb:
- ANDROID_FLAGS="-Production" $(MAKE) android
- adb push tmp/androidtree/dist/build/git-annex/git-annex /data/data/ga.androidterm/bin/git-annex
+ cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \
+ && mv dist/build/git-annex/git-annex dist/build/git-annex/4.0/git-annex
+ cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \
+ --ghc-options=-optl-z --ghc-options=-optlnocopyreloc \
+ && mv dist/build/git-annex/git-annex dist/build/git-annex/4.3/git-annex
androidapp:
$(MAKE) android
diff --git a/debian/changelog b/debian/changelog
index bdc7c5e68..0f2ad007c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,6 +24,8 @@ git-annex (5.20131102) UNRELEASED; urgency=low
remote monitoring interfaceat http://localhost:4242/
* Fix bug that caused bad information to be written to the git-annex branch
when running describe or other commands with a remote that has no uuid.
+ * Work around Android linker problem that had prevented git-annex from
+ running on Android 4.3 and 4.4.
-- Joey Hess <joeyh@debian.org> Wed, 06 Nov 2013 16:14:14 -0400
diff --git a/doc/bugs/git-annex_broken_on_Android_4.3.mdwn b/doc/bugs/git-annex_broken_on_Android_4.3.mdwn
index da1f7fd28..4c1b356fb 100644
--- a/doc/bugs/git-annex_broken_on_Android_4.3.mdwn
+++ b/doc/bugs/git-annex_broken_on_Android_4.3.mdwn
@@ -1,3 +1,7 @@
As per [[install/Android/#comment-e218073735d67691a2c3f66cc53ca6ac]] and [[install/Android/#comment-29bd13ab9cb830ffcd7850b84fb111c8]] :
git-annex is broken on Android 4.3; both on Nexus 4 and Nexus 7.
+
+> [[Fixed|done]]. A 4.3 build of the apk is now available.
+> (Unfortunately the fix breaks support for older versions of Android,
+> so two versions of the apk have to be built now.) --[[Joey]]
diff --git a/doc/install/Android.mdwn b/doc/install/Android.mdwn
index c39d11568..e7eac8b3c 100644
--- a/doc/install/Android.mdwn
+++ b/doc/install/Android.mdwn
@@ -7,15 +7,20 @@ Now git-annex can be used on Android!
First, ensure your Android device is configured to allow installation
of the app. Go to Setup -&gt; Security, and enable "Unknown Sources".
-[Download the git-annex.apk](http://downloads.kitenet.net/git-annex/android/current/)
-onto your Android device, and open it to install.
+Then download the git-annex.apk for your version of Android, and
+open it to install.
+
+* [Android 4.4 and 4.3 git-annex.apk](http://downloads.kitenet.net/git-annex/android/current/4.3/git-annex.apk)
+* [Android 4.0 to 4.2 git-annex.apk](http://downloads.kitenet.net/git-annex/android/current/4.0/git-annex.apk)
## autobuilds
A daily build is also available, thanks to Mesar Hameed and the University
of Bath CS department.
-* [download apk](http://downloads.kitenet.net/git-annex/autobuild/android/git-annex.apk) ([build logs](http://downloads.kitenet.net/git-annex/autobuild/android/))
+* [Android 4.4 and 4.3 git-annex.apk](http://downloads.kitenet.net/git-annex/autobuild/android/4.3/git-annex.apk)
+* [Android 4.0 and 4.2 git-annex.apk](http://downloads.kitenet.net/git-annex/autobuild/android/4.0/git-annex.apk)
+* [build logs](http://downloads.kitenet.net/git-annex/autobuild/android/)
## building it yourself
diff --git a/git-annex.cabal b/git-annex.cabal
index 905b77f97..848477c18 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -131,8 +131,6 @@ Executable git-annex
if flag(Android)
Build-Depends: data-endian
CPP-Options: -D__ANDROID__
- -- Avoid R_ARM_COPY problem which breaks Android linker
- GHC-Options: -optl-z -optlnocopyreloc
if flag(Assistant)
if os(linux) && flag(Inotify)
diff --git a/standalone/android/Makefile b/standalone/android/Makefile
index 2b326abc7..d80d568db 100644
--- a/standalone/android/Makefile
+++ b/standalone/android/Makefile
@@ -2,7 +2,7 @@
# and builds the Android app.
# Add Android cross-compiler to PATH (as installed by ghc-android)
-ANDROID_CROSS_COMPILER?=$(HOME)/.ghc/android-14/arm-linux-androideabi-4.8/bin
+ANDROID_CROSS_COMPILER?=$(HOME)/.ghc/$(shell cat abiversion)/bin
PATH:=$(ANDROID_CROSS_COMPILER):$(PATH)
# Paths to the Android SDK and NDK.
@@ -31,7 +31,6 @@ build: start
# Install executables as pseudo-libraries so they will be
# unpacked from the .apk.
mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi
- cp ../../tmp/androidtree/dist/build/git-annex/git-annex $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so
cp $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.busybox.so
cp $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/ssh $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.ssh.so
cp $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/ssh-keygen $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.ssh-keygen.so
@@ -74,9 +73,15 @@ build: start
git rev-parse HEAD > $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.version.so
+ mkdir -p ../../tmp/4.0 ../../tmp/4.3
+
+ cp ../../tmp/androidtree/dist/build/git-annex/4.3/git-annex $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so
+ cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && ant debug
+ cp $(GIT_ANNEX_ANDROID_SOURCETREE)/term/bin/Term-debug.apk ../../tmp/4.3/git-annex.apk
+
+ cp ../../tmp/androidtree/dist/build/git-annex/4.0/git-annex $(GIT_ANNEX_ANDROID_SOURCETREE)/term/libs/armeabi/lib.git-annex.so
cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && ant debug
- mkdir -p ../../tmp
- cp $(GIT_ANNEX_ANDROID_SOURCETREE)/term/bin/Term-debug.apk ../../tmp/git-annex.apk
+ cp $(GIT_ANNEX_ANDROID_SOURCETREE)/term/bin/Term-debug.apk ../../tmp/4.0/git-annex.apk
$(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp:
cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && CC=$$(which cc) ./Configure android
diff --git a/standalone/android/abiversion b/standalone/android/abiversion
new file mode 100644
index 000000000..4cc4c14cd
--- /dev/null
+++ b/standalone/android/abiversion
@@ -0,0 +1 @@
+android-14/arm-linux-androideabi-4.8
diff --git a/standalone/android/buildchroot b/standalone/android/buildchroot
index b759ae6ce..44337eb0c 100755
--- a/standalone/android/buildchroot
+++ b/standalone/android/buildchroot
@@ -8,6 +8,7 @@ fi
debootstrap --arch=i386 stable debian-stable-android
cp $0-inchroot debian-stable-android/tmp
cp $0-inchroot-asuser debian-stable-android/tmp
+cp $(dirname $0)/abiversion debian-stable-android/tmp
# Don't use these vars in the chroot.
unset TMP
diff --git a/standalone/android/buildchroot-inchroot-asuser b/standalone/android/buildchroot-inchroot-asuser
index c3d7bdf76..710e76e46 100755
--- a/standalone/android/buildchroot-inchroot-asuser
+++ b/standalone/android/buildchroot-inchroot-asuser
@@ -29,8 +29,7 @@ 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/android-14/arm-linux-androideabi-4.8/bin/cc
+ln -s arm-linux-androideabi-gcc $HOME/.ghc/$(cat /tmp/abiversion)/bin/cc
cd
git clone git://git-annex.branchable.com/ git-annex
diff --git a/standalone/android/clean-haskell-packages b/standalone/android/clean-haskell-packages
index 49a2ad713..b8c6132d6 100755
--- a/standalone/android/clean-haskell-packages
+++ b/standalone/android/clean-haskell-packages
@@ -2,5 +2,5 @@
# Removes all currently installed cross-compiled haskell packages
# except those part of ghc.
# Useful if the build failed.
-rm -f $(grep -l $HOME/.ghc/android-14/arm-linux-androideabi-4.8/.cabal/lib/ $HOME/.ghc/android-14/arm-linux-androideabi-4.8/lib/*-ghc-*/package.conf.d/*.conf)
-$HOME/.ghc/android-14/arm-linux-androideabi-4.8/arm-linux-androideabi/bin/ghc-pkg recache
+rm -f $(grep -l $HOME/.ghc/$(cat abiversion)/.cabal/lib/ $HOME/.ghc/android-14/arm-linux-androideabi-4.8/lib/*-ghc-*/package.conf.d/*.conf)
+$HOME/.ghc/$(cat abiversion)/arm-linux-androideabi/bin/ghc-pkg recache
diff --git a/standalone/android/install-haskell-packages b/standalone/android/install-haskell-packages
index 10272919d..f0a4b9113 100755
--- a/standalone/android/install-haskell-packages
+++ b/standalone/android/install-haskell-packages
@@ -115,6 +115,6 @@ echo
echo
echo cross build
echo
-PATH=$HOME/.ghc/android-14/arm-linux-androideabi-4.8/bin:$HOME/.ghc/android-14/arm-linux-androideabi-4.8/arm-linux-androideabi/bin:$PATH
+PATH=$HOME/.ghc/$(cat abiversion)/bin:$HOME/.ghc/$(cat abiversion)/arm-linux-androideabi/bin:$PATH
cabal update
install_pkgs