Page 1 of 1
Distributable package size
Posted: Thu Oct 23, 2014 9:25 am
by omar.aboumrad
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!
Re: Distributable package size
Posted: Thu Oct 23, 2014 12:12 pm
by SuperZazu
Maybe it has to do with zip/compression settings ?
You could try with the app
Keka with max compression!
Re: Distributable package size
Posted: Thu Oct 23, 2014 12:19 pm
by zorg
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
that should give you max compression.
Re: Distributable package size
Posted: Thu Oct 23, 2014 12:35 pm
by omar.aboumrad
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.
Re: Distributable package size
Posted: Thu Oct 23, 2014 5:17 pm
by slime
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.
Re: Distributable package size
Posted: Thu Oct 23, 2014 5:54 pm
by bartbes
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.
Re: Distributable package size
Posted: Thu Oct 23, 2014 7:07 pm
by omar.aboumrad
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.
P.S.: Does this issue not merit being added as a footnote to distributing the app on Mac OS X?
Cheers!
Re: Distributable package size
Posted: Wed Oct 29, 2014 2:57 pm
by SuperZazu
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.
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. :-)