Scidb - porting to Mac OS X

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
Norbert Raimund Leisner
Posts: 1445
Joined: Tue May 20, 2008 2:57 pm
Location: Augsburg - Germany

Scidb - porting to Mac OS X

Post by Norbert Raimund Leisner » Sat Sep 28, 2013 7:28 am

Hello Mac-users,

Gregor Cramer (email: gcramer@users.sourceforge.net ) needs some volunteers to transferrring the source code of Scidb to Macintosh OS.

More informations about his database can be obtained here:
http://scidb.sourceforge.net/index.html
http://sourceforge.net/projects/scidb/files/

It seems that SourceForge email-addresses generally do not accept attached executable files.

Best wishes,
Norbert

zullil
Posts: 4882
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA

Re: Scidb - porting to Mac OS X

Post by zullil » Sat Sep 28, 2013 11:07 am

Norbert Raimund Leisner wrote:Hello Mac-users,

Gregor Cramer (email: gcramer@users.sourceforge.net ) needs some volunteers to transferrring the source code of Scidb to Macintosh OS.

More informations about his database can be obtained here:
http://scidb.sourceforge.net/index.html
http://sourceforge.net/projects/scidb/files/

It seems that SourceForge email-addresses generally do not accept attached executable files.

Best wishes,
Norbert
A bit more info, based on 15 minutes of work:

The configure script needs tweaking so that fontconfig is found. The larger issue is that the code uses an include that doesn't exist on OS X:

Code: Select all

fatal error: sys/sysmacros.h: No such file or directory
I don't have time to pursue this further, but I imagine that porting this should be very easy.

stevenaaus
Posts: 596
Joined: Wed Oct 13, 2010 7:44 am
Location: Australia
Contact:

Re: Scidb - porting to Mac OS X

Post by stevenaaus » Sun Sep 29, 2013 11:02 am

Haha... No it won't be easy. But Gregor would appreciate a serious volunteer.

This is what i outlined to Gregor last month, though i'm hardly authoritive.

Steven

----------

> And do you think that it is possible to compile Scidb as a Mac OS X-application?

Maybe it is possible. Lots of projects get ported to OSX, but
OSX has a very different native font rendering system,
and i cant see fontconfig.h and SM.h exists outside of X11
I'm giving 'configure' a go now - Lots of things need to be changed in configure.
to look for .dylib 's instead of .so, there's a couple of 'ne "unix"} return'
PATHs to X11 includes are different.

Maybe you'd have to build your own TCL, or at least use ScidvsPC 32 bit TCL framework.
(I have repeatedly used OSX TCL in the past and in summary -
We include our own *carbon* *32 bit* version of TCL. Cocoa TCL has a horribly broken
event loop. Carbon 64 bit is just broken too i think. It is quite possible in future we will have to link to X11/XQuartz if they remove carbon functionality.)

One thing is for sure - it is a hell of a lot of work.
Things are done so differently. Most OSX development is done from Xcode
whihc is a huge learning curve and not for me. Even given Scidvspc's relative
simplicity, it has been very hard working outside this framework.

....

Other considerations are that a heap of widgets dont display the same.
Tightly packed widgets all need special handling in tcl::Carbon because the round
buttons pack very differently (for eg), and font sizes vary a heap.
Have a look for 'macOS' inside ScidvsPC. TkImg/TCL also has problems with PNGs
when used as buttons. I think i have removed all PNG buttons in macOS ScidvsPC.
See the attached SCID screenshot - Half of Scid's little toolbar icons are messed up PNGs
(but perhaps you could fix TkImg?). I'm not sure if this affects the X11 build of TCL - which
looks like a poorly aliased X Application.

zullil
Posts: 4882
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA

Re: Scidb - porting to Mac OS X

Post by zullil » Sun Sep 29, 2013 12:15 pm

stevenaaus wrote:Haha... No it won't be easy. But Gregor would appreciate a serious volunteer.

This is what i outlined to Gregor last month, though i'm hardly authoritive.

Steven
Are you talking about a native OS X app or an X11 based app? The original scid ran easily enough using X11 on OS X.

stevenaaus
Posts: 596
Joined: Wed Oct 13, 2010 7:44 am
Location: Australia
Contact:

Re: Scidb - porting to Mac OS X

Post by stevenaaus » Mon Sep 30, 2013 6:55 am

zullil wrote:
stevenaaus wrote:Haha... No it won't be easy. But Gregor would appreciate a serious volunteer.

This is what i outlined to Gregor last month, though i'm hardly authoritive.

Steven
Are you talking about a native OS X app or an X11 based app? The original scid ran easily enough using X11 on OS X.
Scid and ScidvsPC run natively on OSX - ie the Tk they use does not link to X11. Mainline Scid does not include anything from X11 at all, but only from tk.h , which in turn needs X.h. Why Tk needs X.h on OSX i'm not sure, as the dll does not link to X. See bottom for what i'm talking about.

Also, Scid runs fairly easily because it doesnt do much fancy stuff with fonts.

Scidb on the other hand seems to do a heap of fancy stuff with custom Tcl/Tk and custom fonts, (both of which i'm not very knowledgable). So i can't properly answer whether this can be done inside Carbon/Cocoa or not.


/Library/Frameworks/Active8.6/Tk.framework/Headers/tk.h:
#ifndef _XLIB_H
# include <X11/Xlib.h>
# ifdef MAC_OSX_TK
# include <X11/X.h>
# endif
#endif

$otool -L /Library/Frameworks/Active8.6/Tk.framework/Tk
/Library/Frameworks/Active8.6/Tk.framework/Tk:
/Library/Frameworks/Tk.framework/Versions/8.6/Tk (compatibility version 8.6.0, current version 8.6.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.29.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 152.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 625.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 44.0.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 751.29.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1038.32.0)
)

stevenaaus
Posts: 596
Joined: Wed Oct 13, 2010 7:44 am
Location: Australia
Contact:

Re: Scidb - porting to Mac OS X

Post by stevenaaus » Mon Sep 30, 2013 7:47 pm

Gregor says
IMO Carbon/Cocoa should be avoided when doing the Mac version. .... In fact I already took OSX into account, but I don't know whether my OSX implementations are working, and it is not complete.

zullil
Posts: 4882
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA

Re: Scidb - porting to Mac OS X

Post by zullil » Mon Sep 30, 2013 8:08 pm

stevenaaus wrote:
zullil wrote:
stevenaaus wrote:Haha... No it won't be easy. But Gregor would appreciate a serious volunteer.

This is what i outlined to Gregor last month, though i'm hardly authoritive.

Steven
Are you talking about a native OS X app or an X11 based app? The original scid ran easily enough using X11 on OS X.
Scid and ScidvsPC run natively on OSX - ie the Tk they use does not link to X11.
When I used to compile scid, I had it use Tcl/Tk installed from MacPorts, rather than the OS X Tcl/Tk framework. Not sure now why, but there was a reason. :D

I wonder how hard it would be to do that with scidb---use a separate Tcl/Tk install and X11 rather than the native OS X framework.

User avatar
Ponti
Posts: 448
Joined: Wed Mar 15, 2006 5:13 am
Location: Curitiba - PR - BRAZIL
Contact:

Re: Scidb - porting to Mac OS X

Post by Ponti » Sun Mar 23, 2014 10:39 pm

I like to help, I own a Core2-Duo Macbook pro.
A. Ponti
AMD Ryzen 1800x, Windows 10.
FIDE current ratings: standard 1913, rapid 1931

Post Reply