New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build script for ipfs command line on Android ARM #9
Comments
I don't think you need the CC and GOGCCFLAGS vars. go-ipfs can't be built with GCC <= 5. |
thanks for the input - unfortunately somehow I am not ending up with the ipfs binary after this approach:
I already had a IPFS binary ( context: #4 ) - unfortunately It was freezing on some commands ( like init and pin ) - I am using gomobile currently - this works but has some other drawbacks. Would love to do it with a binary and Runtime.exec - but have not much experience with go to be fast figuring out problems like this. I live in the java/kotlin android world ;-) Update:
|
I think you need to first do the standard "make install" for go-ipfs to get all the dependencies like gx. Once you can build the standard go for linux/amd64/x86, then clean that, and do the build with the script. Sorry I didn't see #4 - good to see this effort was already underway. I use this same trick building our Tor Pluggable Transport libraries (meek and obfs4) so it definitely works at a production level. Gomobile is the future, but it also requires a pretty big shift from standard Go code that I haven't quite got my head around either. I think we could create a Gomobile library, that imports the main go-ipfs libraries, and offers the ability to launch the daemons etc via an API. This will need to be done for iOS support. |
This method doesn't appear to be working anymore (as of 2018-03-04) Software in use: Since this issue was originally posted, has anybody else worked on a more streamlined ipfs build targetting android/arm? (using gomobile or otherwise) I'd appreciate any pointers you can provide. Thank you |
@htrob did you try what I posted in #28 ? |
@ligi Yes, I tried exactly that and it didn't work. At least it does not work in the exact way that was pasted. I don't know what I'm missing, it may possibly be a missing dependency or state your solution is assuming to be present, but I don't know what that is. |
what was the error you got? |
Sorry I thought I had pasted this earlier.
It seems that the IPFS Makefile has been changed? |
hm - this is strange - still works here - so I do not think the IPFS Makefile has changed. What OS are you on? |
Ubuntu 16.04 LTS |
This will produce an Android ARM command line ipfs binary that you can embed in an app and run via Runtime.exec()
You can install and execute binaries, as we do with the Orbot (Tor on Android) app:
https://github.com/n8fr8/orbot/blob/master/src/org/torproject/android/service/TorResourceInstaller.java
https://github.com/n8fr8/orbot/blob/master/src/org/torproject/android/service/TorService.java#L912
!/bin/sh
export NDK_TOOLCHAIN=/please/define/this/to/your/ndk
export CC=$NDK_TOOLCHAIN/bin/arm-linux-androideabi-gcc
export GOOS=android
export GOARCH=arm
export GOARM=7
export CGO_ENABLED=1
GOGCCFLAGS="$GOGCCFLAGS -fPIE -pie"
go build -v --ldflags '-extldflags "-fPIE -pie" "-s"'
adb push ipfs /data/local/tmp
adb shell IPFS_PATH=/data/local/tmp /data/local/tmp/ipfs init
adb shell IPFS_PATH=/data/local/tmp /data/local/tmp/ipfs daemon &
The text was updated successfully, but these errors were encountered: