imyller / meta-nodejs

OpenEmbedded layer for latest Node.js releases
MIT License
79 stars 87 forks source link

feat(nodejs): create top level nodejs bbclass for shared methods #35

Closed mbroadst closed 8 years ago

mbroadst commented 8 years ago

@imyller I actually think there's another improvement to be made here. I had initially changed NPM_ARCH and NPM_ARCH_NATIVE in npm.bbclass to NPM_BUILD_ARCH and NPM_TARGET_ARCH respectively.

I think when you are running a normal npm you want:

LD="${NPM_LD}" ${NPM} --registry=${NPM_REGISTRY} --arch=${NPM_BUILD_ARCH} --target_arch=${NPM_TARGET_ARCH} ${NPM_FLAGS} "$@" || die "oe_runnpm failed"

and for native you want:

LD="${NPM_LD}" ${NPM} --registry=${NPM_REGISTRY} --arch=${NPM_BUILD_ARCH} --target_arch=${NPM_BUILD_ARCH} ${NPM_FLAGS} "$@" || die "oe_runnpm failed"

The only reason I didn't submit this change is because people might already be overriding NPM_ARCH and NPM_ARCH_NATIVE

mbroadst commented 8 years ago

@imyller thoughts about the last comment above?

imyller commented 8 years ago

@mbroadst btw. After merge I renamed nodejs.bbclass to nodejs-arch.bbclass because it felt bit too generic to introduce nodejs class just for internal helper function.

I'll comment on the NPM_*_ARCH in a sec.

imyller commented 8 years ago

@mbroadst

I think this is wrong:

--arch=${NPM_BUILD_ARCH} --target_arch=${NPM_TARGET_ARCH}

--arch and --target_arch should match.