-
Notifications
You must be signed in to change notification settings - Fork 12
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
Building on M1 Mac ... #33
Comments
Hi, Which libraries are not being found? I dont have much experience using MAC and just did a really small test in homebrew but, I think, it seens to be working for you since the app is built (did you tested if it runs fine before bundle it?) For now, the best branch for mac is the macos branch because it has a few changes for macos (like changing GtkApplication for GtkOSXApplication and other small stuff). |
Hi, Here's a bit more detail ... Building on M1 mac, Macos 12.2 - tried to build using jhbuild but this rapidly turned into a nightmare due to this tool not being up to date ... so I'm using homebrew. I have built both lib3270 and libv3270 following the instructions. Some adjustments were needed to the generated Makefiles to add -I/opt/homebrew/include to CFLAGS and /opt/homebrew/lib to LIBS in both cases. There was also an issued around libintl.h which meant setting environment variables to prevent autopen.sh from throwing up. So far, so good. Then - using the macOS branch - try to make, adding gtk-mac-integration as I go ... and adding the include and lib path to the generated Makefile ... This ends up with a build. I then try to bundle (without bundling we end up with complaints about not finding libraries), and this fails as bundle is trying to copy the wrong schema. So fix and rebundle. Oh, and codesign! Then we can run the app - but by using the launcher.sh within the bundle. So, copy the libraries into the bundle (in Contents/Resources) and, after codesigning again, try launcher.sh. Here's what I get ...
So, now the application is starting, but is failing to initialise. I'm very, very rusty on gtk but will try to see what is happening. Any hints would be very helpful! |
Hi, By the messages seens to be having a lot of duplicated 'dynlib's. I think you're building the pw3270 application using 'make all' am I right? Can you try test using 'make Debug' and 'make run' to see if it runs? |
Hi, Found the cause for the error 'GLib-GObject invalid class cast from 'pw3270Application' to 'GtkApplication''. On Mac pw3270Application is a GTKOSXApplication, not a GtkApplication. Will look at this ASAP. |
Hi, Yes, I'm building with a simple "make all". Doing the "make Debug; make run", results in:
I think there's a couple of things going on here ...
I have tried to build on an x86 Mac earlier and the build process is cleaner than on an M1, but, as you spotted, ultimately the thing won't run because of the GTKOSXApplication/GtkApplication problem. I'm happy to look at the M1 problems - which seem to be much wider than the specific app issue around using GTKOSXApplication. I'll update you with specifics around the M1 stuff tomorrow. I'll also try the debug build/run on my x86 Mac too. |
On duplicated dynlibs ... this is because there is a copy in the bundle and in the /opt/homebrew/Cellar/... folder. It is odd that this is being complained about - probably an issue with the bundle script ? |
Hi, Adding some comments after the quotes...
It's not finding the libraries. Dont know how to do this on homebrew but, in jhbuild, the make run only works inside the 'jhbuild shell'
Already removed, it doesnt work anyway, I tried it to fix a problem with the top menu but, today I found this: https://stackoverflow.com/questions/67622779/cross-platform-gtk3-app-menu-bar-unresponsive-at-first and, maybe the problem doesn't happen when using a bundled application. With the code in the macos branch I was able to build and run the app using jhbuild. Not tested the top menu yet; will do it tomorrow.
|
Hi, The libraries thing was just a comment on test running per your instructions ! Of course I can see what is going on ... So, focussing on what is happening on the M1 build, I have a number of corrections to the
These flags need to be set for the build of lib3270, libv3270 and pw3270 - I set them before running autogen.sh ...
I have now built your latest macOS branches with the above and get a working binary ... although I would need to test it properly. Btw, binaries need to be signed to run on M1, so ...
I will give my version of Assuming that works, I will drop the changes over to you! |
So, I managed to figure out the LDFLAGS/CFLAGS issue to build 'lib3270' and 'libv3270', now I build 'pw3270' almost to the end, but the
This happens on both This is on macOS 12.3 on Apple Silicon. |
Describe the Bug
I'm having trouble building the App on an M1 Mac !
Expected Behavior
A working build :-)
System
MacOS 12.2
pw3270 - either master or macos branch
Hi, I am trying to build the app but am hitting problems in the build. I'm following the simple instructions.
I have already built and installed lib3270 and libv3270 seemingly successfully.
First, the link step of 'make all' fails because it cannot locate the lib320 / libv3270 libraries. I have fixed this by adding the paths into the Makefile, and end up with a build.
The real issue comes when trying to use "bundle" - first there are a bunch of warnings related to signatures being invalidated due to changes being made to the file - for example:
/Library/Developer/CommandLineTools/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /Users/j/Projects/pw3270/pw3270/macos/pw3270.app/Contents/Frameworks/im-viqr.so
These warnings seem to be harmless as far as the bundling is concerned ...
There are also errors related to some libraries not being found ...
My question is: how should I build the app? I have homebrew so do not want to go down the jhbuild route if possible.
Should I be using master or the macos branch to build?
Thanks!
The text was updated successfully, but these errors were encountered: