Ticket #22 (accepted task)

Opened 9 months ago

Last modified 5 months ago

Find Mac OS X Maintainer

Reported by: chris Owned by: knowknowledge
Priority: major Milestone: 0.4.0
Component: Distribution Version:
Keywords: Cc:

Description


Change History

Changed 8 months ago by chris

  • milestone changed from 0.1.0 to 0.3.0

Changed 7 months ago by chris

  • component changed from Website to Distribution

Changed 6 months ago by knowknowledge

  • owner set to knowknowledge
  • status changed from new to accepted

I'm interested in working on the Mac OS X package.

Changed 5 months ago by knowknowledge

I haven't figured out how to create a working Apple bundle yet.

Apple bundles have the form:

    Epiar.app
        Contents
            Info.plist
            MacOS
                <executable binary>
            Resources
                <Whatever we want>

Since the current working directory when launched from the Finder is "/", we need to either modify the file open path or cd to a location where we can open use the normal path. Since the Epiar.app/Contents/Resources is a duplicate of our Resources file, we can cd into Epiar.app/Contents.

We add this to the first lines of main:

    #ifdef __APPLE__
        string path = argv[0];
        if( path.find("MacOS/Epiar") ){ // If this is being run from inside a Bundle
                // Chdir to the Bundle Contents
                string ContentsPath = path.substr(0, path.find("MacOS/Epiar") );
                chdir(ContentsPath.c_str());
        }
    #endif

The Info.plist should have a form like this. I created this from cut and paste from other bundles, so it's a bit crap.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>CFBundleExecutableFile</key>
        <string>Epiar</string>
        <key>CFBundleName</key>
        <string>Epiar</string>
        <key>CFBundleIdentifier</key>
        <string>com.epiar.sample</string>
        <key>CFBundleIconFile</key>
        <string>Epiar_Icon.icns</string>
      </dict>
    </plist>

I've gotten the resource paths figured out, but the libraries are all wrong.

Note: See TracTickets for help on using tickets.