Difference between revisions of "Building LÖVE"

(Spelling out that this is for compiling LÖVE, not a game.)
m (Speeling)
Line 3: Line 3:
 
This page has information on compiling the LÖVE source code. This is only necessary if you want to make modifications or additions to the framework itself. If you just want to code a game in Lua, go back to [[Getting Started]].
 
This page has information on compiling the LÖVE source code. This is only necessary if you want to make modifications or additions to the framework itself. If you just want to code a game in Lua, go back to [[Getting Started]].
  
Still interested? Okay. Follow these three steps you'll have your very own LÖVE binary:
+
Still interested? Okay. Follow these three steps and you'll have your very own LÖVE binary:
 
#[[#1._Getting_the_source|Getting the source]]
 
#[[#1._Getting_the_source|Getting the source]]
 
#[[#2._Dependencies|Dependencies]]
 
#[[#2._Dependencies|Dependencies]]

Revision as of 10:42, 4 June 2013

O.png This page is still incomplete, you are likely to be eaten by a grue.  


This page has information on compiling the LÖVE source code. This is only necessary if you want to make modifications or additions to the framework itself. If you just want to code a game in Lua, go back to Getting Started.

Still interested? Okay. Follow these three steps and you'll have your very own LÖVE binary:

  1. Getting the source
  2. Dependencies
  3. Building

1. Getting the source

The official repository of LÖVE is hosted on bitbucket.

You can download the source code either by downloading an archive from one of the tags on the download page or by installing mercurial and cloning the repository. Many linux distributions have a mercurial package in their repositories. Windows and OS X users can get the official binary from selenic.

To create a clone with mercurial open a terminal or command prompt, go to the directory that you want to download the source code folder to and use the following commands:

hg clone https://bitbucket.org/rude/love

This will create a love folder and download the latest source code into it.

If you want to use the source code of a specific version, go into the love directory and issue one of the following commands:

hg update 0.8.0		# any (released) version from 0.6.0 onwards.
hg update 0.7.2
hg update minor		# the minor branch, where development is done for the next 0.x.0 version when there's still a 0.y.z version to be released.
hg update default	# back to the standard, the next release.
hg update tip		# to the last commit, regardless of branch.


2. Dependencies

LÖVE uses several open source libraries such as Lua, DevIL for images, and libvorbis for audio. Those libraries and their development files are required to successfully build LÖVE. It's possible to build every dependency yourself, but this is out of the scope of this page. The following explains how you can get prebuilt binaries instead.

Windows

The headers and prebuilt MSVC 2008 and 2010 binaries of the dependencies for LÖVE 0.7.2 can be found here.

For 0.8.0, the binaries are found here.

And for the new project file that was added with commit 83df4bb use this package

Linux

Download the development packages of the dependencies from the repository of your distribution.

Ubuntu

sudo apt-get install build-essential automake libmpg123-dev libmodplug-dev libphysfs-dev libfreetype6-dev libdevil-dev liblua5.1-0-dev libopenal-dev libsdl1.2-dev libvorbis-dev

Older versions of Ubuntu need the latest libmodplug1 and libmodplug-dev packages.

Arch Linux

pacman -S devil flac freetype2 glibc libmodplug libvorbis lua51 mesa mpg123 openal physfs sdl # 0.6.x
pacman -S devil freetype2 libmodplug libvorbis lua51 mpg123 openal physfs sdl # 0.7.x

Fedora

yum install freetype-devel glibc-devel libmpg123-devel libmodplug-devel physfs-devel mesa-libGL-devel openal-soft-devel DevIL-devel libvorbis-devel SDL-devel libmng-devel libtiff-devel lua-devel gcc-c++ libtool

Please note that libmpg123-devel is in the rpmfusion-free repository.

Debian Squeeze

Install the following packages (using aptitude or apt):

aptitude install build-essential automake libtool libphysfs-dev libsdl-dev libopenal-dev liblua5.1-0-dev libdevil-dev libmodplug-dev libfreetype6-dev libmpg123-dev libvorbis-dev libmng-dev libxpm-dev libxcursor-dev libXxf86vm-dev

Afterwards, just build it like it is mentioned below. It's e-a-s-y! :)

Mageia 2

urpmi make automake autoconf libopenal-devel libtool libtool-base libphysfs-devel libSDL-devel lua liblua-devel libdevil-devel libmodplug-devel libfreetype6-devel libmpg123-devel libvorbis-devel libmng-devel libxpm-devel libxcursor-devel libxxf86vm-devel

Gentoo

emerge -va lua physfs libsdl opengl devil freetype openal libvorbis mpg123 libmodplug

Make sure you have autotools installed (which should normally be the case):

emerge -va automake autoconf libtool

Other distributions

Any other distribution will most likely have the dependencies in their repositories too, possibly with slightly different package names.

Linking with LuaJIT on Linux

The configure script in the next step has a --with-luajit option which will set up a makefile that links with LuaJIT instead. The distributions should also have a separate package for LuaJIT that needs to be installed in this case.

3. Building

Windows

The source code includes Visual Studio 2010 project files. LÖVE versions before 0.8.0 also have Visual Studio 2008 files. Extract the appropriate LÖVE SDK into the love directory and they should successfully yield a LÖVE binary.

Linux

Use the automagic script to generate the configure file and then run configure and make as usual.

./platform/unix/automagic
./configure
make

Your LÖVE binary will end up in the src directory.