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. To create the deb source package we unzip the upstream .love file. This allows us to patch the game as required. During package build process we recreate the .love file and install it under /usr/share/games/<package>. We also create a shell script to launch it against the love executable which is a dependency.

Where the name of the game is "foo"

File Structure

 /foo/
 /foo/debian/
 /foo/LICENSE (upstream license)
 /foo/foo (directory of unzipped upstream .love)

control

Ensure depends include love and build-depends include "zip"

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.1

   1 .TH FOO 1 "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

   1 #!/usr/bin/make -f
   2 
   3 %:
   4         dh $@ -Pdebian/foo_build
   5 
   6 override_dh_auto_build:
   7         cd foo && zip -r -q -9 ../foo.love .
   8 
   9 #This is needed to ensure clean up of foo_build dir and foo.love
  10 override_dh_clean:
  11         dh_clean
  12         rm -rf build_dir
  13         rm -f ./foo.love
  14 
  15 #workaround for dh_installinit bug #719359
  16 override_dh_installinit:

source/include-binaries

foo.love


Games/Development