Help building Native standalone LÖVE games

Other observations:

  1. the love binary is very picky about library dependencies. Binaries built against one target may not work on a system of another version. Therefore it would be good to get the love build into chum, where all versions are available individually.
    I can do the “getting into Chum” thing, but I am not able to actually maintain or furher develop the code from @sashikknox and https://github.com/savegame/love/tree/sailfish. Someone else would have to do that and step up as a maintainer.
  2. Are there any apps/games out there that use libmodplug, i.e. .mod files for music? If not I would like to drop the dependency on libmodplug.
1 Like

hi nephros, thanks for the help.
So if I follow your guidelines regarding the desktop files and add the ```

[X-Sailjail]
Permissions=Love2D

along with the internet permissions for those apps who need it and use the love directory for the app, we will have the main problem solved? Sounds great, I may not be able to edit and submit all at once but will do it little by little.

Regarding the other crash problems you mention which I can not reproduce:
I had to add sometimes tens of tweaks to the desktop versions of the game to make them work on my mobile, and all of them work, I would like to add more tweaks if needed but I don’t have other versions of sailfish to test and my sailfish virtual machine fails to start… therefore it is quite difficult for me to find out and solve those issues… I just can assure that on sailfish 3.4 32 bits on my phone all of the apps I submitted work…

I will at least follow your guidelines to solve the main problem.
Thanks!

  • regarding the error on blockdrop “Error: touchControls.lua:123: attempt to compare number with nil” , I initialized that variables and the problem should be gone now…

regarding the question about libmodplug… I don’t think any app need the library and if they do I can simply record the files and save it in a standard .ogg to reduce the complexity and problems with the dependencies.

I hope. Start with the Screensaver one, that seems the easiest/most compatible according to my very brief test.

1 Like

perfect, I may not be able to do it right now but it will be the first one I submit, thanks!

About crashes relating to mouse/joystick/touch etc, it may be related to:

regarding the crashes relating to mouse/joystick/touch I have a possible solution that I will test later, basically I can assign a value when is nil to avoid it from crashing, I will test that later.
Regarding the screen saver, could you tell me if this is correct before I submit the app?

[Desktop Entry]
Type=Application
Name=Springscreensaver
Comment=Springscreensaver
Icon=/usr/share/games/love/SpringScreensaver/springscreensaver.png
Exec=/usr/bin/love /usr/share/games/love/SpringScreensaver/springScreensaver-mobile-0.1.love
Terminal=false
Categories=Games;
Name[de_DE]=springscreensaver.desktop

[X-Sailjail]
Permissions=Love2D;Internet

this is my spec file to build the rpm:

%prep

%build

%install
mkdir -p %{buildroot}/usr/share/games/love/applications
mkdir -p %{buildroot}/usr/share/games/love/SpringScreensaver
install -m 0755 %{_sourcedir}/Spiele/Sailfish/desktopFiles/SpringScreensaver/springscreensaver.desktop %{buildroot}/usr/share/games/love/applications/springscreensaver.desktop
install -m 0644 %{_sourcedir}/Spiele/Sailfish/desktopFiles/SpringScreensaver/springScreensaver-mobile-0.1.love %{buildroot}/usr/share/games/love/SpringScreensaver/springScreensaver-mobile-0.1.love
install -m 0644 %{_sourcedir}/Spiele/Sailfish/desktopFiles/SpringScreensaver/springscreensaver.png %{buildroot}/usr/share/games/love/SpringScreensaver/springscreensaver.png

%files
/usr/share/games/love/applications/springscreensaver.desktop
/usr/share/games/love/SpringScreensaver/springScreensaver-mobile-0.1.love
/usr/share/games/love/SpringScreensaver/springscreensaver.png

%changelog

nephros I’ve just rebuilt the rpm and changed the directories to:

/usr/share/applications/springscreensaver.desktop
/usr/share/games/love/SpringScreensaver/springScreensaver-mobile-0.1.love
/usr/share/games/love/SpringScreensaver/springscreensaver.png

and added Permissions=Love2D;Internet
I don’t know if the .desktop file should be too on user/share/games/love/… but I tried that and it does not run on my phone that way. now it runs on my mobile, hopefully yours too.

I’ve just uploaded another build of boxclip with some corrections regarding the issues with inputs and with the same path to install it as I did with the spring screensaver. I hope this time works.

Hi, the .desktop looks fine (although I’d remove the name[de-de] part).

But. All the files were ok in the previous locarion.
Only the .love file needs to go into the new dir.

Maybe I wasn’t clear, sorry.

right, I will then only change the .love files, do I need to reupload boxclip and spring screensaver or do already work?
I made corrections to both and also to blockdrop following your feedback. I can not reproduce the error on starphase and I have no idea what is causing it.

Screensaver is fine, Boxclip misses the sailjail/permissions section.

These are the boxclip desktop and spec files:

[Desktop Entry]
Type=Application
Name=Boxclip
Comment=Boxclip
Icon=/usr/share/games/love/Boxclip/boxclip.png
Exec=/usr/bin/love /usr/share/games/love/Boxclip/boxclip-mobile-fork-v0.1-3-5.love
Terminal=false
Categories=Games;
Name=boxclip.desktop

[X-Sailjail]
Permissions=Love2D


Name:       Boxclip
Version:    0.1.2
Release:    1%{?dist}
Summary:    
2D platformer engine using LÖVE and Lua forked from: https://github.com/Jigoku/boxclip

License:    GPLv2+
BuildArch:  noarch

%description

%define _sourcedir /home/user


%prep

%build

%install
mkdir -p %{buildroot}/usr/share/applications
mkdir -p %{buildroot}/usr/share/games/love/Boxclip
install -m 0755 %{_sourcedir}/Spiele/Sailfish/desktopFiles/Boxclip/boxclip.desktop %{buildroot}/usr/share/applications/boxclip.desktop
install -m 0644 %{_sourcedir}/Spiele/Sailfish/desktopFiles/Boxclip/boxclip-mobile-fork-v0.1-3-5.love %{buildroot}/usr/share/games/love/Boxclip/boxclip-mobile-fork-v0.1-3-5.love
install -m 0644 %{_sourcedir}/Spiele/Sailfish/desktopFiles/Boxclip/boxclip.png %{buildroot}/usr/share/games/love/Boxclip/boxclip.png

%files
/usr/share/applications/boxclip.desktop
/usr/share/games/love/Boxclip/boxclip-mobile-fork-v0.1-3-5.love
/usr/share/games/love/Boxclip/boxclip.png

%changelog

I don’t know what else can I do to solve the sailjail permission problem.
It seems that I made a mistake with the desktop file on boxclip, I uploaded again and now it should have the sailjail permissions correct… hopefully…

I’m a bit tight on time at the moment, but am willing to help on that front. I’m a bit behind on my duties, though!

7 Likes

Very cool,thank you.

I have submitted to testing, but have not set up a packaging repo.

Will you do a fork, or do we package at Chum git?

Nitpicks:

The Name keys are duplicate, and the second one, Name=boxclip.desktop will lead to the name on the destop/launcher to be “boxclip.desktop”. So, remove that line.

You can place the Icon at /usr/share/games/love/, as long as you use the corresponding absolute path in the Icon key, but the more common localtion is /usr/share/icons/hicolor/NxN/apps with N being the resolution.
If the icon file is there, you can just use Icon=boxclip (no path, no extension, but case-sensitive) and the correct icon should be chosen.

Which ever packaging repo makes sense and which I have access to :slight_smile: Where is it :slight_smile:

Currently there is no git repo for packaging.

Love as I built it is now at
https://build.sailfishos.org/package/show/sailfishos:chum:testing/love2d

But contains a tarball of the tree at GitHub - savegame/love at sailfish, and my spec/yaml and the SJ permission file.

I can create a packaging repo at chum-git, and point the upstream git module to ?your fork of love?

Hm, that sounds weird.