Ports applications are not shown to Mac Application menu

Ryan Schmidt ryandesign at macports.org
Sat Aug 21 17:00:06 PDT 2010


On Aug 21, 2010, at 18:23, Bradley Giesbrecht wrote:

> My only real interest aside from helping others is making use of makeicns which I think is a really cool tool.
> 
> Here is the launcher app stuff. The Info.plist and ClawsMail.sh could be add to the files dir.
> 
> set my_app ClawsMail
> post-build {
>    xinstall -d ${worksrcpath}/macports
>    system "echo '#!/bin/sh' > ${worksrcpath}/macports/${my_app}.sh"
>    system "echo '${prefix}/bin/claws-mail > /dev/null 2>&1 &' >> ${worksrcpath}/macports/${my_app}.sh"
>    system "makeicns -in ${worksrcpath}/${name}-128x128.png -out ${worksrcpath}/macports/${my_app}.icns"
>    system "echo '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' > ${worksrcpath}/macports/Info.plist"
>    system "echo '<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">' >> ${worksrcpath}/macports/Info.plist"
>    system "echo '<plist version=\"1.0\">' >> ${worksrcpath}/macports/Info.plist"
>    system "echo '<dict>' >> ${worksrcpath}/macports/Info.plist"
>    system "echo '  <key>CFBundleExecutable</key>' >> ${worksrcpath}/macports/Info.plist"
>    system "echo '  <string>${my_app}.sh</string>' >> ${worksrcpath}/macports/Info.plist"
>    system "echo '  <key>CFBundleIconFile</key>' >> ${worksrcpath}/macports/Info.plist"
>    system "echo '  <string>${my_app}.icns</string>' >> ${worksrcpath}/macports/Info.plist"
>    system "echo '</dict>' >> ${worksrcpath}/macports/Info.plist"
>    system "echo '</plist>' >> ${worksrcpath}/macports/Info.plist"
> }
> 
> post-destroot {
>    xinstall -d ${destroot}${applications_dir}/${my_app}.app/Contents/MacOS
>    xinstall -d ${destroot}${applications_dir}/${my_app}.app/Contents/Resources
>    xinstall -m 755 ${worksrcpath}/macports/${my_app}.sh \
>        ${destroot}${applications_dir}/${my_app}.app/Contents/MacOS
>    xinstall -m 755 ${worksrcpath}/macports/${my_app}.icns \
>        ${destroot}${applications_dir}/${my_app}.app/Contents/Resources
>    xinstall -m 644 ${worksrcpath}/macports/${my_app}.icns \
>        ${destroot}${applications_dir}/${my_app}.app/Contents/Resources
>    xinstall -m 644 ${worksrcpath}/macports/Info.plist \
>        ${destroot}${applications_dir}/${my_app}.app/Contents
> }

So, not nearly as straightforward. :)


>    system "echo '${prefix}/bin/claws-mail > /dev/null 2>&1 &' >> ${worksrcpath}/macports/${my_app}.sh"

And this ("&") means that when you double-click the app icon, it will appear in the dock, launch this process, and then immediately disappear from the dock again while the app opens. So this isn't really how people are used to icons working in the dock. So this may not be a great idea to do in the port.




More information about the macports-users mailing list