Recent

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

Chronos

  • Full Member
  • ***
  • Posts: 240
    • 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

  • Hero Member
  • *****
  • Posts: 648
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: 5446
  • 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: 240
    • 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: 5446
  • 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: 240
    • 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

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: Packaging application as snap
« Reply #6 on: August 18, 2021, 04:42:14 pm »
Two more snapped apps:
https://snapcraft.io/big-metro
https://snapcraft.io/xtactics

So in total, there are now four Lazarus apps https://snapcraft.io/search?q=chronoscz

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: Packaging application as snap
« Reply #7 on: December 09, 2021, 10:19:23 pm »
Nine Lazarus/FPC applications published as snaps to date and more to come:
https://snapcraft.io/acronym-decoder
https://snapcraft.io/2048x
https://snapcraft.io/big-metro
https://snapcraft.io/c-evo
https://snapcraft.io/cudatext
https://snapcraft.io/lazfuck
https://snapcraft.io/picpas
https://snapcraft.io/vcard-studio
https://snapcraft.io/xtactics

Although snaps aren't without their problems still, it is another nice way how to reach wider Linux users audience. Also in this way users can enjoy using latest application versions even with older Ubuntu versions like 20.04 LTS.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Packaging application as snap
« Reply #8 on: December 10, 2021, 12:17:54 am »
...
Although snaps aren't without their problems still, it is another nice way how to reach wider Linux users audience. Also in this way users can enjoy using latest application versions even with older Ubuntu versions like 20.04 LTS.

Hmm, thats the trend is it ?  As a very long term Ubuntu user, I am about to switch because of these Snaps clogging up my system. They appear to be a solution in search of a problem to solve.

But good to see FPC/Lazarus penetrating even that market !  Thanks Chronos.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018