Monday, February 6, 2023

How to package your Gtk App for Mac

Preface

Couldn't get the gtk-mac-bundler to work so I had to package my Gtk app on my own. searching the internet for information.

So how do you package Gtk app for Mac distribution? Luckily, a guy on Stackoverflow asked the same question.  With no one having the answer, he answered his own question.  He created a blog on a website that's long gone.  Thanks to Wayback Machine, the information is preserved.  Somewhat.

Thanks to danivdwerf, I was able to package Kage Studio for Mac!

One learning from this activity is the copying of Gtk library to the App.  And having to modify the copied libraries to actually access the same libraries already copied inside the App.

danivdwerf indicated on his blogpost that he had to create a shell script so he doesn't have to do the same manually in the future.  My concern was,  Gtk library is always updating, and I will have to modify the shell script each time.

So, I decided to create a python script to generate the shell script itself.

How to package your Gtk App for Mac

Automatically creating the App file is a work in progress but currently, simply run this line on Terminal

python3 copylib.py yourapp

You should have a shell script called, copylib_yourapp.sh, which you can use to copy all the Gtk libraries and modifying them for your App.

Final Words

Get a copy of copylib.py on Gtk-App-Builder.

Happy hacking!

~creek23

Sunday, February 5, 2023

Create ICNS (icons for Mac) on GIMP

It's official! Gimp supports ICNS! 

Well, it's not yet officially "official".  But beta build of Gimp already supports ICNS file format.

Yes, the file format for icons that Mac OS uses.

Open, Create, Edit ICNS with Gimp 2.99.14 (the beta build I tested it on).  As of posting, official Gimp is at 2.10-32.

It will also tell you if your icon size is supported or not! Sweet!  No need to check the internet if a size is supported.

So, I created ICNS for Kage Studio with Gimp 2.99.  I tested 16x16, 18x18, 24x24, 32x32, 36x36, 48x48, 64x64, 128x128, 256x256, and 512x512.

It was unreal using Kage Studio to create the icon for Kage Studio.  Then exporting the Kage Studio icon from Kage Studio to PNG which Gimp obviously supports.  Then use Gimp to downscale from high resolution to all the dimensions that ICNS supports.

Not sure who to credit for supporting the file format, maybe everyone on the ticket that was raised 2 years ago by cardcraft, that was finally closed just 3mos ago.

I so love Free and Open Source Software.  What a time to be alive.

~creek23