Ultraviolet on FreeBSD
|
|
Not sure if its required in warehouse 1.1.2 and onwards, it might fall back to the javascript code highlighter if it can’t find ultraviolet. I’ve not checked. At any rate this is how you get ultraviolet highlighting to work on FreeBSD. Ultraviolet depends on Textpow which depends on the Oniguruma gem which only works with the Oniguruma library v5.9.0 or later. There is no devel/oniguruma5 port so things aren’t as easy as we are often used to. You really have two choices, you can either follow on or you can build oniguruma 5.9.0 with a prefix of `/usr/`. I personally prefer not messing up the FreeBSD file system hierarchy. First step is to download Oniguruma 5.9.0 from http://www.geocities.jp/kosako3/oniguruma/
then keep the directory around as you can `make clean` later to remove it if you wish. Now comes the more annoying part, I’ve tried every combination of setenv, export, inline define of CFLAGS and LDFLAGS I can think of to get the oniguruma gem to find oniguruma.h to no avail instead I had to manually patch part of the oniguruma gem then rebuild and install it.
this will fail but its alright we don’t mind. We’ll be fixing that momentarily…
this should extract a copy of oniguruma-1.1.0 into your present directory and changed into the ext directory of the gem. If this doesn’t unpack the gem into your current directory then you can do the following
Now we need to change the file extconf.rb to read as follows
This tells mkmf when it generates the makefile to look in /usr/local/include for the oniguruma header file. Now we can do the following to rebuild and install our patched version of the gem. Assuming you are still in the `ext/` directory
You can now install the textpow and ultraviolet gems
and you should be good to go with ultraviolet highlighting. |
|
|
Awesome. This was a lot more involved than installing it on OSX… We won’t make ultraviolet required, just a nice-to-have. Maybe when Ruby 1.9 is out and common we can do that (since the onigurama lib is bundled with 1.9 apparently). |
|
|
The only real issue with the stock gem is the lack of searching /usr/local/include for the oniguruma header file. I’m hoping Rails and family will be able to work pretty well with Ruby 2.0 when it finally hits us. Even then though I suspect we will still need the Oniguruma gem until either the Textpow gem is updated to use the system regex engine or someone writes a compatibility layer to go between system regex and the ORegexp stuff that Textpow wants. |