Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277697 - dev-lang/spidermonkey add UTF-8 support
Summary: dev-lang/spidermonkey add UTF-8 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alexis Ballier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 273259
  Show dependency tree
 
Reported: 2009-07-13 19:09 UTC by Wendall Cada
Modified: 2010-03-07 22:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
spidermonkey-1.7.0 with utf-8 support (spidermonkey-1.7.0-r1.ebuild,1.58 KB, text/plain)
2009-07-13 19:10 UTC, Wendall Cada
Details
UTF-8 patch (spidermonkey-1.7.0-nls.diff,315 bytes, text/plain)
2009-07-13 19:10 UTC, Wendall Cada
Details
Simpler method of enabling UTF8 strings (spidermonkey-1.7.0-r1.ebuild,1.38 KB, text/plain)
2010-02-19 04:22 UTC, Brandon Bergren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wendall Cada 2009-07-13 19:09:25 UTC
spidermonkey is built without UTF-8 support by default. Here is a new ebuild and patch to add support to the existing spidermonkey-1.7.0 ebuild.

Reproducible: Always
Comment 1 Wendall Cada 2009-07-13 19:10:17 UTC
Created attachment 197829 [details]
spidermonkey-1.7.0 with utf-8 support
Comment 2 Wendall Cada 2009-07-13 19:10:59 UTC
Created attachment 197831 [details]
UTF-8 patch
Comment 3 Alexis Ballier gentoo-dev 2009-08-08 08:56:51 UTC
Hmm why do you use the nls useflag? Shouldnt it be unicode?
What about a simpler change like:
use unicode && append-cppflags -DJS_C_STRINGS_ARE_UTF8 ?
Does it work for you?
Comment 4 Wendall Cada 2009-08-10 05:34:47 UTC
Thanks for the feedback. 

Sorry about the wrong approach with this ebuild. With a severe lack of consistency, and readable documentation, I'm not ever sure what the latest trend in ebuilds is. Numerous packages in the tree use nls as the use flag for utf8 support. I will change to unicode. I've never seen the append-cppflags ... glad to know it exists.

Also, can you cite where I might read on what the current use flag policy is? And if it isn't too much trouble, why other gentoo devs don't follow the policy? I would be more likely to provide higher quality patches and more ebuilds if there was a clear expectation of what I should provide, and actual documentation for classes with valid working examples.

In the past, I would have just asked for utf-8 support to be added, and expect that it had a good chance of happening. Now, I do it myself, provide what I did and wait for someone to maybe add the functionality. I find it frustrating and disappointing to just to get feedback about how I did it wrong. Maybe the better approach would be to fix all the multitudes of incorrectly written ebuilds in the tree so I had good working examples to begin with.

I know I'll never make it into your private club, but I do use Gentoo, and would like to contribute if that's even possible currently.
Comment 5 Alexis Ballier gentoo-dev 2009-08-10 05:56:07 UTC
(In reply to comment #4)
> Sorry about the wrong approach with this ebuild. With a severe lack of
> consistency, and readable documentation, I'm not ever sure what the latest
> trend in ebuilds is. Numerous packages in the tree use nls as the use flag for
> utf8 support. I will change to unicode. 

There is no absolute rule, have a look at profiles/use.desc:
nls - Adds Native Language Support (using gettext - GNU locale utilities)
unicode - Adds support for Unicode

For me the change you propose adds unicode support and is not about adding translation support. Packages using nls only for unicode support is probably a poorly chosen useflag.

> I've never seen the append-cppflags ...
> glad to know it exists.

Its in flag-o-matic eclass; you can emerge eclass-manpages and use 'man flag-o-matic.eclass'. After testing it's probably better to use 'append-flags' instead of 'append-cppflags' (the former should work while the latter doesn't appear to).

> Also, can you cite where I might read on what the current use flag policy is?

I don't know where its written but for me it's the implicit common sense policy: 'choose the one that fits best for what it does' :)

> And if it isn't too much trouble, why other gentoo devs don't follow the
> policy? 

Heh, don't ask me :) I suppose poorly chosen useflag names are bugs that should be reported. Wrt nls vs unicode, be sure it is really unicode only and not 'nls and unicode' support that is added to the package.

> In the past, I would have just asked for utf-8 support to be added, and expect
> that it had a good chance of happening. Now, I do it myself, provide what I did
> and wait for someone to maybe add the functionality. I find it frustrating and
> disappointing to just to get feedback about how I did it wrong. 

Don't be disappointed, the idea here is more educationnal than anything else: You provide patches, people review it, give feedback on how it could be improved, you improve it and then its merged as is. From a one time commit perspective I could have changed it myself and committed it but you wouldn't have known about the append-flags stuff for example. Next time there may or may not be comments about your contributions, and maybe some day you'll be bored of having to wait on devs to review your changes, make the step and start becoming a dev yourself, with all what you'll have learned the recruiting quizzes will be easy and voila!
Comment 6 Brandon Bergren 2010-02-19 04:20:51 UTC
The suggestions in #3 do work, there's no need to patch the makefile.

Also, no need to depend on libintl, all the define is doing here is changing some of the string handling routines to support UTF-8 sequences.

Relevant upstream discussion about this define:
https://bugzilla.mozilla.org/show_bug.cgi?id=397215
Comment 7 Brandon Bergren 2010-02-19 04:22:06 UTC
Created attachment 220263 [details]
Simpler method of enabling UTF8 strings
Comment 8 Lance Albertson (RETIRED) gentoo-dev 2010-03-07 22:10:07 UTC
Any update on this bug? I'd like to add mongodb in #273259 but I need this bug fixed first. I can go ahead and make the change if I don't hear back from you in a few weeks.

Thanks!
Comment 9 Lance Albertson (RETIRED) gentoo-dev 2010-03-07 22:42:02 UTC
*spidermonkey-1.7.0-r1 (07 Mar 2010)

  07 Mar 2010; Lance Albertson <ramereth@gentoo.org>
  +spidermonkey-1.7.0-r1.ebuild:
  Add unicode support fixing #277697

Going ahead and fixing it myself per the request from aballier via IRC.