[Tor-BSD] Porting Tor Browser to the BSDs

attila attila at stalphonsos.com
Fri Feb 27 19:43:15 EST 2015

Hash: SHA384

[Libertas: I apologize for the double response to you and the
 stupid use of the wrong email account; please direct any
 tor-bsd related replies to me to attila at stalphonsos.com, Thx -A]

Libertas <libertas at mykolab.com> writes:

> On 02/25/2015 10:24 PM, George Rosamond wrote:
>> Not sure why this thread died, after someone who's been working on this
>> for a while replies...
> I think it's just because no one in the discussion has prior Mozilla
> development experience. There seems to be a massive amount of background
> knowledge necessary to do anything of substance with it. I'd like to
> contribute, but I very much doubt I have the time to even get enough
> background to be able to start.

Assuming you know C++, python, perl, sh, GNU and BSD make, have
reasonably deep Unix knowledge and experience with complex (or perhaps
just complicated) build systems and never, ever quail at the fury of a
gail you're pretty much good to go :-) It also doesn't hurt to know
JS, although more for understanding the intention behind and
implementation of certain of the tor-browser additions, but that's not
really necessary to build it, just to fear it properly.

As it turns out I do have some extremely old, outdated mozilla
experience and this has served me well so far as it goes... also I am
still learning the OpenBSD ports system (thanks to bcallah answering
my questions), but that at least is well-documented and relatively
easy to get your head around.  Nonetheless what this really comes down
to is just

My approach to getting the first cut of this done has been to ride on
the work of others as much as possible.  The www/firefox-esr port is
already there and rests upon the www/mozilla module, so my idea was to
start with www/firefox-esr and create a www/tor-browser port that adds
the deltas between tor-browser and the same version of firefox-esr
supported by the port (31.4 at the moment and I see I might already be
behind), since tor-browser is theoretically a set of mods against
firefox-esr.  To accomplish this I wrote a perl script to more or less
automatically populate the patches/ subdir of my new port from the
diffs between firefox-esr and tor-browser source trees and hacked on
the www/tor-browser port Makefile to accomodate a couple things I had
to do.  This perhaps is not the best approach moving forward but it
was the simplest to get things going.

Beyond a bit of Perl hacking most of what I've done at this point
really has been diagnosing errors kicked out from various phases of
the build process and sussing out a fix that I can shoe-horn into the

I have patched things together to the point where I have "make build"
cooking under i386-current... yes, i386.  My only working -current box
is on a fairly crapoid laptop.  How crappy?  I'm ~30 hours in to "make
build"... judging from where it is I estimate I'm more than half way
done but given the insane complexity of firefox's build system I might
be a little off.  I'm hesitating posting something until I at least
get things tripping through a build on a single arch.  I'm also
migrating my (much more powerful) main box to amd64-current which
should speed things up a bit and give me a second arch (albeit not the
most interesting one) for testing.

As I said above my approach to the port in general is a bit crazed but
it has gotten me this far fairly quickly.  In the meantime I'm
studying the ports system and looking at various other options for
doing this without so many patches (there are roughly 500 with this
approach, counting both patches and new files as the same thing).
When I have intelligent questions to ask bcallah will be the first to

> Someone please correct me if I'm wrong, and share sources for learning
> or tasks you think a Mozilla outsider could comprehend.

It is true that this whole stack of crapola has gotten way, way, WAY
out of hand over the decades but the Mozilla people have not done a
terrible job of providing reasonable developer docs, at least for
newer things.  I found <https://developer.mozilla.org/en-US/docs/Mozilla_Source_Code_Directory_Structure> pretty helpful for starters, and it
links to a lot of useful stuff... also a lot of skeletal/ancient/dead
stuff, as per ancient F/OSS custom.

It seems to me that more recent content on MDN is better than older
stuff, but maybe I just haven't read enough yet.  The newer
Python-based tools are better-documented than older stuff.  Their JS
fu is also pretty well-documented, and I've even learned a few things
about where JS is going, like this:

I've been hacking in JS for a long time and I had not heard of that
addition, which apparently is in ECMAScript 6 (the next version) and
which is only supported in mozilla at the moment.  I learned this by
staring at tor-browser JS and not understand WTF they were doing.
This, to me, is one of the benefits of doing this work: see what the
cool kids are up to.  Good hackers read more code than they write,
after all.

As far as tasks are concerned I'm afraid I don't see how else to get
at least the initial port out but in a wholistic,
wrestle-to-the-ground kind of way.  Once that milestone is reached
then it is time to stop and assess where to go and then there will
probably a way to split things up if anyone is interested in pitching
in.  As I've said my focus is on getting this to work under OpenBSD; I
don't think I've really gotten to the hard parts yet so I don't know
how much of what I've done is relevant to other BSDs, and I don't
really run firefox on anything but an OpenBSD box, but I am certainly
interested in helping ensure that end-users can use Tor sitting in
front of BSD machines of any flavor.  Anyone who is deep in the ports
system of another BSD that wants to kibbitz/kvetch about it can find
me in #nycbug.

More as it develops.

Pax, -A
- --
attila at stalphonsos.com | http://trac.haqistan.net/~attila
Version: GnuPG v1


More information about the Tor-BSD mailing list