Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#18895 closed defect (fixed)

spidermonkey: UTF-8 Support

Reported by: ruediger@… Owned by: mf2k (Frank Schima)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: javascript, utf8, spidermonkey, flusspferd Cc: mf2k (Frank Schima)
Port: spidermonkey

Description

I'm trying to create a macport file for the Flusspferd JavaScript library which depends on spidermonkey having UTF-8 support. Unfortunately spidermonkey is build without UTF-8 support and there is no variant to do so.

To build spidermonkey with UTF-8 support you have to set DEFINES to -DJS_C_STRINGS_ARE_UTF8

so something along those lines should do it:

variant utf8 description {add UTF-8 support} {
  build.args-append \
  DEFINES=-DJS_C_STRINGS_ARE_UTF8
}

Change History (13)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to akitada@…

comment:2 Changed 15 years ago by mf2k (Frank Schima)

Is there any reason not to always build it with UTF-8 support?

comment:3 Changed 15 years ago by ruediger@…

Is there any reason not to always build it with UTF-8 support?

Non that I could think of.

comment:4 Changed 15 years ago by mf2k (Frank Schima)

Cc: macsforever2000@… added

Cc Me!

comment:5 Changed 15 years ago by ruediger@…

Is there any hope on getting this fixed?

comment:6 Changed 15 years ago by mf2k (Frank Schima)

Owner: changed from akitada@… to macsforever2000@…
Status: newassigned

Maintainer timeout.

comment:7 Changed 15 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: assignedclosed

Committed revision r48945.

comment:8 Changed 15 years ago by mf2k (Frank Schima)

To be clear, I added UTF-8 support without a variant.

comment:9 Changed 15 years ago by ruediger@…

Sorry the Patch doesn't seem to work. You can check if spidermonkey supports UTF-8 with the following Code

#include <js/jsapi.h>
#include <stdio.h>
int main() {
  if(JS_CStringsAreUTF8())
    puts("Spidermonkey supports UTF8");
  else
    puts("no UTF8 support");
}

gcc -pedantic -Wall -W -std=c99 -g3 testutf8.c -I/opt/local/include -L/opt/local/lib -ljs -DXP_UNIX

Maybe a better way would be to add the -DJS_C_STRINGS_ARE_UTF8 to the OS_CFLAGS on line 13 in source:trunk/dports/lang/spidermonkey/files/patch-config-Darwin.mk (if the patch is still applied)

Building Spidermonkey can be quite a pain in the ass :(.

comment:10 Changed 15 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: closedreopened

comment:11 Changed 15 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: reopenedclosed

Committed revision r49070. This works for me. Thanks!

comment:12 Changed 15 years ago by ruediger@…

Works for me, too. Thank you!

comment:13 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.