Mac patch for easier distribution. Where should I send it?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
stevejohnson
Prole
Posts: 5
Joined: Tue Dec 29, 2009 8:47 am

Mac patch for easier distribution. Where should I send it?

Post by stevejohnson »

The Mac distribution setup sucks, as described in this thread. So I decided to contribute a patch. I don't know SDL or Lua at all, and barely any Cocoa, but I get the ideas behind all of them and I want Löve to be as effective as possible on OS X because I like the project.

Someone suggested that love.app should simply check its own love.app/Contents/Resources folder for .love files and run the first one it finds, and even provided a code sample for how that might be done. It turned out to be a little more complicated than that, but not much more after I figured out what was going on. Basically, if löve decides that it's been launched from the Finder, then it does what it normally does upon drag-and-drop or a file open from the Finder: it rewrites gArgv to use that file and blocks gArgv from being rewritten again. It finds the file using Cocoa's resource-finding routines (given in the code sample, which I have since lost.) Then it releases memory properly, and execution continues as normal.

You'll have to update Info.plist as normal. That's just a Mac thing. I might write you guys an Automator script or something to do that more easily. It's really not difficult.

At any rate, the process for distribution with this patch is about 5 steps shorter. Just drop a .love in to love.app/Contents/Resources, rename love.app, and tweak Info.plist to show the correct name in the menu. Bam. Done.

I couldn't figure out where to clone or check out from, so I ended up using this Mercurial repository, which appears to be up to date.

Now I don't know how to submit the patch, so here's the Mercurial patch, and here's the text of the addition (It's just one 34-line chunk in SDLMain.m, just copy and paste it in, or throw it in a function, whatever). What is the proper channel for this? The site could benefit from a "how to contribute" page.

If you're a "normal person" here, then you can use the version I built locally. Download it here. I have NO IDEA if it works for anyone else, and I didn't pay much attention to the build process. (While we're here, could one of you devs tell me how to unmount this damn disk image?)

ANYWAYS

Hi, I'm Steve. Here's my web site. I like to write games and Mac software. I usually use Python and pyglet to do that, and I like them very much. But Lua intrigues me, so I've been checking out löve periodically, and you seem like my kind of folks. Keep it up.
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Mac patch for easier distribution. Where should I send it?

Post by bmelts »

Okay, I tested this patch out and by all accounts, this is awesome and so much better than my original hack. Paging rude to this thread so it can be okayed for 0.6.1!
stevejohnson
Prole
Posts: 5
Joined: Tue Dec 29, 2009 8:47 am

Re: Mac patch for easier distribution. Where should I send it?

Post by stevejohnson »

I totally just helped anjo figure out how to get löve to accept cmd-Q, cmd-H, and cmd-M keyboard shortcuts. So we're gonna have that too. It was a one-line fix. Zing!

(Yeah, I'm easily excitable.)
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Mac patch for easier distribution. Where should I send it?

Post by appleide »

OMG you're one of the writers of escortwing!! I love that game! I was even on the forums there for a bit, a long time ago.
Now we have keyboard shortcuts! Yes!
Welcome to love! :)
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Mac patch for easier distribution. Where should I send it?

Post by Jasoco »

This sounds like the greatest idea ever. Easy distribution for Mac versions of the games. I'm all for it.
stevejohnson
Prole
Posts: 5
Joined: Tue Dec 29, 2009 8:47 am

Re: Mac patch for easier distribution. Where should I send it?

Post by stevejohnson »

I just finished writing an app which makes distribution even simpler. You drag a folder or a .love file to it, it asks you for an app name, and the finished .app is created next to the input file/folder.

But I can't put it up until the next maintenance release goes out, because it requires the patch in the first post.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Mac patch for easier distribution. Where should I send it?

Post by rude »

Sorry for not responding, have been away for a while. Will apply this and try to provide builds tomorrow.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests