Problem to run XBoard with Mac command line

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Problem to run XBoard with Mac command line

Post by hgm »

OK, it seems the library functions with 'p' in their name emulate the shell's searching behavior, trying the actual system call execve for each directory in $PATH until one works. Indeed XBoard uses execvp to launch the engines, and not execv. So XBoard should pay attention to the $PATH variable too. The linking process brings the code necessary to do this into XBoard.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Problem to run XBoard with Mac command line

Post by JoshPettus »

So after much trial and error I narrowed the pixbuff mystery down. It started working on the hackentosh because I had installed macbports and gtk2 as part of some port. And why I couldn't figure it out before. It wasn't exactly a problem with the pixbuff system in the app bundle.

It looks like I need to bundle the contents of /opt/local/share/mime in the app folder. (XBoard.app/Contents/Resources/share/mime) But that's not all. Somehow I have to get the libraries to look there for this mime information. This part I'm not yet sure how. I'll have to do more research, but it doesn't look like there are any easy answers yet.

My guess is it GDK couldn't find the .png images because It didn't know what a png image was....
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Problem to run XBoard with Mac command line

Post by JoshPettus »

If anyone knowledgeable in the intricacies of GTK has any light to shed on this, it would be greatly appreciated. I am very much stumbling in the dark.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Problem to run XBoard with Mac command line

Post by JoshPettus »

Yay! I think I got it! So far I just have to move /opt/local/share/mime/mime.cache to XBoard.app/Contents/Resources/share/mime and add

Code: Select all

export XDG_DATA_DIRS="$bundle_data"
To the XBoard launcher script. Once I get these to the code, I'll try to make a 4.9.1a

Only my dev laptop is out of commission, which means I have to start from scratch on the new hackentosh.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Problem to run XBoard with Mac command line

Post by JoshPettus »

Since the fixes are all in the bundling and not in executable itself, I released a new XBoard and XBoardSg 4.9.1a. (Also updated the internal polyglot and UCI2WB as per tradition :D)

http://www.open-aurec.com/wbforum/viewt ... 45#p201445
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Problem to run XBoard with Mac command line

Post by hgm »

Unfortunately I had forgotten to push a major fix to UCI2WB that I made earlier today. That is, it fixes a major problem on Windows, namely that it would fail to terminate the engine process when you would quit WinBoard when the engine was thinking.

I am not sure if this was a problem on Linux / Mac. Linux is pretty efficient in terminating processes that no longer connect with input or output to other processes, so if UCI2WB dies, it might take the engine with it even without requiring an explicit action.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Problem to run XBoard with Mac command line

Post by JoshPettus »

Oops..
Well I haven't noticed any hanging processes. So it seems to work. (Crossing fingers...)
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Problem to run XBoard with Mac command line

Post by phhnguyen »

Thanks JoshPettus, great job!!!

I have downloaded (XBoardSg for MacOS) and done a quick test. The app works so well. I have seen both its icon and dots changes when the side to move changes!!!

Just a small problem: It cannot load engine bonanza! Other problem is that it is still showing in Vietnamese even my primary language is English.

BTW, the Vietnamese content seems be missing a lot. Give me the latest content file (for Internationalisation) I will fix it.

Still waiting for Xiangqi version... :)
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Problem to run XBoard with Mac command line

Post by JoshPettus »

It should have been working back in the 4.8.0 app when I helped Harm do the osx integration code. I'm sad it hasn't after all this time as I was quite proud of the result. :(

If you can find the error why bonanza doesn't run, let me know. I'm a little surprised it doesn't. What OS do you have? Maybe I forgot to make it executable for 10.6+

Regarding the languages, you can always nix the Xboard.app/Contents/Resources/share/locale folder and /Resources/*.lproj folders to force it to English. Sounds like an OS bug not honoring your language preference and setting the environment anyway...

If you are willing to do a Vietnamese translation, that would be absolutely fantastic! I really wish there were more, but unfortunately it's not so simple. The XBoard project translations are all done through the Translation Project. Which anyone can join, but there is a bit of red tape involved and looks to be some sort of disclaimer you have to fill out which says it's a month long process. (see "Info for Translators") I wonder if it would be skirting the rules if I sent you the small portion for the gtk-mac-integration strings, that handle the OSX "XBoard" menu. (That is done without gettext, and is handled natively in OSX)
[EDIT]
Ah, nevermind, it looks like the vi.lproj folder for gtk-mac-integration is already there. So the rest is all gettext.

As for the Xiangqi version, it may have to wait a little bit. I have to get a new power cord again for my macbook which has the 10.6 VirtualBox environment I need. (Fortunately I didn't need to recompile to fix this last bug) The default XBoard app has all the same equipment however. So you can still play. I just do a few cosmetic things for the XQ app.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Problem to run XBoard with Mac command line

Post by phhnguyen »

JoshPettus wrote: If you can find the error why bonanza doesn't run, let me know. I'm a little surprised it doesn't. What OS do you have? Maybe I forgot to make it executable for 10.6+
That is my mistake. If I run XBoardSq directly from its download package (click on dmg file and then run XBoardSq lazily from open popup), it says it cannot load that engine. However, after copying XBoard into other folder, it runs smoothly with that engine.

I have a look into vi.lproj. The number of items is too few. Few years ago I have created a much longer one and sent to HGM. Not sure if it became useless since the content changed or other reasons.