Page 1 of 3

Love Distribution Tool v0.3 [Mac contributor needed!]

Posted: Wed May 29, 2013 9:11 am
by easy82
ldt-screenshot.png
ldt-screenshot.png (116.94 KiB) Viewed 6752 times
Description

Love Distribution Tool (LDT) is a command line application for distributing games created with the awesome LOVE framework. It creates a .love file and a native executable depending on the host operating system.


Requirements

1. You need to have the LOVE framework installed. If you don't have it already, download it at http://love2d.org/

2. On Linux and on MacOSX LDT assumes you have zip installed on your system.

3. On Windows LDT needs 7-Zip or WinRAR to be installed on your system. You can download 7-Zip from http://www.7-zip.org/ or WinRAR from http://www.rarlab.com/


Installation

A) Installing on Linux or MacOSX:

Download LDT and put it whereever you want it.


B) Installing on Windows:

Download LDT and put it into the directory where LOVE is installed on your system. This is usually at 'C:\Program Files\LOVE'.


Usage

1. Open the Terminal (or Command Prompt on Windows)

2. Navigate to the directory where you've put LDT to. Example: 'cd Downloads' (or 'cd /d C:\Program Files\LOVE' on Windows).

3. Type 'love distribute.love PathToYourProject'. Example: 'love distribute.love ~/MyProjects/MyGame' (or 'love distribute.love F:\MyProjects\MyGame' on Windows).

4. If everything went all right, you can run the .love file by hitting F5, or the native executable by hitting F6. You will find the binaries inside your project directory, under the 'bin' folder.


Known Issues

- LDT is completely untested on MacOSX! Mac developer needed...

- LDT will pack the binaries it finds: 32 or 64 bits, and won't check if they are really 32 or 64 bits.


Contribute

- Source: https://github.com/easy82/distribute

- E-mail: easy82 (dot) contact (at) gmail (dot) com


Changes

v0.1:
* Detect if architecture is 32 or 64 bits
* Add instructions for distribute.love in readme.txt
* Test on Windows7
* Test on WindowsXP

v0.2:
* Added WinRAR to archivers on Windows
* Workaround for Mac: io:popen doesn't work in Love 0.8.0 (will be fixed in 0.9.0)
* Checking '/Applications' before '/home' because OSX also have '/home'
* Simplified detecting processor architecture
* Updated instructions to use only distribute.love version

v3.0:
* Added more Windows search directories
* Bugfix for missing io:popen on Mac
* Added tests for detecting Linux distribution
* Hotfix for Ubuntu release and (hopefully) Debian detection


Download
distribute.love
Version 0.3 Hotfix
(238.29 KiB) Downloaded 278 times

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 12:06 pm
by Germanunkol
I löve you!

This is really awesome and works like a charm! :)
Only annoying thing is that you need to boot the different operating systems to build it for them, but I can't see a simple way around that...

I will definitely use this to distribute in the future!

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 12:14 pm
by veethree
I own a mac. I could possibly contribute.

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 1:53 pm
by josefnpat
I was initially very excited, but to my dismay, the linux "distribution" comes with a lot of "gotchas".

From the project;

Code: Select all

        'cd "<project.path>bin" && ' ..
        'cat "<love2d.path><love2d.name>" "Love/<project.name>.love" > "<system.name><system.arch>/<project.name>" && ' ..
        'chmod a+x "<system.name><system.arch>/<project.name>"'
While this binary will work on the system that it is built on, the binary will only run on;

* Systems with the same architecture, with few exceptions. (E.g. 32 vs 64)
* Systems with all the proper dependencies installed (To name a few from here; desktop-file-utils, devil, freetype2, hicolor-icon-theme, libmodplug, libvorbis, mpg123, openal, physfs, sdl, shared-mime-info)
* Systems with close enough versions of love's dependencies installed. (it's very easy to get glibc segfaults if you're distributing from ubuntu to fedora, for example)

Classic case of WOMM.

So for anyone using this, do not consider this a stable way of distributing linux binaries, unless the customer has all the love dependencies installed, and is using the same OS and architecture. Otherwise, the binary will most likely segfault on most other linux distros.

This response may sound very negative, but it has been something that the love developers, myself, and many others have attempted over time.

We've been trying to figure out true linux binary distribution for a while now :(

Even in my own workflow for building binaries, I'm still handing out .love files to linux users.

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 2:03 pm
by qaisjp
Please use a pure-lua zip implementation instead of these requirements ._.
but looks really nice :0

just so you know popen isn't supported on Mac.

Code: Select all

Mac:Downloads qaisjp$ love distribute.love ~/Dropbox/StickyDestroyer/project/Love2d/sd
Detecting operating system ...
Operating system: Linux
Error: utils.lua:45: 'popen' not supported
stack traceback:
	[C]: in function 'popen'
	utils.lua:45: in function 'testOutput'
	tests.lua:100: in function 'testArchitecture'
	tests.lua:257: in function 'createBinaries'
	main.lua:33: in function 'update'
	[string "boot.lua"]:407: in function <[string "boot.lua"]:373>
	[C]: in function 'xpcall'

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 6:04 pm
by easy82
Germanunkol wrote:I löve you!

This is really awesome and works like a charm! :)
Only annoying thing is that you need to boot the different operating systems to build it for them, but I can't see a simple way around that...

I will definitely use this to distribute in the future!
Thanks! I'm glad you like it! :) Which OS do you use, btw?

Yes, I've been thinking about this idea, to create all the binaries from one installation (in case all the required files are provided). However, I believe one should test the binaries on the target OS anyway...!

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 6:07 pm
by slime
qaisjp wrote:Please use a pure-lua zip implementation instead of these requirements ._.
but looks really nice :0

just so you know popen isn't supported on Mac.

Code: Select all

Mac:Downloads qaisjp$ love distribute.love ~/Dropbox/StickyDestroyer/project/Love2d/sd
Detecting operating system ...
Operating system: Linux
Error: utils.lua:45: 'popen' not supported
stack traceback:
	[C]: in function 'popen'
	utils.lua:45: in function 'testOutput'
	tests.lua:100: in function 'testArchitecture'
	tests.lua:257: in function 'createBinaries'
	main.lua:33: in function 'update'
	[string "boot.lua"]:407: in function <[string "boot.lua"]:373>
	[C]: in function 'xpcall'
io.popen isn't supported in the version of Lua distributed with the OS X version of LÖVE 0.8.0. 0.9.0 will have a fixed version of Lua which has a functional io.popen.

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 6:08 pm
by easy82
veethree wrote:I own a mac. I could possibly contribute.
That would be really cool! Please contact me if you would like to contribute, I can help you with some more details, guideline, future plans, etc.

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 6:28 pm
by easy82
josefnpat wrote:I was initially very excited, but to my dismay, the linux "distribution" comes with a lot of "gotchas".

From the project;

Code: Select all

        'cd "<project.path>bin" && ' ..
        'cat "<love2d.path><love2d.name>" "Love/<project.name>.love" > "<system.name><system.arch>/<project.name>" && ' ..
        'chmod a+x "<system.name><system.arch>/<project.name>"'
While this binary will work on the system that it is built on, the binary will only run on;

* Systems with the same architecture, with few exceptions. (E.g. 32 vs 64)
* Systems with all the proper dependencies installed (To name a few from here; desktop-file-utils, devil, freetype2, hicolor-icon-theme, libmodplug, libvorbis, mpg123, openal, physfs, sdl, shared-mime-info)
* Systems with close enough versions of love's dependencies installed. (it's very easy to get glibc segfaults if you're distributing from ubuntu to fedora, for example)

Classic case of WOMM.

So for anyone using this, do not consider this a stable way of distributing linux binaries, unless the customer has all the love dependencies installed, and is using the same OS and architecture. Otherwise, the binary will most likely segfault on most other linux distros.

This response may sound very negative, but it has been something that the love developers, myself, and many others have attempted over time.

We've been trying to figure out true linux binary distribution for a while now :(

Even in my own workflow for building binaries, I'm still handing out .love files to linux users.
I don't think there is a generic "one binary rules them all" solution for Linux. There are various Linux distributions out there, it's impossible to support them all -- in contrast with the small number of Windows and Mac versions. However, many of the distributions are built on popular distros like Ubuntu, so if you "build" your game on Ubuntu with LDT, I can play it on Linux Mint for sure. I need to have all dependencies, right, but if I don't have them I just need to copy a line into the Terminal. Linux fans are usually more technical people anyway, plus later we can think about other solutions, like .deb and .rpm support. If nothing else works, they can just play the .love file.

You're right that in its current form, it's a bit rough, but hey, it's a start! :)

And ... don't hold it back if you have any ideas to solve this issue!

Re: Love Distribution Tool [Mac contributor needed!]

Posted: Wed May 29, 2013 6:42 pm
by easy82
qaisjp wrote:Please use a pure-lua zip implementation instead of these requirements ._.
but looks really nice :0

just so you know popen isn't supported on Mac.

Code: Select all

Mac:Downloads qaisjp$ love distribute.love ~/Dropbox/StickyDestroyer/project/Love2d/sd
Detecting operating system ...
Operating system: Linux
Error: utils.lua:45: 'popen' not supported
stack traceback:
	[C]: in function 'popen'
	utils.lua:45: in function 'testOutput'
	tests.lua:100: in function 'testArchitecture'
	tests.lua:257: in function 'createBinaries'
	main.lua:33: in function 'update'
	[string "boot.lua"]:407: in function <[string "boot.lua"]:373>
	[C]: in function 'xpcall'
What requirements?

This first incarnation of LDT was written in pure Lua. Then I realized it's an extra dependency, because you don't have to install Lua to play or write LÖVE games. This is why I've decided on using LÖVE instead.

About popen: I didn't know, thanks!