Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Android Build #102

Closed
No9 opened this issue May 24, 2014 · 9 comments
Closed

Android Build #102

No9 opened this issue May 24, 2014 · 9 comments

Comments

@No9
Copy link
Contributor

No9 commented May 24, 2014

So I was talking to @dominictarr earlier this week at decent camp and we are both interested in node-android.
Currently testing out these build instructions
https://gist.github.com/modeswitch/114c9bd55d800df242a2

But according to this issue it should just work:
nodejs/node-v0.x-archive#5514

Talking to @mafintosh it shouldn't be to hard to put into the 'prebuilt' stuff but we need to workout the build.

@rvagg at peerconf last year you mentioned your were doing some android build magic. Do you have anything to drop into this?

FYI other people are starting to look at node-android and they are looking for dbs.
https://groups.google.com/forum/#!topic/Nodejs/36gLW3O_394

@ralphtheninja
Copy link
Member

Cool. With the 'prebuilt' stuff, do you mean squeezing it into the android distribution?

@mafintosh
Copy link
Member

@ralphtheninja similar to my leveldown-prebuilt fork for osx, windows etc where you do not need to compile leveldown for android yourself and instead just require a prebuilt-for-android version

@ralphtheninja
Copy link
Member

@mafintosh Gotcha. Thanks! :)

@yaronyg
Copy link

yaronyg commented Oct 14, 2014

I am also trying to do a pre-built on Linux and then copy it over to Android so I can run PouchDB. I use the config script from Node's Android support (see the previously mentioned nodejs/node-v0.x-archive#5514) to set up the compile environment and then I run 'npm install leveldown --arch=arm'. This starts to compile away until it hits env_posix.cc and then fails because of various file functions that aren't defined. Looking at env_posix.cc there is an ifdef for LEVELDB_PLATFORM_ANDROID which I'm going to guess contains what I need. But I'm not sure what the magic voodoo is that will result in me passing in something to 'npm install' that makes its way all the ways to the bowels of leveldb and sets that if-def. I can see in build_detect_platform that there is a magic value OS_ANDROID_CROSSCOMPILE. And yes, I did try to set TARGET_OS to OS_ANDROID_CROSSCOMPILE as an environment variable but that didn't work. I also tried to add:

                [
                    "OS=='android'",
                    {
                        "defines": [
                            "LEVELDB_PLATFORM_ANDROID"
                        ]
                    }
                ]

to binding.gyp (and passing --dest-os=android to npm install) as a work around but that didn't fix things either.

This smells to me like some kind of config issue and if I could just pass in the right magic flag then all would be well. Any idea what that flag is?

@yaronyg
Copy link

yaronyg commented Oct 15, 2014

Nobody?

@No9
Copy link
Contributor Author

No9 commented Oct 15, 2014

Thanks for the bump will take a look in a couple of hours and see if I can reproduce.

@yaronyg
Copy link

yaronyg commented Oct 15, 2014

You may also want to check out nodejs/node-gyp#515. Thanks!

@yaronyg
Copy link

yaronyg commented Oct 31, 2014

Bump again? Sorry to be a pain. I got pulled off this for a bit to try and figure out our node.js story all up but I'm now wanting to get back to working on this. Right now my focus is on the bug above, that is, figuring out how to get node-gyp to play with Android.

@ralphtheninja
Copy link
Member

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants