On Thu, Feb 7, 2013 at 7:57 PM, mscdex <msc...@gmail.com> wrote:
> On Feb 7, 8:41 pm, Kevin Baker <kba...@gmail.com> wrote:
>
> FWIW I have a gypified version that also works on node 0.9.4+ and
> Windows, with FTS support here: https://github.com/mscdex/node-sqlite-fts
>
Wow, thanks for the updated version! That version compiles and builds
as well, and it seems to work!

I believe the OE build environment might be a bit too much for node &
node-gyp... To get it to build, I needed to do this:
    (warning, lots of long hacky stuff follows, if I get time to
submit a nice version to OE I will clean this up and post tickets
where applicable)

- upgrade to node 0.8.19, which fixed:
    - needing to install gyp natively and patch node-gyp to use it
instead... now it finds node-gyp's version of gyp correctly.
- deploying my own 'node-gyp' binary to <sysroot>/usr/bin that fixes
the directory location (I moved it out of node's dir so it would be
picked up by the PATH, this is more of an issue with my OE packaging)
- remove ~/.node/version/common.gypi (OK, replaced with { } since
node-gyp freaks out without that file) as it was adding -m64,
    side note: when cross-compiling stuff with OE there can't be any
reliance on anything in the host build environent.
    The idea is that the builds are always repeatable from scratch, so
changing settings in the home dir shouldn't be possible.
    Feature request: There should be a way to disable using the node
homedir in a future node-gyp.
- add LD=$(CXX) as somehow gyp picks LD=ld instead of figuring out
when to use CCLD or CXX.
    I'm not entirely sure of what's happening behind the scenes with
gyp here, but I had to do the same trick to get chromium's gyp
cross-compiling with OE.
- add CXXFLAGS="$(CXXFLAGS) -fPIC" and CFLAGS="$(CFLAGS) -fPIC" - the
link step was complaining that it needed these.

After all of that, I get a binary sqlite3_bindings.node! But, when I
require it, I ran into a similar issue to:
https://github.com/joyent/node/issues/3623

> require('./sqlite3_bindings.node');
node: symbol lookup error: /home/root/sqlite3_bindings.node: undefined
symbol: _ZN2v811HandleScopeC1Ev

This was caused by the initial OE recipe I started with:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded/54923
that took out -rdynamic. Since the LD=CXX trick works around this, I
removed it. So, rebuilding it all... and reinstalling it on the target
platform:

> require('./sqlite3-fts.node');
{ Database: [Function: Database],
  EXEC_EMPTY: 0,
  EXEC_LAST_INSERT_ID: 1,
  EXEC_AFFECTED_ROWS: 2 }

Success!!! Now to test with some working code, as the documentation
for using this driver is quite out of date... (there is no execute
anymore on the driver)?

Thanks!
Kevin

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to