summaryrefslogtreecommitdiff
path: root/doc/design/assistant/blog/day_184__just_wanna_run_something.mdwn
blob: ac34293c3f2e15ff032576ab3b10fb863de2d6fe (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
Have been working on getting all the haskell libraries git-annex uses
built with the android cross compiler. Difficulties so far are
libraries that need tweaks to work with the new version of ghc, and some
that use cabal in ways that break cross compilation. Haskell's network
library was the last and most challenging of those.

At this point, I'm able to start trying to build git-annex for android.
Here's the first try!

<pre>
joey@gnu:~/src/git-annex>cabal install -w $HOME/.ghc-android-14-arm-linux-androideabi-4.7/bin/arm-unknown-linux-androideabi-ghc --with-ghc-pkg=$HOME/.ghc-android-14-arm-linux-androideabi-4.7/bin/arm-unknown-linux-androideabi-ghc-pkg --with-ld=$HOME/.ghc-android-14-arm-linux-androideabi-4.7/bin/arm-linux-androideabi-ld --flags="-Webapp -WebDAV -XMPP -S3 -Dbus"
Resolving dependencies...
Configuring git-annex-3.20130207...
Building git-annex-3.20130207...
Preprocessing executable 'git-annex' for git-annex-3.20130207...
on the commandline: Warning:
    -package-conf is deprecated: Use -package-db instead

Utility/libdiskfree.c:28:26:
     fatal error: sys/statvfs.h: No such file or directory
compilation terminated.
</pre>

Should not be far from a first android build now..

----

While I already have Android "hello world" executables to try, I have not yet
been able to run them. Can't seem to find a directory I can write to on the
Asus Transformer, with a filesystem that supports the +x bit. Do you really
have to root Android just to run simple binaries? I'm crying inside.

It seems that the blessed Android NDK way would involve making a Java app,
that pulls in a shared library that contains the native code. For haskell,
the library will need to contain a C shim that, probably, calls an entry
point to the Haskell runtime system. Once running, it can use the FFI to
communicate back to the Java side, probably. The good news is that CJ van
den Berg, who already saved my bacon once by developing ghc-android, tells
me he's hard at work on that very thing.

----

In the meantime, downloaded the Android SDK. Have gotten it to build a
`.apk` package from just javascript code, and managed to do it without
using eclipse (thank god). Will need this later, but for now want to wash
my brain out with soap after using it.