Xpra-org / gtk-osx-build

Build setup to help building the Mac OS X port of GTK+
http://gtk-osx.sourceforge.net/
0 stars 2 forks source link

building on arm64 #28

Closed totaam closed 1 year ago

totaam commented 1 year ago

Following https://github.com/Xpra-org/xpra/blob/master/docs/Build/MacOS.md

Running the gtk-osx-setup.sh setup script, Python 3.10.10 complained that:

WARNING: The Python lzma extension was not compiled. Missing the lzma lib?

Perhaps this will cause problems later?

Then:

$ jhbuild 
Killed: 9
$ which jhbuild 
/Users/totaam/.new_local/bin//jhbuild
$ bash -x  /Users/totaam/.new_local/bin//jhbuild bootstrap-gtk-osx
...

Eh!

bootstrapping:

*** Configuring xz *** [1/15]
(..)
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/totaam/.cache/jhbuild/build/xz-5.2.5':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

Because we need to set arm64 in .jhbuildrc-custom.

zlib complained about not finding ninja, pip3.10 install ninja fixed that - but perhaps not the location we should be using..

Then this more obscure one on libxml2:

17 warnings generated.
  CCLD     libxml2mod.la
Undefined symbols for architecture arm64:
  "_PyBool_Type", referenced from:
      _libxml_xmlXPathObjectPtrConvert in types.o
  "_PyBytes_AsString", referenced from:
      _xmlPythonFileReadRaw in libxml.o
      _xmlPythonFileRead in libxml.o
      _PystringSet_Convert in libxml.o
  "_PyBytes_Size", referenced from:
      _xmlPythonFileReadRaw in libxml.o
      _xmlPythonFileRead in libxml.o
(..)
  "__Py_TrueStruct", referenced from:
      _libxml_xmlXPathObjectPtrConvert in types.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
totaam commented 1 year ago

Fixes this one by adding -lpython3.10 to LDFLAGS, inspiration came from https://bugs.gentoo.org/758473

totaam commented 1 year ago
totaam commented 1 year ago

The bash issue is a "security" feature, just use /bin/bash instead.

totaam commented 1 year ago

cc0cab3e59cae373ab8ca04d495cd67eb3d86a1b pulls updates from upstream and saves the need for a lot of the workarounds. But we still have some new / unfixed ones:

totaam commented 1 year ago

After merging all the changes from upstream in cc0cab3e59cae373ab8ca04d495cd67eb3d86a1b, arm64 builds seem to work OK.

totaam commented 1 year ago

For testing the arm64 builds on the build system, this may be useful: How to enable OS X screen sharing (VNC) through SSH?

totaam commented 1 year ago

We no longer have to override arch=arm64: 99d2ed1ef210cdd3a6ea23cb5775fffc89b82abe

And the minimum MacOS version is now 12: 7dd24486ea880fa942033430723c8c954e379c92