I came across the two modules in $SUBJECT as part of jQuery packaging.
Both bundle code that is part of node core as of v0.10, so they're
not permitted in Fedora due to our bundled library policy. Luckily,
both are easy to work around.
For string_decoder, you just need to '%nodejs_fixdep -r
string_decoder'. Core presents exactly the same interface in exactly
the same module name so no patches are needed.
For readable-stream, it's a bit trickier. The old module split the
different classes into seperate files. The core module makes all the
classes available in one file. Additionaly the core module is called
"stream", not "readable-stream".
If you're lucky (as I was with nodejs-lazystream for the most part),
upstream will only use the module as a fallback, e.g.:
var readable = require('stream').Readable || require('readable-stream/readable')
In this case, you ought to be able to just '%nodejs_fixdep -r
readable-stream' and things will just work. If you're not so lucky,
you will need to patch require() calls thusly:
- var readable = require('readable-stream/readable')
+ var readable = require('stream').Readable
- var writable = require('readable-stream/writable')
+ var writable = require('stream').Writable
and lather, rinse, repeat for any other classes. Don't forget to
'%nodejs_fixdep -r readable-stream' here also.
I've pushed a few new nodejs-packaging features to an "experimental"
branch in the git repository:
The changes include:
- %nodejs_fixdep now supports a --dev argument to affect devDependencies
This is used by the jquery review I recently filed to drop
dependencies on the nonfree jshint library.
- %nodejs_fixdep also supports an --optional argument to affect
I added this for completeness' sake. We currently don't do anything
with optionalDependencies. If the plans for soft dependencies come to
fruition and they support automatic population like normal Requires
then we'll probably start doing something with these, but for now we
- %nodejs_symlink_deps now supports a --force argument
This argument overrides failing the build when bundled dependencies
are encountered in node_modules. This can be used during development
to allow you to mix system-provided and npm-provided modules. It
should _never_ be used in an official Fedora package.
- %nodejs_symlink_deps now supports --build as an alias for --check
This switch more accurately reflects what it does (i.e. it works in
the build directory not the buildroot directory) and doesn't look so
weird in %build sections. ;-)
And finally, the biggie:
- Support for the caret (^) operator was added to the dependency generator.
This has been supported in npm for about a year now, but the
dependency generator never knew about it. It also hasn't really
gained traction in the wild till very recently. (old npm versions that
don't support it are slowly dying out...)
The semantics of this new operator are described in detail here:
Basically, ^1.2.3 is the equivalent of ">1.2.3 <2". This is much
better for our purposes than the "~1.2.3" form used by many packages,
which translates to ">1.2.3 <1.3". Undoubtedly many of us will want
to start using it in %nodejs_fixdep for certain recalcitrant packages.
Testing builds of the new nodejs-packaging are available from this copr:
Please try it out and let me know if there's anything broken, any more
improvements you've just been dying to have, etc.
The core runtime and its dependencies are now built for EPEL7, as is
The libraries and npm are next. If you own a package that is present
in EPEL6, expect me to bug you for permission to branch and build for
EPEL7 in the coming weeks. ;-)