Tcl on MacOS

Dear all, Tcl/Tk on MacOS challenges me:

  • an old version of TclTk (8.5) as default on MacOS
  • build applications for the MacOS platform
    • and especially sign a complete app to be recognized on MacOS
  • and maybe also some performance issue.

Let us talk about our experience and best practices.

Manfred


TR: my experience:

  • do not use the built-in version but install your own recent Tcl 8.6 (I just compile from the sources myself)
  • build applications using the bundle facility of macOS, here is a recipe -> https://www.codebykevin.com/tutorial.html
  • code-signing a macOS app can be done with a self-signed signature using the codesign utility (codesign --force --deep -s - $exeFile) but this will still trigger a warning as the certificate is not a paid one (you only get full peace of mind when you pay Apple $ 100 per year)
  • What particular performance issues do you have?

Otherwise, make sure to check the New Tcl/TkAqua FAQ (and yes, it needs an update!)


ManfredR - 2025-01-10 21:55:20

I tried to codesign "vanillawish","tclkit" and a single "wish" and "tclsh". my observation:

  • I could codesign "wish" and "tclsh"
  • but could not codesign "vanillawish" and "tclkit".

I fear this observation is based on, that codesign does not sign binaries with a payload. If this is the case "vanillawish" and "tclkit" are no oportunity to provide a tcl-runtime with batteries included for MacOS apps.

  • the --deep option should no longer be used

ALX I assume that all files embedded into the VFS must be code-signed first. Afterwards, the executable needs to be signed.


ManfredR - 2025-01-29 15:00:00

I found an approach used to build tkChat for MacOS:

  • TclApps Library Source Code [L1 ]

and a manual

  • Building Stand-Alone Tcl/Tk Applications under Mac OS X [L2 ]

This approach requires wish.app as template

 wish.app/
    Contents/
        Info.plist
        Frameworks/
            Tcl.framework/
            Tk.framework/
        MacOS/
            wish
        Resources/
            wish.icns

to use this template with the name myApp all whish should be renamed to e.g. myApp

 myApp.app/
    Contents/
        Info.plist
        Frameworks/
            Tcl.framework/
            Tk.framework/
        MacOS/
            myApp
        Resources/
            myApp.icns

... and if I got it right:

 ./myApp.app/Contents/MacOS/myApp

is a nearly native

wish

looking for a tcl-script

 ./myApp.app/Resources/Scripts/AppMain.tcl (or main.tcl???)

my Question:

... is there anybody out there, providing a wish.app as a template (for tcl 8.6)?