Recent

Author Topic: Packaging application as snap  (Read 794 times)

Chronos

  • Full Member
  • ***
  • Posts: 218
    • PascalClassLibrary
Packaging application as snap
« on: April 26, 2021, 11:43:02 am »
Here you can find a new wiki page with information how to create a snap package for your Lazarus/FPC application:
https://wiki.freepascal.org/Create_snap_package

I have done this for C-evo game which can be now installed easily from Snap store https://snapcraft.io/c-evo/
Sure normal deb application takes less space. In case of C-evo deb is just 6,2 MB where C-evo snap takes 40 MB as it contains also various libraries needed for runtime. But with speed and memory capacity of current computers this is less of the problem. And thanks to Snap store we can keep updating latest version of our apps and we can reach wider audience. Snap packages can be even installed on other Linux distributions like Fedora, Arch, OpenSUSE so one package is usable on wide number of user machines.

Perhaps we can have also snaps for other popular Lazarus apps like Lazarus IDE, Double Commander or LazPaint :)

devEric69

  • Sr. Member
  • ****
  • Posts: 465
Re: Packaging application as snap
« Reply #1 on: April 26, 2021, 12:22:51 pm »
Hello,

Thank you very much for your contribution.
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

PascalDragon

  • Hero Member
  • *****
  • Posts: 2981
  • Compiler Developer
Re: Packaging application as snap
« Reply #2 on: April 26, 2021, 01:08:27 pm »
I have done this for C-evo game which can be now installed easily from Snap store https://snapcraft.io/c-evo/

Out of curiosity: where are the sources for that Lazarus port of C-Evo located? :)

Chronos

  • Full Member
  • ***
  • Posts: 218
    • PascalClassLibrary
Re: Packaging application as snap
« Reply #3 on: April 26, 2021, 03:31:14 pm »
The link to C-evo Lazarus port is also available directly on C-evo snap page as "Developer website" link. It points to this port homepage https://app.zdechov.net/c-evo/
Here you can either browse code https://app.zdechov.net/c-evo/browser/trunk or download code as Zip file or find more info obtaining source as subversion checkout.

Specific snapcraft.yaml file for C-evo is https://app.zdechov.net/c-evo/browser/trunk/Install/snap/snapcraft.yaml
Here "plugin: nil" is used because snapcraft doesn't support Lazarus/FPC plugin. It would be nice to have such plugin :) See existing plugins here https://snapcraft.io/docs/supported-plugins But as you can see we can directly call lazbuild and install needed files to install area for further staging and priming so we can still build Lazarus app.

Creation of a snap is also easier way how to get our applications to Snap store or Ubuntu Software and also with icon, screen shots, user ratings and other details. Normal way to get deb package to Ubuntu would be to find a mentor in Debian community and go through complex process of package normalization for Debian distro to get final approval. With snaps anybody can just register new snap and upload latest code as to stable/beta/edge channel and it will be immediately available for all users.

PascalDragon

  • Hero Member
  • *****
  • Posts: 2981
  • Compiler Developer
Re: Packaging application as snap
« Reply #4 on: April 27, 2021, 09:21:42 am »
The link to C-evo Lazarus port is also available directly on C-evo snap page as "Developer website" link. It points to this port homepage https://app.zdechov.net/c-evo/
Here you can either browse code https://app.zdechov.net/c-evo/browser/trunk or download code as Zip file or find more info obtaining source as subversion checkout.

Thank you! I wonder why I had missed that link... :-[

Chronos

  • Full Member
  • ***
  • Posts: 218
    • PascalClassLibrary
Re: Packaging application as snap
« Reply #5 on: May 12, 2021, 10:30:43 pm »
After many hours of trying and with help from snapcraft.io forum I was able to get sound working for snapped C-evo game. See https://wiki.freepascal.org/Create_snap_package#Sound_support

Also I've snapped one more game: https://snapcraft.io/2048x

 

TinyPortal © 2005-2018