-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M1 build fixes #148
base: master
Are you sure you want to change the base?
M1 build fixes #148
Conversation
With the changes in this PR, meld builds successfully on M1 for me! A built dmg can be found here: https://uofi.box.com/s/o2ci9nk9qit9jatv3pzjv3dybbp94dqr |
osx/jhbuildrc-custom
Outdated
@@ -101,14 +101,14 @@ module_autogenargs['tango-icon-theme'] ='--disable-nls --disable-icon-frami | |||
module_autogenargs['harfbuzz'] = '--disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --with-coretext --without-icu '# + autogenargs | |||
module_autogenargs['root-harfbuzz'] = '--disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --with-coretext --without-icu '# + autogenargs | |||
module_autogenargs['fontconfig'] = '--with-cache-dir="~/Library/Caches/org.gnome.meld.fontconfig" --with-default-fonts=/System/Library/Fonts --with-add-fonts=/Library/Fonts,/Network/Library/Fonts,/System/Library/Fonts --disable-cache-build --disable-docs --disable-dependency-tracking' | |||
#module_autogenargs['python3'] = '--enable-optimizations --disable-ipv6 --with-ensurepip=yes --with-system-expat --without-readline --with-pkg-config --disable-test-modules ' | |||
module_autogenargs['python3'] = '--enable-optimizations --disable-ipv6 --with-ensurepip=yes --with-system-expat --without-readline --with-pkg-config --disable-test-modules --with-openssl=/opt/homebrew/opt/openssl@3/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one will tie us to homebrew being installed at run-time. While the adjustment for paths during compile time are fine, we can't assume that homebrew is installed. It's better not to build support for SSL in python altogether since Meld won't need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but without this line, Python will not have SSL support (it only looks in /usr
... by default). Without SSL support, installation fails later in build_app.sh
:
*** using recipe: setuptools *** {'expected_missing_imports': {'pkg_resources.extern.packaging._manylinux', 'pkg_resources.extern.jaraco.context', 'pkg_resources.extern.importlib_resources._itertools', 'pkg_resources.extern.jaraco', 'pkg_resources.extern.importlib_resources.abc', 'pkg_resources.extern.packaging.specifiers', 'pkg_resources.extern.importlib_resources', 'pkg_resources.extern.platformdirs', 'pkg_resources.extern.jaraco.functools', 'pkg_resources.extern.platformdirs.unix', 'pkg_resources.extern.packaging.markers', 'pkg_resources.extern.platformdirs.version', 'pkg_resources.extern.packaging._elffile', 'pkg_resources.extern.packaging.metadata', 'pkg_resources.extern.more_itertools.recipes', 'pkg_resources.extern.packaging', 'pkg_resources.extern.more_itertools', 'pkg_resources.extern.typing_extensions', 'pkg_resources.extern.importlib_resources._legacy', 'pkg_resources.extern.more_itertools.more', 'pkg_resources.extern.packaging._structures', 'pkg_resources.extern.zipp', 'pkg_resources.extern.importlib_resources._compat', 'pkg_resources.extern.packaging.tags', 'pkg_resources.extern.platformdirs.__main__', 'pkg_resources.extern.packaging.utils', 'pkg_resources.extern.platformdirs.macos', 'pkg_resources.extern.packaging.requirements', 'pkg_resources.extern.jaraco.text', '__builtin__', 'pkg_resources.extern.platformdirs.android', 'pkg_resources.extern.importlib_resources.readers', 'pkg_resources.extern.packaging._musllinux', 'pkg_resources.extern.packaging._parser', 'pkg_resources.extern.platformdirs.windows', 'pkg_resources.extern.importlib_resources._adapters', 'pkg_resources.extern.platformdirs.api', 'pkg_resources.extern.importlib_resources.simple', '__main__.__requires__', 'pkg_resources.extern.packaging.version', 'pkg_resources.extern.packaging._tokenizer', 'pkg_resources.extern.importlib_resources._common'}, 'prescripts': [<_io.StringIO object at 0x1079369e0>]}
--- Skipping recipe PIL ---
--- Skipping recipe autopackages ---
--- Skipping recipe black ---
--- Skipping recipe gcloud ---
--- Skipping recipe lxml ---
--- Skipping recipe matplotlib ---
--- Skipping recipe opencv ---
--- Skipping recipe pandas ---
*** using recipe: platformdirs *** {'includes': ['platformdirs.macos']}
--- Skipping recipe PIL ---
--- Skipping recipe autopackages ---
--- Skipping recipe black ---
--- Skipping recipe gcloud ---
--- Skipping recipe lxml ---
--- Skipping recipe matplotlib ---
--- Skipping recipe opencv ---
--- Skipping recipe pandas ---
--- Skipping recipe pydantic ---
--- Skipping recipe pyenchant ---
--- Skipping recipe pygame ---
--- Skipping recipe pylsp ---
--- Skipping recipe pyopengl ---
--- Skipping recipe pyside ---
--- Skipping recipe pyside2 ---
--- Skipping recipe pyside6 ---
--- Skipping recipe qt5 ---
--- Skipping recipe qt6 ---
--- Skipping recipe rtree ---
--- Skipping recipe shiboken2 ---
--- Skipping recipe shiboken6 ---
--- Skipping recipe sip ---
--- Skipping recipe six ---
--- Skipping recipe sphinx ---
--- Skipping recipe sqlalchemy ---
Traceback (most recent call last):
File "/Users/mdiener/Work/meld/setup_py2app.py", line 82, in <module>
setup(
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
super().run_command(command)
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/py2app/build_app.py", line 984, in run
self._run()
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/py2app/build_app.py", line 1214, in _run
self.run_normal()
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/py2app/build_app.py", line 1311, in run_normal
self.process_recipes(mf, filters, flatpackages, loader_files)
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/py2app/build_app.py", line 1160, in process_recipes
rval = check(self, mf)
^^^^^^^^^^^^^^^
File "/Users/mdiener/gtk/inst/lib/python3.11/site-packages/py2app/recipes/sslmod.py", line 26, in check
import ssl
File "/Users/mdiener/gtk/inst/lib/python3.11/ssl.py", line 100, in <module>
import _ssl # if we can't import it, let the error propagate
^^^^^^^^^^^
ModuleNotFoundError: No module named '_ssl'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Humm.. Will probably need py2app to skip the ssl module.
This can probably be done here: https://github.com/yousseb/meld/blob/master/setup_py2app.py#L119
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that seems to work, although it is a bit hard to tell cause starting from a fresh environment is difficult...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be ok, but I'll probably have to have different file setup.cfg.in
and generate the file during build for m1&x64. Maybe even skip this altogether and use py2app's arg from command line for arch.
@@ -1,6 +1,6 @@ | |||
[py2app] | |||
app = ['bin/meld'] | |||
arch = x86_64 | |||
arch = universal2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me know if this works. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it works! universal2
works, universal
does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Thank you very much for doing this.
this version always asks me for permission to access the files every time it compares a folder |
getting this on M2
|
Thanks for build @matthiasdiener. |
This build works great on my M2 machine! Just had to run |
The dmg seems to depend on some libraries from homebrew.
|
Echoing what @fadeopolis posted, though in my case homebrew IS installed, but the paths are not standard on my system due to having an installation that I've just kept nursing since my user was on an x86_64 CPU... $ ll /usr/local/opt/libpng*
lrwxr-xr-x 1 x x 23 Nov 20 10:53 /usr/local/opt/libpng@ -> ../Cellar/libpng/1.6.40
$ ll /opt/homebrew/opt
total 0
drwxrwxr-x 2 x x 64 Jan 6 2022 ./
drwxr-xr-x 32 x x 1024 Jan 6 2022 ../ Edit: Re-installing homebrew and then installing |
This solution work for me! And, for what I see, to a lot of other people, |
It doesn't work on my M3 machine.I need to find an alternative solution. |
It does not work on my MacBookPro running Sonoma. |
Seems like there's a path problem while importing libraries. It looks for It looks for them in So I did a couple of soft links and it started working:
Substitute YOURPATH for the path to Meld location. |
Funciona en M1 con Sonoma 14.1.2 (23B92) Muchas gracias. |
Update: The best solution at the moment is described in a gist linked from #151 (comment). It involves installing a prerelease (not the homebrew nor the Nix version) and running a couple of commands to patch it. I wanted to share a couple of imperfect workarounds, adding on to the workaround in #148 (comment) (that I haven't tried). The Nix As another option, you can run XQuartz and lima, and install the Linux version of meld inside the VM ( ssh:
forwardX11: true I think I got it to work, if a bit slowly. The QEMU emulation is better for graphical acceleration. I'm not sure whether there are additional necessary steps I forgot; I might update this post if I remember something. |
This version works successfully for me on my M1 Mac. The version available from brew, as well as the most recent version available for download on this repo only showed the title bar for me. |
@matthiasdiener is your PR still running? I just downloaded the provided PR from your box, but I get a Launch Error ? |
It runs fine for me, what is the error you get? |
I've seen similar-looking errors when I used the system-installed python on Mac OS instead of the homebrew python. |
I run 3.12.3 from brew... |
this is the terminal output: ** (process:11394): WARNING **: 15:21:27.844: Failed to load shared library '@executable_path/../Frameworks/libpango-1.0.0.dylib' referenced by the typelib: dlopen(@executable_path/../Frameworks/libpango-1.0.0.dylib, 0x0009): Library not loaded: /opt/homebrew/opt/libpng/lib/libpng16.16.dylib |
Any update on this? Would be super useful to have an M1 release! And also bring it into line with the upstream GNOME version. |
No description provided.