Translation(s): none


*DRAFT*

Packaging Love2d

This page describes the policy for including Love2d games in the Debian archive.

Introduction

Love2d is a 2d game development framework for the Lua language. It features opengl graphics, audio, input handling, physics courtesy of box2d and all with the rapid development of Lua. It is ideal for beginning programming, prototyping, gamejams etc.

Structure of a Love Distribution

Love games are distributed in a ".love" file. A ".love" file is simply a zip of your lua code and associated game data. Please see the Game Distribution page on the Love2d wiki for details on how to structure the content of your .love file. Please, keep in mind that when you're executing a .love file through love2d, you're executing actual code that can access your computer resources in many ways, just like any other program can, so make sure to only execute code you can trust.

Structure of the Debian Package

Since a love2d game comes packed in a single file, it's easy for us to standardise the debian packaging structure. Basically we store the .love file under /usr/share/games/<package> and create a shell script to launch it against the love executable.

The following are example packaging files;

Where the name of the game is "foo"

control

Ensure depends include love

copyright

You must open up the .love file and capture the licensing of any included libraries (hardoncollider, middleclass, LUBE etc). Most are zlib and are found on the love2d wiki

shell script

Create a script in the debian directory to launch your game named foo;

   1 #!/bin/sh
   2 love /usr/share/games/foo/foo.love "$@"

menu

Create an entry to your script.

?package(foo):needs="X11" section="Games/Action" \
  title="foo" command="foo"

foo.desktop

and a .desktop file

   1 [Desktop Entry]
   2 Name=foo
   3 Comment=
   4 Exec=foo
   5 Icon=foo
   6 Terminal=false
   7 Type=Application
   8 Categories=Game;ArcadeGame;
   9 GenericName=
  10 Keywords=game;

manpage

Create a manpage file named foo.6

   1 .TH FOO 6 "January 11 2014"
   2 .SH NAME
   3 FOO \- Action platformer built in LOVE.
   4 .SH SYNOPSIS
   5 .B foo
   6 .SH DESCRIPTION
   7 This manual page documents briefly the
   8 .B foo
   9 command.
  10 .PP
  11 \fBfoo\fP is a graphical action platform built using Lua and the LOVE framework.
  12 .SH OPTIONS
  13 This command executes a
  14 .BR sh (1)
  15 script of the foo.love package against the love executable.
  16 .SH SEE ALSO
  17 .BR love (1)
  18 .br
  19 .SH AUTHOR
  20 foo was written by FooBar Games.

foo.install

debian/foo usr/games
foo.love usr/share/games/foo
debian/foo.desktop usr/share/applications

rules

Finally the rules file.

   1 #!/usr/bin/make -f
   2 
   3 %:
   4         dh $@ -Pdebian/foo_build
   5 
   6 #workaround for dh_installinit bug #719359
   7 override_dh_installinit:


Games/Development