美文网首页
deploy gtk on mac

deploy gtk on mac

作者: UnityAsk | 来源:发表于2016-12-27 17:25 被阅读20次

It turns out the standard mono distribution offers a command line utility designed for this exact purpose. While I didn’t create a MonoMac project, I was able to package my GUI application relying on Gtk# rather effectively.
This command line utility called macpack
is extremely simple to use, just point him to the direction of the files you want to package, specify the name of the assembly containing the Main
method and you’re good to go.
macpack [options] assembly -n appname -appname:appname Application Name -o output -output:OUTPUT Output directory -a assembly Assembly to pack -i file -icon file Icon filename -r resource1,resource2 Additional files to bundle -m [winforms|cocoa|x11|console] The mode for the applicatio

This is the line I used to compile a little test project:
macpack -o:. -w:winforms -r:/Library/Frameworks/Mono.framework/Versions/Current/lib/ -r:GtkMacTest.exe.mdb -n:GtkMacTest -a:GtkMacTest.exe

The -w:winforms
was a bit of a shot in the dark as there is now Gtk specific option… in the end it worked out well.
I didn’t experiment with the -i
option, so the resulting package looks rather ugly with the default icon on, but I’ll look into that another day. For now, all that matters is that I created a working .app to distribute the project.


Xamarin Studio will run that EXE with the Mono runtime. You would either have to create .app with macpack or maybe follow these instructions.

相关文章

网友评论

      本文标题:deploy gtk on mac

      本文链接:https://www.haomeiwen.com/subject/qarevttx.html