PerryWerneck / pw3270

3270 Emulator for gtk
https://softwarepublico.gov.br/social/pw3270/
GNU Lesser General Public License v3.0
58 stars 12 forks source link

Fails to build on macOS -- missing pw3270_build_data_path() #58

Closed wrljet closed 6 months ago

wrljet commented 6 months ago

Describe the Bug

Fails to build on macOS (13, Ventura) with linker error:

/Users/bill/tools/pw3270/.obj/pw3270/Release/./src/objects/actions/abstract.o ...
Undefined symbols for architecture x86_64:
  "_pw3270_build_data_path", referenced from:
      _startup in application.o
ld: symbol(s) not found for architecture x86_64

Reference is made to a function that exists in the linux and windows specific tools.c but it is missing for macOS.

bill@Bills-Mac pw3270 % grep -r pw3270_build_data_path *        
src/include/pw3270.h:gchar * pw3270_build_data_path(const char *path);
src/objects/application/application.c:      g_autofree gchar *keypad_path = pw3270_build_data_path("keypad");
src/main/linux/tools.c: gchar * pw3270_build_data_path(const char *name) {
src/main/windows/tools.c: gchar * pw3270_build_data_path(const char *name) {

Expected Behavior

Expected to compile and link properly. :-)

System

Please complete the following information:

PerryWerneck commented 6 months ago

Which branch are you using? Can you test using the 'macos' branch?

wrljet commented 6 months ago

Thank for your reply.

I was using the default master branch. Just tried with the 'macos' branch. Now make all seems to work. But bundle fails.

bill@Bills-Mac pw3270 % cd macos
bill@Bills-Mac macos % ./bundle
Creating temporary directory
Bundling GLib schemas
cp: /usr/local/usr/local/Cellar/gtk+3/3.24.39/share/glib-2.0/schemas/pw3270*.gschema.xml: No such file or directory
Removing temporary directory "/var/folders/vk/y13h2zy92mxdvrt06rk9n4f00000gn/T/tmp.zf9U6j9e"
bill@Bills-Mac macos %

That path /usr/local/usr/local... doesn't look kosher.

Bill

PerryWerneck commented 6 months ago

I think it's fixed now but I'm no sure if the bundle is still working. Maybee it will need some work due to code changes.

wrljet commented 6 months ago

OK, that fix helped.

Now I get:

bill@Bills-Mac macos % ./bundle                      
Creating temporary directory
Bundling GLib schemas
cp: /usr/local/Cellar/gtk+3/3.24.39/share/glib-2.0/schemas/pw3270*.gschema.xml: No such file or directory
Removing temporary directory "/var/folders/vk/y13h2zy92mxdvrt06rk9n4f00000gn/T/tmp.UKAiWFJo"

There's no pw3270*.gschema.xml file(s) in the /usr/local/Cellar/gtk+3/3.24.39/share/glib-2.0/schemas directory.

Any place I should look for where/how those file(s) are created?

Bill

PerryWerneck commented 6 months ago

From the bundle's 'point of view' they're in ../schemas/*.gschema.xml already changed the script.

wrljet commented 6 months ago

I found the source of the next couple of errors to be caused by quotes around strings causing the glob expansion to not be performed.

-cp "../schemas/*.gschema.xml" "${tmp}/schemas"
-cp "$(pkg-config gtk+-3.0 --variable=prefix)/share/glib-2.0/schemas/org.gtk.Settings."*".gschema.xml" "${tmp}/schemas"

Getting past that, I ran into lots of errors along the lines of: Lib /usr/lib/libSystem.B.dylib not found.

I found this thread on the Interwebs Based on that, I tried it with a much older Mojave, and that failed for a bunch of other reasons.

MacOS is just too confusing, and I'm just not very familiar with all this.

Bill

andrebreves commented 6 months ago

@wrljet I made some updates to the bundle script in my fork, see if it works for you:

https://github.com/andrebreves/pw3270

wrljet commented 6 months ago

That worked! image

wrljet commented 6 months ago

Also confirmed works on a Mac M1. (with some cussing) Resulting Bundle has been tested on a second machine, and worked there also.

andrebreves commented 6 months ago

@PerryWerneck I tried to open a pull request from my fork but it failed in the "WinPKG / Publish for Windows 64" verification. I didn't change any windows source file, only the build script.

PerryWerneck commented 6 months ago

Something is problaby old on your branch. Did you send the pull request for which branch? Try to send it to macos or develop.

andrebreves commented 6 months ago

I worked on the main branch from a fresh fork. It's only one commit ahead.

I'll try another branch.

PerryWerneck commented 6 months ago

The action failed due to security reasons. I aproved the pull request bypassing the rules.

wrljet commented 6 months ago

As committed, the bundle in the macos branch isn't marked executable.

spoofy-zz commented 4 months ago

I still have the error: Fails to build on macOS -- missing pw3270_build_data_path() Monterey on Macbook Air 2017.