dontpanic92 / wxGo

Golang wxWidgets Wrapper
Other
404 stars 51 forks source link

packaging, signing, and Mac AppStore #8

Open andrewarrow opened 8 years ago

andrewarrow commented 8 years ago
contents

when I right click on a normal MacOS app I get "Show Package Contents" menu option and then all this inside the .app file ^

But with my wxGo file there is no Show Package Contents option. What's the process for distributing apps created with wxGo to the Mac App Store?

dontpanic92 commented 8 years ago

Hi, I have little knowledge on macOS really. The compiled file should be a normal executable file, instead of a package that contains other resources. Does macOS have any packaging tool?

andrewarrow commented 8 years ago

there must be a way to do this in xcode or the command line. But I think you would need an account with https://developer.apple.com/macos/distribution/ to sign the app and get it in app store. I'll research more because I really like your wxGo system! Thanks for making this.

more links:

https://developer.apple.com/developer-id/

andrewarrow commented 8 years ago

I started a tool at: https://github.com/andrewarrow/wxGo/commit/0d7eafa19b6f345d48b1dd74d796e659f1064284

here is sample output so far:

github.com/dontpanic92/wxGo/macos $ ./macos mygreatapp
building skeleton for mygreatapp
creating dir
&{0xc82000e0c0}
~/dev/src/github.com/dontpanic92/wxGo/macos $ ls -l mygreatapp/
total 0
drwxr-xr-x  5 aa  staff  170 Sep 27 16:37 Contents
~/dev/src/github.com/dontpanic92/wxGo/macos $ ls -lR mygreatapp/
total 0
drwxr-xr-x  5 aa  staff  170 Sep 27 16:37 Contents

mygreatapp//Contents:
total 0
-rw-r--r--  1 aa  staff   0 Sep 27 16:37 Info.plist
drwxr-xr-x  2 aa  staff  68 Sep 27 16:37 MacOS
drwxr-xr-x  2 aa  staff  68 Sep 27 16:37 Resources

mygreatapp//Contents/MacOS:

mygreatapp//Contents/Resources:

the idea is to make all the values inside Info.plist it needs and place exe in MacOS folder. Then eventually add the signing.

dontpanic92 commented 8 years ago

I'll research more because I really like your wxGo system!

So glad to hear that! However, currently wxGo is far from mature and there is still a lot of work to do.

I started a tool at: andrewarrow@0d7eafa

Thanks for your work. Perhaps it is a general solution for all projects which are not compiled by Xcode.

andrewarrow commented 8 years ago

cool, yeah I'll keep going in my branch for the command line tool that auto generates a Info.plist. I have a template in there now with {name} fields that get replaced with the name of your app when you run it.

neonsoftware commented 8 years ago

Hi @andrewarrow and @dontpanic92 !

on OSX here too and definitely desiring the .app as well 👍

I happened to have been curious as well about this topic some weeks ago, of getting form a binary to an .App. Googling 'osx create application bundle from binary' I encountered quite some discussions and pre-existing solution on this more general problem as here or this or this. Although I actually didn't have the time to test any, so I don't know if an existing tool already gets the job done.. If one exists I guess it may be done separately in a post-processing phase for OSX with proper instructions for the user in the readme ? (this in case there might aspects, such as the icon, that might complicate things and be better tackled by a specialised tool while the library focuses on getting the binary out)

In any case: OSX here and available to help testing

Cheers 👍

andrewarrow commented 8 years ago

@neonsoftware good to know. I haven't made much more progress with it but I am doing a lot of wxGo programming. I think wxGo is positioned nicely to be THE golang GUI for 2017. Let's replace all Java AWT and Swing stuff. Let's re-write Eclipse!

rakslice commented 8 years ago

For anyone putting an application bundle together you might find these resources helpful:

"Anatomy of an OS X Application Bundle" from Apple's Bundle Programming Guide: https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19

"Building a MacOSX application bundle" from the page "WxMac-specific topics" in the wxWidgets wiki https://wiki.wxwidgets.org/WxMac-specific_topics#Building_a_MacOSX_application_bundle

In the interest of getting up and running quickly, for now I just created a Mac icon by converting my Windows icon:

sips -s format icns icon.ico --out icon.icns

andrewarrow commented 8 years ago

nice! thanks @rakslice