This isn't close to being ready- I'm just looking for ideas before I get too far
off into the weeds. It will build a *.pkg that does install, and both
hg version and hg debuginstall look healthy. As noted in the script though,
there are still references to /Library/Frameworks/Python.framework (which is the
python.org installed stuff), so it may not work on a fresh system.
At this point, I'm wondering if we should just curl the source for OpenSSL and
Python, and build the non-framework version with the destination set to the
proper directory. The packaging for thg does this (though it probably doesn't
have to), and it takes about 10 minutes on a Mac Mini. 5 Minutes of that is
running the tests on the python build, so maybe there's a way to shut that off.
As far as alternatives, I started down the path of using virtualenv here, and
shipping that. I'm skeptical of the experimental nature of --relocatable, and
grepping on the tree showed the build path in the *.pyc files. I have no idea
if that matters. I left pip in place so that things like evolve could be
installed, but it errored out when specifying --user. I didn't look into why.
I also looked at pyinstaller. I couldn't figure out how to convince it to
bundle the C extensions, and it appears to append its own output when the hg
script exits with a non zero value. I briefly looked at bbfreeze and cx_freeze,
but didn't get as far. I've had enough frustration with py2exe and py2app that
I'm not wanting to struggle with yet another packager.
Ultimately I think we should keep the target for building against system python
(there was some special functionality unlocked with a specifically crafted dummy
cert), and this should possibly be a different target. (I don't see a way to
switch between the two by simply overriding $PYTHON the way this is going.) I
basically copy/pasted the makefile as a starting point, but moved it into a
shell script so the environment could be activated. This either needs to be
moved to contrib/, or folded back into the makefile. I kinda lean towards the
former, and have that called by make. The readme in the installer will also
have to be conditionalize/updated, since it mentions relying on system python.
It would be nice to open up the range of supported platforms back to say, 10.9.