How to build macOS TortoiseHg?

51 views
Skip to first unread message

André Sintzoff

unread,
May 24, 2021, 10:54:04 AM5/24/21
to thg...@googlegroups.com
Hello,

I would like to build a macOS TortoiseHg application running on Apple
M1 processor instead of using the x64 application provided on
https://www.mercurial-scm.org/downloads
Is there any description corresponding to a recent build of x64 macOS
TortoiseHg application?

Long time ago, I used the process described on
https://foss.heptapod.net/mercurial/tortoisehg/thg/-/wikis/developers/MacOSX
but I'm wondering if it is still valid.

Thanks

André

Matt Harbison

unread,
May 24, 2021, 11:25:56 AM5/24/21
to TortoiseHg Developers
I'd ignore that.  I grabbed some scripts off of BitBucket early last year and put them into the thg repo at contrib/packaging/macos/build.sh to do the official builds.  All you need to do is to clone mercurial to `contrib/packaging/macos/src` (named `hg`), and thg there (named `thg`).  I simply created a symlink there to the top of the repo to avoid dealing with a 3rd repo.  Update to the tags you want in both, and running build.sh will download and build everything.

One caveat- last time I tried to update the Qt/PyQt packages used, the new stuff is missing.  IDR if they removed all of the old source tarballs too.  If so, I can put those source tarballs into a repo somewhere.  This is all py2 based.  I tried py3 with py2app a couple of times, and got different failures both times.  The current plan is for PyOxidizer to support Mac app bundles, and use that to build everything with py3.

André Sintzoff

unread,
May 24, 2021, 12:42:47 PM5/24/21
to thg...@googlegroups.com
Le lun. 24 mai 2021 à 17:25, 'Matt Harbison' via TortoiseHg Developers
<thg...@googlegroups.com> a écrit :
>
> I'd ignore that. I grabbed some scripts off of BitBucket early last year and put them into the thg repo at contrib/packaging/macos/build.sh to do the official builds. All you need to do is to clone mercurial to `contrib/packaging/macos/src` (named `hg`), and thg there (named `thg`). I simply created a symlink there to the top of the repo to avoid dealing with a 3rd repo. Update to the tags you want in both, and running build.sh will download and build everything.

Thanks for the scripts.

Unfortunately, building Python 2.7.17 from sources on Apple M1 seems
not supported unless I use Rosetta2 which I would like to avoid.


> One caveat- last time I tried to update the Qt/PyQt packages used, the new stuff is missing. IDR if they removed all of the old source tarballs too. If so, I can put those source tarballs into a repo somewhere. This is all py2 based. I tried py3 with py2app a couple of times, and got different failures both times. The current plan is for PyOxidizer to support Mac app bundles, and use that to build everything with py3.

I think it will be easier once py3 can be used to build.


> On Monday, May 24, 2021 at 10:54:04 AM UTC-4 André Sintzoff wrote:
>>
>> Hello,
>>
>> I would like to build a macOS TortoiseHg application running on Apple
>> M1 processor instead of using the x64 application provided on
>> https://www.mercurial-scm.org/downloads
>> Is there any description corresponding to a recent build of x64 macOS
>> TortoiseHg application?
>>
>> Long time ago, I used the process described on
>> https://foss.heptapod.net/mercurial/tortoisehg/thg/-/wikis/developers/MacOSX
>> but I'm wondering if it is still valid.
>>
>> Thanks
>>
>> André
>
> --
> You received this message because you are subscribed to the Google Groups "TortoiseHg Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to thg-dev+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/thg-dev/562e3b6a-9e2b-4eda-add6-18f77d650a3fn%40googlegroups.com.

Matt Harbison

unread,
May 24, 2021, 6:00:24 PM5/24/21
to TortoiseHg Developers
On Monday, May 24, 2021 at 12:42:47 PM UTC-4 André Sintzoff wrote:
Le lun. 24 mai 2021 à 17:25, 'Matt Harbison' via TortoiseHg Developers
<thg...@googlegroups.com> a écrit :
>
> I'd ignore that. I grabbed some scripts off of BitBucket early last year and put them into the thg repo at contrib/packaging/macos/build.sh to do the official builds. All you need to do is to clone mercurial to `contrib/packaging/macos/src` (named `hg`), and thg there (named `thg`). I simply created a symlink there to the top of the repo to avoid dealing with a 3rd repo. Update to the tags you want in both, and running build.sh will download and build everything.

Thanks for the scripts.

Unfortunately, building Python 2.7.17 from sources on Apple M1 seems
not supported unless I use Rosetta2 which I would like to avoid.

That's unfortunate, but not surprising I guess.  There are very recent issues on the python bug tracker that finally close out support for M1 systems.  IDK how hard it would be to apply them, but I suspect it isn't worth it at this point.

 

> One caveat- last time I tried to update the Qt/PyQt packages used, the new stuff is missing. IDR if they removed all of the old source tarballs too. If so, I can put those source tarballs into a repo somewhere. This is all py2 based. I tried py3 with py2app a couple of times, and got different failures both times. The current plan is for PyOxidizer to support Mac app bundles, and use that to build everything with py3.

I think it will be easier once py3 can be used to build.

Definitely.  If you don't need the app bundle support for now, you create a py3 venv and then install all of the Qt/PyQt stuff via contrib/packaging/venv_py3/requirements.txt in the thg repo.  Some of the stuff is no longer the latest, so you might want to look at the *.in file to see what needs to be installed.  Then just run `python3 thg --nofork` from the thg repo root.
 

Steve Borho

unread,
Jun 28, 2021, 5:08:27 PM6/28/21
to thg...@googlegroups.com
I’ve actually done this in the last month or so. Recalling from memory, this was:

brew install qt@5

Add this qt bin folder to your path, then do these steps in series:

<optional>
python3 -m venv thgenv
source thgenv/bin/activate
</optional>

pip install PyQt-builder sip
pip install PyQt5==5.15.2
pip install QScintilla==2.12.0

It will build the last two from source. The M1 is quite peppy so it doesn’t take an extraordinary amount of time. In the end you should have a functional python3 based thg


Steve Borho
st...@borho.org
> --
> You received this message because you are subscribed to the Google Groups "TortoiseHg Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to thg-dev+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/thg-dev/7a4708f3-a288-4e17-aaac-13e332c3ace9n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages