Hello, everyone,
This weekend I played with compiling netsurf-gtk for Mac OS X 10.9.4 with libraries supplied by MacPorts. Ultimately, I would like to create a Portfile (MacPorts package) of netsurf-gtk since as you know might know, the Carbon framework (on which netsurf-cocoa relies) has been deprecated since Mac OS X 10.8.
I followed the QUICKSTART compilation instructions, which mostly worked. The purpose of the attached patches is to ensure that they work completely.
buildsystem.patch solves the issue of toolchain detection on Mac OS X. The reported first line of cc --version is "Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)", of which neither the first nor the second word are clang, which is what current toolchain autodetection does. The patch does autodetection of clang by looking for "clang" as a substring of the first line cc --version rather than as a first or second word.
libnsfb.patch solves the issue of endian.h being located in machine/endian.h. Currently, the two files 32bpp-xbgr8888.c and 32bpp-xgbr8888.c both include "endian.h" unless the platform is win32. The patch adds a futher check on whether the platform is Apple, in which case it includes machine/endian.h and defines the appropriate macros. Curiously, patches of this sort for nsfb were submitted three years ago by Sven Weidauer (http://vlists.pepperfish.net/pipermail/netsurf-dev-netsurf-browser.org/2011-January/002300.html).
Now, I had to compile libparserutils without iconv because I guess the macports iconv library seems to break the compilation of netsurf_gtk (clang compalins about undefined symbols). Overall, compilation of the libraries is successful except for some self-defined warnings.
For compiling netsurf-gtk, in addition to installing the necessary libraries for macports (I use gtk2 with quartz support rather thatn X) I also had to edit the jsapi.c include from "js/jsapi.h" to "mozjs185/jsapi.h" because for some reason that's where the spidermonkey185 library is in MacPorts. Also, I added CFLAGS+=-D_DARWIN_C_SOURCE to make sure the compilation goes correctly (apparently Sven also had patches to make sure this is included automatically, for framebuffer at least). Since these are merely configuration and a quirk of MacPorts, I decided these did not need their own patches.
Anyway, I was able to compile netsurf-gtk with the above settings, but this led to strange compilation errors for files that aren't really really missing. I've attached the logs.
Also, the resulting binary runs, but realizes bug #2120, as well as a possibly new bug where the mouse cursor does not change on hover events.
All the best; let me know if you'd like more info from me.
--Vladimir Sotirov