love-release - in Lua ! - makes LÖVE game release easier

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Rucikir
Party member
Posts: 129
Joined: Tue Nov 05, 2013 6:33 pm

Re: Love-Release. Now modular !

Post by Rucikir »

Hello everyone !
To support all those who develop games for LD30, I give you a new version of love-release.

I has begun at the beginning of the summer when I was requested to make the script supports Debian packages and the Android port. Now it's done.
Externally, the script hasn't changed a lot, but internally it has become completely modular with every build instruction splitted accross little scripts. You can now write more easely your own build scripts wich allows you to use, for example, custom version of LÖVE, or trigger specific commands at build time.

The script aims at being easy to use. That's why I wrote an install script, a man page AND the possibility to add a configuration file to your project in an INI format.

Debian, android an OUYA icons are not yet supported, PKGBUILDs, RPMs and SteamOS/Desura builds will certainly be added in the future.
Thank you for your support on this thread and special thanks to josefnpat, Positive07, nunodonato and socketubs for the help on Github.

If you'd like to clone, star, fork, report bugs or request features: love-release.sh.
Changes wrote: - new install script. love-release NEEDS TO BE INSTALLED THIS WAY.
- new man page.
- love-release is now modular. Every platform specific build is stored in a seperate file.
- you can write your own build scripts. See scripts/example.sh.
- changed --refresh to --clean, -u to --osx-maintainer-name and --update-repo to --update-android.
- some options are now prefixed to prevent conflicts
- add -x option to exclude files
- configuration is possible by passing an INI file to `--config`. See config.ini.
- no need to install ResHacker anymore. Process is handled automatically, but still requires Wine.
NAME
love-release.sh -- Bash script to generate Love 2D game releases

INSTALLATION
Clone and run as root install.sh, or edit install.sh to choose locations in user-space.

SYNOPSIS
love-release.sh [-adlmw] [-n project_name] [-r release_dir] [-v love_version] [FILES...]

DESCRIPTION
love-release.sh can be used to generate Love 2D game applications and get over the fastidious zipping commands you had to do.

The script fully supports Windows, MacOS either on x86 or x64, Debian and Android packages.
It needs an Internet connection to download Love files, and relies on curl, zip and unzip commands.
To set the default Love version to use, you can edit the very beginning of the script.
If lua and a conf.lua file are found, it will automatically detect which version your project uses.

OPTIONS
-h Print a short help
--help Print this longer help

OPERATING SYSTEMS
-a Create an Android package.
In order to create an Android package, you must have installed the Android SDK. See Building LÖVE for Android, but there is no need to install the LÖVE port to Android, as the script will handle this by itself. You also might want to provide more informations about it. See the ANDROID section below.

-d Create a deb package.
Aimed at Debian and Ubuntu derivatives. In order to create a Debian package, you must provide more informations about it. See the DEBIAN section below.

-l Create a plain Love file.
It is just a zip of your sources, renamed in \*.love. Mostly aimed at Linux players or developers and the most common distribution process.

-m Create MacOS application.
Starting with Love 0.9.0, Love no longer supports old x86 Macintosh. If you are targeting one of these, your project must be developped with Love 0.8.0 or lower. Depending on the Love version used, the script will choose which one, between x64 only or Universal Build to create.

-w Create Windows application.
Starting with Love 0.8.0, a release is specially available for Windows x64. If you are targeting one of these, your project must be developed with Love 0.8.0 or newer. Remember that x86 is always backwards compatible with x64. Depending on the Love version used, the script will choose which one, between x64 and x86 or x86 only to create.
-w32 Create Windows x86 executable only
-w64 Create Windows x64 executable only

PROJECT OPTIONS
-n Set the projects name. By default, the name of the current directory is used.

-r Set the release directory. By default, a subdirectory called releases is created.

-v Love version. Default is 0.9.1.
Starting with Love 0.8.0, a release is specially available for Windows x64. Starting with Love 0.9.0, Love no longer supports old x86 Macintosh.

-x Exclude file or directory.

WINDOWS
--win-icon Path to an ico file to use.

MAC OS X
--osx-icon Path to an icns file to use.
--osx-maintainer-name Set the maintainer’s name. Provide it for OS X CFBundleIdentifier.

DEBIAN
--description Set the description of your project.
--homepage Set the homepage of your project.
--maintainer-email Set the maintainer’s email.
--deb-maintainer-name Set the maintainer’s name.
--deb-package-name Set the name of the package and the command that will be used to launch your game. By default, it is the name of your project converted to lowercase, with eventual spaces replaced by dashes.
--deb-package-version Set the version of your package.

ANDROID
Note that every argument passed to the options should be alphanumerical,
with eventual underscores (i.e. [a-zA-Z0-9\_]), otherwise you'll get errors.
--activity The name of the class that extends GameActivity. By default it is the name of the project with ‘Activity’ appended, eventual spaces and dashes replaced by underscores.
--apk-maintainer-name Set the maintainer’s name. It must be only alphanumerical characters, with eventual underscores.
--apk-package-name Set the name of the package. By default, it is the name of your project, with eventual spaces replaced by underscores.
--apk-package-version Set the version of your package.
--update-android Update the love-android-sdl2.git repository used in the cache.

OTHERS
--clean Clean the cache located in ~/.cache/love-release. One can replace the Love files there.
--config Pass a configuration file as argument. It describes which build you want to make, with what options. See config.ini.

MODULES
The script is modular. Each different platform is handled by a subscript stored in scripts. If you’d like to add the support of another platform, or your own build script, see scripts/example.sh.

ICONS
The script doesn’t yet handle the process of creating icons, but if provided it can use them.
  • if you want to create MacOS icons (.icns), and you are
  • if you want to create Windows icons (.ico), you can
    • use icoutils to create the icon,
    • then Wine and Resource Hacker to set the icon. This last step can be automatically done, assuming Wine is installed.
If you want to add icons in the debian package, open it and put the icons in /usr/share/icons/hicolor/YYxYY/apps/, where YY is the width of the icon. You also have to edit the line Icon=love in /usr/share/applications/yourgame.desktop to match the icon's name. See developer.gnome.org for more informations.

SEE ALSO
https://www.love2d.org
https://www.love2d.org/wiki/Game_Distribution
https://www.github.com/MisterDA/love-release
Last edited by Rucikir on Wed Aug 27, 2014 8:44 pm, edited 1 time in total.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Love-Release. Now modular !

Post by Robin »

Typo in the SEE ALSO section: it's github.com, not github.org.

Awesome work, otherwise!
Help us help you: attach a .love.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Love-Release. Now modular !

Post by kikito »

I can't install this on my Mac. I have not touched the install file. This line:

Code: Select all

sed -i -e "s/scripts/$SED_ARG\/scripts/g" -e "s/config.ini/$SED_ARG\/config.ini/g" "$MANPAGE_DIR"/love-release.1
Gives me this (uninformative) error:

Code: Select all

sed: -e: No such file or directory
When I write def I mean function.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Love-Release. Now modular !

Post by bartbes »

Those options are valid for GNU sed, which OSX probably doesn't use, or maybe an older version of it.
User avatar
Rucikir
Party member
Posts: 129
Joined: Tue Nov 05, 2013 6:33 pm

Re: Love-Release. Now modular !

Post by Rucikir »

Well, I don't know...
Check if this file exists /usr/share/man/man1/love-release.1.

$SED_ARG holds the escaped path to $INSTALL_DIR.

Try to replace the line with

Code: Select all

sed -i -e "s/scripts/$SED_ARG\/scripts/g" "$MANPAGE_DIR"/love-release.1
sed -i -e "s/config.ini/$SED_ARG\/config.ini/g" "$MANPAGE_DIR"/love-release.1
bartbes wrote:Those options are valid for GNU sed, which OSX probably doesn't use, or maybe an older version of it.
But Darwin/Reference/ManPages/man1/sed.1.html seems to support it...

I will write something to make the script run standalone, with no installation. If you can't get it working, clone and git checkout 6b4c7e24755a468ecf12303f03dd4936a4f7db33 will give you the last working script before I began splitting it up.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Love-Release. Now modular !

Post by bartbes »

Rucikir wrote:
bartbes wrote:Those options are valid for GNU sed, which OSX probably doesn't use, or maybe an older version of it.
But Darwin/Reference/ManPages/man1/sed.1.html seems to support it...
That is true, I must have stumbled upon an older/incorrect man page. It does seem to imply -e needs to go before -i though, maybe that solves it? It seems it's trying to interpret -e as a filename, which would fit the ordering being incorrect.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Love-Release. Now modular !

Post by Positive07 »

Yeah I think bartbes is right, the man page says that it should be something like

Code: Select all

sed -e [COMMAND] -i [FILEPATH]
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Rucikir
Party member
Posts: 129
Joined: Tue Nov 05, 2013 6:33 pm

Re: Love-Release. Now modular !

Post by Rucikir »

Finally, I've come to a solution.
The point of the -i option is to do in place file editing. You have to specify an extention, like -i.bak otherwise it will fail on Mac. So sed reads a file if you specify a filename otherwise it reads stdin. But if you want to write the output to a file, you cannot do sed 's/find/replace/g' filename > filename because sed will read an write the same file at once. You can't automaticaly override the file you're reading (seems obvious now).

You can choose to read and write the output to a file with the same name and specify an extension with -i, or prefer this solution where you can write the output to a location you can choose:

Code: Select all

sed -e 's/find/replace/g' -e 's/find2/replace2/g' filename > otherfile
And if you'd like to use multiple regex patterns, you have to specify -e before every one of them.

It should work now. I'm sorry that it didn't worked for kikito and the other Mac users, especially with Ludum Dare going on. I also fixed the typo reported by Robin. bcdda5a.
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: Love-Release. Now modular !

Post by Zilarrezko »

So... I have no idea how to do this. I'm not even a beginner in scripts. All I know is that there's a bash script, batch script, echo does something, and the simple use of command prompt's cd function.

So I clone it... how do I run the install.sh as "root"? I've tried to run it in command prompt within the love-release directory by saying "install.sh", I've tried typing in install.sh in the github shell thing. Both saying unknown command things...

I doubt it's because I'm using a UI version of github thing? (hard enough to learn github when all the tutorials are command prompts when I use a UI version my friend gave me.)

Just to let you all know, I've tried to do a helloworld bash script on my linux laptop, and after 1 hour, I gave up because I couldn't get it to work xD I'll do so well in college...
User avatar
Rucikir
Party member
Posts: 129
Joined: Tue Nov 05, 2013 6:33 pm

Re: Love-Release. Now modular !

Post by Rucikir »

I know it can be a bit tricky. But love-release only works with command line interface, no GUI.

Here is how to install love-release (just paste it in a terminal). Running as "root" means that love-release will be installed in the system directories but it needs to be authorized to create and write files there, so you run the script as "super-user" alias "root" with the command sudo, simply by typing your password.

Code: Select all

git clone https://github.com/MisterDA/love-release.git
cd love-release
sudo ./install.sh
Some people dislike (or can't) install scripts like this one on their system directories. I'll try to make a easier way than this, but if it is your case you can edit the install.sh file, remove the part where it checks that it's running as root, and change the installations directories (if so, you will probably have to add theses dirs into the PATH variable).

Then, you go into your game directory and start using love-release.


I don't get if your a beginner in scripts...
Zilarrezko wrote: I'm not even a beginner in scripts.
...
I've tried to do a helloworld bash script on my linux laptop, and after 1 hour, I gave up because I couldn't get it to work
You shouldn't have to look inside the script (unless you really want to), but then using it is just basic knowledge of shells in general. You call a program, or a script, and you give it some options and arguments. For example the call to this will generate two executables (32 and 64 bits) of your game for Windows, using src/assets/game.ico as icon.

Code: Select all

love-release -w --win-icon src/assets/game.ico

If something is still unclear or doesn't work for you, please let me know.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests