Distributable package size

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
omar.aboumrad
Prole
Posts: 3
Joined: Thu Oct 23, 2014 9:15 am

Distributable package size

Post by omar.aboumrad » Thu Oct 23, 2014 9:25 am

Greetings,

Hope everyone's doing great, I'm new to Lua, LOVE and thus this forum. I have an inquiry concerning the distributable package size.

love-0.9.1-macosx-x64.zip is 3.9MB

and yet when I package the app (as per the instructions here) as a zip file, I end up with a ~10mb MyGame.zip

Code: Select all

$ zip MyGame.love main.lua
$ cp -r love.app MyGame.app
$ cp MyGame.love MyGame.app/Contents/Resources
$ zip MyGame.zip MyGame.app
-rw-r--r--   1 [me]  staff    10M Oct 23 11:19 MyGame.zip
I would've assumed the end product to be relatively close if not less than the original love app zipped. Is it possible to achieve a 4mb zipped game? (assuming barebone)

P.S.: I'm on mavericks and my game is a couple dozen lines of code with no additional resources.

Thank you for your time!

User avatar
SuperZazu
Citizen
Posts: 56
Joined: Sun Jun 10, 2012 2:06 pm
Location: France
Contact:

Re: Distributable package size

Post by SuperZazu » Thu Oct 23, 2014 12:12 pm

Maybe it has to do with zip/compression settings ?
You could try with the app Keka with max compression!

User avatar
zorg
Party member
Posts: 2938
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Distributable package size

Post by zorg » Thu Oct 23, 2014 12:19 pm

the zip program has flags that can set the compression to be stronger; the default setting (6) was probably not what the devs used to package the distributables.

you could try

Code: Select all

$ zip -9 MyGame.zip MyGame.app
that should give you max compression.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

omar.aboumrad
Prole
Posts: 3
Joined: Thu Oct 23, 2014 9:15 am

Re: Distributable package size

Post by omar.aboumrad » Thu Oct 23, 2014 12:35 pm

Thank you for your replies. I should've mentioned that I already tried the -9 switch, but here it is again:

Code: Select all

➜  game)  zip -9r pixy.zip pixy.app
➜  game)  ls -lah *.zip
-rw-r--r--  1 xterm  staff    10M Oct 23 15:25 pixy.zip
I've also tried Keka with max (slow) compression and it yielded almost the same result.

User avatar
slime
Solid Snayke
Posts: 2888
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Distributable package size

Post by slime » Thu Oct 23, 2014 5:17 pm

It might not be preserving the symlinks inside the .app when you zip it. If it resolves them instead, then you'd get 3 copies of each library inside the .app.

I believe there's a flag you can use with the zip command to make it do the right thing, but I forget what it is.
Last edited by slime on Thu Oct 23, 2014 6:13 pm, edited 1 time in total.

User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Distributable package size

Post by bartbes » Thu Oct 23, 2014 5:54 pm

slime wrote: I believe there's a flag you can use with the zip command to make it do the right thing, but I forget what it is.
It's -y.

omar.aboumrad
Prole
Posts: 3
Joined: Thu Oct 23, 2014 9:15 am

Re: Distributable package size

Post by omar.aboumrad » Thu Oct 23, 2014 7:07 pm

Magnificent!

I wouldn't have thought of it for the life of me! Thank you slime and bartbes!

FYI, this initial problem was, copying the love.app folder locally to avoid tampering with the base one, which forced the libraries as slime mentioned to be copied and the symlinks ignored. Hence, the primary issue to deal with is how to preserve symlinks during copies.

That's achieved using:

Code: Select all

$ cp --preserve=links love.app /path/to/destination
Or simply just preserve everything recursively:

Code: Select all

$ cp -av love.app /path/to/destination
That however is not enough, it's imperative to use the "-y" switch as bartbes has mentioned to make zip maintain the symlinks instead of handling the files as is.

Code: Select all

$ zip -ry MyGame.zip MyGame.love
P.S.: Does this issue not merit being added as a footnote to distributing the app on Mac OS X?

Cheers!

User avatar
SuperZazu
Citizen
Posts: 56
Joined: Sun Jun 10, 2012 2:06 pm
Location: France
Contact:

Re: Distributable package size

Post by SuperZazu » Wed Oct 29, 2014 2:57 pm

omar.aboumrad wrote:Magnificent!

That however is not enough, it's imperative to use the "-y" switch as bartbes has mentioned to make zip maintain the symlinks instead of handling the files as is.

Code: Select all

$ zip -ry MyGame.zip MyGame.love
P.S.: Does this issue not merit being added as a footnote to distributing the app on Mac OS X?

Cheers!
Wow, I did not know that. That may be a useful footnote, yes. :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests