https://wiki.freepascal.org/api.php?action=feedcontributions&user=Chronos&feedformat=atomFree Pascal wiki - User contributions [en]2024-03-28T08:32:38ZUser contributionsMediaWiki 1.35.6https://wiki.freepascal.org/index.php?title=Deploying_Your_Application&diff=157734Deploying Your Application2023-11-20T20:17:16Z<p>Chronos: </p>
<hr />
<div>{{Deploying Your Application}}<br />
<br />
You've created your application in Lazarus, tested within the IDE. Now it's time to deploy it to test it on a specific platform.<br />
<br />
== Windows Deployment ==<br />
<br />
=== InnoSetup ===<br />
<br />
[[Inno Setup]] [http://www.jrsoftware.org/] is a free installer for Windows programs. It may be used completely free of charge, even when deploying commercial applications, full Delphi source code is available.<br />
See [[Inno Setup]] for more details and links to the Lazarus installer that is written using Inno.<br />
<br />
Features:<br />
* Inno supports all versions of Windows in use today -- Windows 95, 98, ME, NT4, 2000, 2003, XP, Vista, 7, 8. The latest version that can create installers for Windows versions before Windows 2000 is version 5.4. See [http://www.jrsoftware.org/files/is5-whatsnew.htm]<br />
* It can compare file version info, replace in-use files, use shared file counting.<br />
* It can register DLL/OCXs and type libraries<br />
* It can install fonts.<br />
* It can create shortcuts anywhere, including in the Start Menu and on the desktop. <br />
* It can create registry and .INI entries<br />
* It has integrated Pascal scripting engine that allows e.g. manipulation of COM/ActiveX objects (e.g. MS Word), setting firewall rules etc.<br />
* It supports multilingual installs<br />
* It supports passworded and encrypted installs<br />
* It supports silent install and uninstall. <br />
<br />
While it is free for use, Inno Setup is copyrighted software, not public domain software. There are some restrictions on distribution and use; see the http://www.jrsoftware.org/files/is/license.txt file for details.<br />
<br />
Inno Setup is used to create the Lazarus installer for Windows.<br />
<br />
=== HJ-Install ===<br />
HJ-Install is a freeware installer for Windows 95, 98, ME, NT 4.0, 2000 and XP. It is created with Internet distributed, CD-Rom, single-floppy and multi-floppy installations in mind, but it can also be used in network situations and as a stand-alone scripting engine. The installer is small and adds only 138 Kb. It doesn't support changing the registry and ini files, and un-install. See http://www.freebyte.com/hjinstall/<br />
<br />
=== LizaJet Installer ===<br />
LizaJet Installer is a commercial installer, but a free edition is available. Uses Object Pascal for scripting. See http://www.lizajet.com<br />
<br />
=== NSIS (Nullsoft Scriptable Install System) ===<br />
A professional open source system to create Windows installers. A full-featured NSIS installer has an overhead of only 34 KB. See http://nsis.sourceforge.net/Main_Page and http://hmne.sourceforge.net/<br />
<br />
=== Windows Installer XML (WiX) toolset ===<br />
A toolset that builds Windows installation packages from XML source code. The toolset supports a command line environment that developers may integrate into their build processes to build MSI and MSM setup packages. See http://wix.sourceforge.net/<br />
<br />
=== Code signing ===<br />
<br />
For details of code signing Windows executables to avoid your end users receiving warnings that the publisher of the software is "unknown" when attempting to run your executable, see [[Code Signing for Windows]].<br />
<br />
== Linux Deployment ==<br />
<br />
=== Creating a RPM Package on Linux ===<br />
<br />
On Linux, the best way to deploy applications is by using the native package system. Of the many package systems available, RPM (RedHat Package Manager) is the most commonly utilized format, and is defined as the standard one in the Linux Standard Base.<br />
<br />
To create a RPM file, you need to create a spec text file with the information necessary to build the software, and also an environment to build that spec. The best editor to create RPM packages is Emacs, because it recognizes the spec extension, highlights the text appropriately and even has a menu option to build rpm packages.<br />
<br />
To build the rpm file use either the emacs menu or this command line (man rpmbuild for more information):<br />
<br />
rpmbuild -ba --clean $HOME/RPM/SPECS/myprogram.spec<br />
<br />
==== Setting up your build environment ====<br />
<br />
RPM Packages are installed as root to the base system (/ directory), but an accident as root can destroy your machine. To avoid this, packages can be build as a normal user. The build process includes a real install, to make sure the package works, but this install is made to a fake root directory represented by the $RPM_BUILD_ROOT variable.<br />
<br />
First, go to your home directory (or another directory inside it) and create the following directory structure:<br />
<br />
* RPM<br />
* RPM/BUILD - This directory is utilized by RPM to build the package.<br />
* RPM/RPMS - Here you can find binary RPMs after you build them.<br />
* RPM/SOURCES - Place your compressed tar files and patches here.<br />
* RPM/SPECS - Place all your spec files here.<br />
* RPM/SRPMS - Here you can find source RPMs after you build them.<br />
<br />
Next you will need to create a configuration file to tell rpm builder software where he can find your build directories. Go to your home directory and create a file named .rpmmacros and place the text below on it. Make sure to change the directories to the correct ones on your system.<br />
<br />
<pre><br />
%_topdir /home/felipe/RPM/<br />
%_tmppath /home/felipe/tmp<br />
<br />
%_signature gpg<br />
%_gpg_name Mandrakelinux<br />
%_gpg_path ~/.gnupg<br />
</pre><br />
<br />
==== Creating a binary only package ====<br />
<br />
The easiest way to create a RPM package is to make it install already compiled software. There are some reason why we might want to avoid compiling the software in the spec file:<br />
<br />
* It requires creating a Makefile and makefiles are complex<br />
<br />
* Some packages don't have any binary software in them, so they don't need to be built.<br />
<br />
Each RPM Package contains a single compressed tar archive. Place the archive under the RPM/SOURCES directory. Zip, gz and bz2 compressions should work ok. The file can either contain the full source of the project if you with to create a source and a binary package or a directory with the files already in place, like if they were installed in the user machine, if you with to create a binary only package.<br />
<br />
To build a binary package open a spec file with Emacs text editor. On Emacs open the menu "RPM spec" --> "RPM Build" --> "Build Binary Package". This will create a .rpm file under the directory RPM/RPMS<br />
<br />
Below is a spec file that doesn't build the software. In this case the software is a Braille Course composed of html and Macromedia Flash files. Flash files cannot be build on Linux, so it's not possible to create a source package in this case.<br />
<br />
<pre><br />
%define name braillevirtual <br />
%define version 1.0 <br />
%define release mdk <br />
%define dir braillevirtual<br />
%define root /home/felipe/tmp/ROOT/<br />
<br />
Summary: Curso On-Line de Braille<br />
Name: %{name}<br />
Version: %{version}<br />
Release: %{release}<br />
Vendor: Laboratório de Brinquedos da Faculdade de Educação da USP<br />
URL: www.braillevirtual.fe.usp.br<br />
License: Distribuível livremente<br />
Group: Books/Other<br />
Packager: Felipe Monteiro de Carvalho<br />
Source0: home/felipe/Programacao/SOURCES/braillevirtual.tar.bz2<br />
BuildRoot: %{root}<br />
<br />
%description<br />
O Braille Virtual é um curso on-line público e gratuito destinado à difusão e ensino do sistema Braille de leitura e escrita para cegos a pessoas que vêem. É orientado especialmente a pais, crianças, professores e funcionários de escolas inclusivas e pretende facilitar a comunicação entre estas pessoas e as pessoas com cegueira.<br />
<br />
%prep<br />
cd $RPM_SOURCE_DIR<br />
cp braillevirtual.tar.bz2 $RPM_BUILD_DIR<br />
cd $RPM_BUILD_DIR<br />
rm -rf %{dir}<br />
rm -f braillevirtual.tar<br />
bunzip2 -d braillevirtual.tar.bz2<br />
tar -xvf braillevirtual.tar<br />
<br />
%install<br />
mkdir -p $RPM_BUILD_ROOT/usr/share/<br />
rm -rf $RPM_BUILD_ROOT/usr/share/%{dir}<br />
cp -r $RPM_BUILD_DIR/%{dir} $RPM_BUILD_ROOT/usr/share/<br />
<br />
%clean<br />
rm -rf $RPM_BUILD_DIR/*.*<br />
<br />
%files<br />
/usr/share/%{dir}/<br />
<br />
%changelog<br />
<br />
* Mon Oct 24 2005 1.0-mdk.noarch.rpm<br />
<br />
- Nova atualização do pacote de instalação. Inclusão dos exercícios avançados.<br />
<br />
* Wed May 12 2005 1.0-mdk.noarch.rpm<br />
<br />
- Atualizei o pacote para refletir as mudanças no site. Várias pequenas mudanças.<br />
<br />
* Sun May 05 2005 1.0-1mdk.i586.rpm<br />
<br />
- O pacote de instalação do braille Virtual para linux é criado.<br />
</pre><br />
<br />
===== Tip: =====<br />
<br />
The following packages are required for an very basic GUI Application in GTK+ (binary only):<br />
<br />
libc6 libx11-6 libgdk-pixbuf2.0-0 libgtk2.0-0 libglib2.0-0<br />
libpango-1.0-0 libcairo2 libatk1.0-0 libxcb1 libglib2.0-0<br />
libpangocairo-1.0-0 libxfixes3 libpangoft2-1.0-0 libfontconfig1 libxrender1<br />
libxinerama1 libxi6 libxrandr2 libxcursor1 libxcomposite1<br />
libxdamage1 libxext6 libffi6 libpcre3 libthai0<br />
libpixman-1-0 libfreetype6 libpng12-0 libxcb-shm0 libxcb-render0<br />
zlib1g libxau6 libxdmcp6 libselinux1 libharfbuzz0b<br />
libexpat1 libdatrie1 libgraphite2-3<br />
<br />
You can get a list of used libraries with: <tt>ldd [executable of your project]</tt>.<br />
<br />
And find the packages in which it belongs: <br />
<br />
RPM based: <tt>rpm -qf <lib name></tt><br />
<br />
DEB based: <tt>dpkg -S <lib name></tt><br />
<br />
Where <lib name> is the name of library, before => or ")" in list<br />
<br />
Example: <tt>rpm -qf libgtk-x11-2.0.so.0</tt><br />
<br />
A script (DEB based) using pipes, in order to join all these commands in a single command line, could be (replace 'amd64' by 'i386' if you install 32 bits packages):<br />
<br />
$ ldd yourAppli | awk '/=>/{print $(NF-1)}' | while read n; do dpkg -S $n; done | awk '{print $1}' | sed 's/:amd64://' | sort | uniq | while read n; do echo "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --> Usefullness of the package named $n:"; apt-cache search ^$n; echo "...which installs the following libraries on the system:"; dpkg -L $n |grep .so; echo "...and which depends itself on the following packages on the system:"; apt show $n | grep Depends; done;<br />
<br />
==== Creating a source and binary package ====<br />
<br />
Linux distributions only accept RPM packages that can build the software. This will probably require creating build scripts and/or a Makefile. For more information see the section [[#Creating_a_Makefile_for_your_Lazarus_software|Creating a Makefile for your Lazarus software]]. <br />
<br />
You need to use the %build section to compile the software. Below is an example of a spec file capable of building the software. Be very careful when studying this as every little detail is important and follows a precise pattern.<br />
<br />
<syntaxhighlight lang=text><br />
Name: magnifier<br />
Version: 3.2.1<br />
Release: 1 <br />
Summary: Virtual Magnifying Glass<br />
Group: Accessibility<br />
License: GPL Version 2<br />
URL: http://magnifier.sourceforge.net<br />
Source0: http://internap.dl.sourceforge.net/sourceforge/magnifier/magnifier-3.2.1.zip<br />
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)<br />
BuildRequires: fpc >= 2.0.2, lazarus >= 0.9.12<br />
Requires: ImageMagick<br />
<br />
%description<br />
Virtual Magnifying Glass is a free, open source, multiplatform, screen magnification tool. It is simple, customizable, and easy-to-use.<br />
<br />
%prep<br />
%setup -q magnifier<br />
%build<br />
make TARGET=%{_target_cpu}<br />
<br />
%install<br />
./install.sh DESTDIR=$RPM_BUILD_ROOT<br />
<br />
%clean<br />
rm -rf $RPM_BUILD_ROOT/<br />
<br />
%files<br />
%defattr(-,root,root,-)<br />
/usr/share/magnifier/<br />
/usr/bin/magnifier<br />
<br />
%changelog<br />
* Wed Feb 15 2006 Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com> - 3.2-mdk.i386.rpm<br />
- The Linux RPM package is created.<br />
</syntaxhighlight><br />
<br />
=== Creating a Debian Package on Linux ===<br />
<br />
Debian packages are similar to installers. They can be downloaded by users from a website or ftp. You can craft them manually from the binary file by using their [[Debian package structure|specific structure]] and a .deb extension. However, they will not be automatically included in Debian distributions.<br />
<br />
If you want to make a package available into Debian distributions, you need to provide a [[Debian upstream|source upstream]] that can generate the Debian package as well as other files like the .orig.tar.gz and .dsc file. Those will be necessary for anybody to build your package for their target platform.<br />
<br />
There is an IDE plugin here:<br />
https://github.com/prof7bit/LazPackager<br />
<br />
=== Creating a Pacman (Arch) Package ===<br />
<br />
Please see https://wiki.freepascal.org/pacman<br />
<br />
=== Automating the creation of RPM and DEB packages ===<br />
<br />
To simplify the work of creating RPM and DEB packages one can create a script which generates them, just like is done here:<br />
<br />
http://sourceforge.net/p/magnifier/code/HEAD/tree/trunk/build/build_package.sh<br />
<br />
=== Snap ===<br />
<br />
See [[Create snap package]].<br />
<br />
=== Flatpak ===<br />
<br />
See [[Flatpak]].<br />
<br />
=== GUInseng ===<br />
<br />
[http://www.guinseng.de/ GUInseng] is a a GTK+ based installer for Linux released under GPL.<br />
<br />
=== The Zero Install system ===<br />
<br />
[http://0install.net/ The Zero Install system] is a Python based install system that aims to provide a better way of installing software than traditional systems <br />
(tarballs, apt-get, bundles, setup.exe, etc).<br />
<br />
===Simple deployment of Lazarus application directly to Desktop Environment (e.g., KDE Plasma 5/Manjaro)===<br />
<br />
One of the first things anyone coming from Delphi/Windows environment wants to know is how to QUICKLY deploy a newly-created Linux GUI program outside of the IDE, without spending a lot of time having to first study various package management systems. Unlike Windows, Linux is a disparate collection of Distributions ("Distros" - e.g., Debian, Arch, Ubuntu, etc.) and Desktop Environments ("DE" - e.g., KDE, Gnome, XFCE, Mate, etc.) Deployment entails some knowledge of one's Disto and DE, however the learning curve and effort is a tiny fraction of the effort required to set up and use an installation package system (e.g., DEB or RPM installation systems). The following focuses on Manjaro (ArchLinux) Distribution running the KDE Plasma 5 Desktop Environment. <br />
Before getting started, the following are required. <br />
<br />
''Prerequisites''<br />
<br />
'''You must know the Path to your application's Binary.''' <br />
It will be located in the Target directory that you specified under ''Project Options''. If you just left default settings, the Binary will be located for example for Linux x86-64 target at: ''[...]/MyProgram/lib/x86_64-linux''. The file will generally not have any extension (no ''.exe'') and will have the same name as your Project. Linux executable binaries typically either have .bin extension or no extension.<br />
<br />
'''You must have sufficient rights to the file.'''<br />
By default, Lazarus should have created the file with your username and group as owner. If not for some reason, change ownership using ''chown'' terminal command or file manager, if available. (KDE Dolphin no longer allows ''sudo'' changes within the file manager.)<br />
<br />
'''The file must be executable.'''<br />
Lazarus should have already set the file to be executable, but if not, change this using ''chmod'' or file manager, if available.<br />
<br />
'''As inital test, make sure your application can be launched directly from the Terminal.'''<br />
For example, within the same directory as you application binary (e.g., MyProgram) execute:<br />
<syntaxhighlight lang="bash"><br />
$ ./MyProgram<br />
</syntaxhighlight><br />
Make sure you can launch your application from Terminal before proceeding.<br />
<br />
''Desktop entries''<br />
<br />
To get your application to correctly launch in your Desktop Environment, you have to tell it some information by way of creating a ''Desktop Entry'' file ending in ''.desktop'' extension. This is simply a text file located in a particular directory and having specific keys. For Manjaro/ArchLinux, the following is helpful reference material:<br />
<br />
ArchLinux Desktop Entries [https://wiki.archlinux.org/index.php/Desktop_Entries]<br />
<br />
The foregoing is simply a guide, not to be taken too literally. For example, for KDE Plasma 5 on Manjaro, use of separate Path and Exec keys does NOT work. Instead, a single Exec with the application binary's full path is required. You can uncover such details and quirks by examining the existing .desktop files of other applications already installed for your particular Distro and DE.<br />
<br />
Using the example of KDE Plasma 5 on Manjaro, proceed as follows, using hypothetical ''MyApp'' application program just created with Lazarus. Determine the location for ''.desktop'' files. For Manjaro, these were found to be at ''/usr/share/applications/''. Now, create your ''.desktop'' file:<br />
<syntaxhighlight lang="bash"><br />
$ sudo nano /usr/share/applications/myapp.desktop<br />
</syntaxhighlight><br />
By convention, use lowercase for the foregoing file name. Now, enter your application details (using hypothetical "MyApp" application binary). <br />
<syntaxhighlight lang="bash"><br />
[Desktop Entry]<br />
Type=Application<br />
# Change Name to your application<br />
Name=My Application<br />
# Change icon to your icon - leave OFF any file extension<br />
Icon=myappicon<br />
Comment=My First App<br />
# The FULL path to the folder in which the executable is run<br />
# Change to your actual application binary's full path<br />
Exec=/mysamplepath/Lazarus/MyApp/lib/x86_64-linux/MyApp<br />
Terminal=false<br />
# Sample Category - will determine where it is listed in Menu tree<br />
Categories=Office;<br />
</syntaxhighlight><br />
You will be storing your icon separately, as required by your DE, so that it may be displayed in the DE's menu along with your application name. In Manjaro, icons are required to be placed at ''/usr/share/pixmaps''. If needed, a good source for icons is available at:<br />
Open Icon Library [https://sourceforge.net/projects/openiconlibrary/]<br />
For KDE Plasma 5 on Manjaro, 48x48 PNGs work well. Note that you must leave .png extension off above icon reference to avoid validation errors.<br />
Now validate your Desktop Entry file:<br />
<syntaxhighlight lang="bash"><br />
$ sudo desktop-file-validate /usr/share/applications/myapp.desktop<br />
</syntaxhighlight><br />
Correct any errors. <br />
Finally, complete installation by updating the DE's desktop database:<br />
<syntaxhighlight lang="bash"><br />
$ sudo update-desktop-database<br />
</syntaxhighlight><br />
Your application should now be listed in KDE's menu tree and easily launched with mouse click. If you need to clean up KDE's menu (e.g., delete incorrect menu item), launch ''kmenuedit'' from Terminal or right click (if available) directly on menu item.<br />
<br />
=== See also ===<br />
<br />
* [[Create snap package|How to create an Ubuntu snap package]]<br />
* [[Publish project on Launchpad]]<br />
<br />
== Creating a Makefile for your Lazarus software ==<br />
<br />
The following is a command line build system for a Lazarus software. This is particularly useful if you wish to create an RPM package suitable for including on GNU/Linux distributions. The comments on the files should explain what each part does.<br />
<br />
make.sh<br />
<br />
<syntaxhighlight lang=bash><br />
# Detects and parses the architecture<br />
ARCH=$(uname -m)<br />
<br />
case "$ARCH" in<br />
"i686") ARCH="i386";;<br />
"i586") ARCH="i386";;<br />
"i486") ARCH="i386";;<br />
esac<br />
<br />
echo "Target architecture: $ARCH"<br />
<br />
# Detects and parses the OS<br />
OS="linux"<br />
<br />
echo "Target operating system: $OS"<br />
<br />
# Command line to build the sofware<br />
fpc -S2cgi -OG1 -gl -WG -vewnhi -l -Fu/usr/lib/lazarus/components/opengl/gtk2x11/ -Fi/usr/lib/lazarus/components/opengl/gtk2x11/include/ -Fu/usr/lib/lazarus/components/jpeg/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/gtk2/ -Fu/usr/lib/lazarus/packager/units/$ARCH-$OS/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr<br />
</syntaxhighlight><br />
<br />
install.sh<br />
<br />
<syntaxhighlight lang=bash><br />
# Parses command line options. Currently supported options are:<br />
# DESTDIR Destination root directory<br />
<br />
DESTDIR=""<br />
<br />
for arg; do<br />
case $arg in<br />
DESTDIR=*) DESTDIR=${arg#DESTDIR=};;<br />
esac;<br />
done<br />
<br />
# Does the install<br />
# "mkdir -p" is equivalent to ForceDirectories Pascal function<br />
<br />
mkdir -p $DESTDIR/usr/share/magnifier<br />
<br />
cp ./topleft.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./topright.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./bottomleft.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./bottomright.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./top.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./left.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./bottom.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./right.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./icon3.ico $DESTDIR/usr/share/magnifier/<br />
<br />
mkdir -p $DESTDIR/usr/bin<br />
<br />
cp ./magnifier $DESTDIR/usr/bin/<br />
</syntaxhighlight><br />
<br />
clean.sh<br />
<br />
<syntaxhighlight lang=bash>rm -rf *.o<br />
rm -rf *.ppu<br />
rm -rf *.pas~<br />
rm -rf *.sh~<br />
rm -rf *.bak<br />
rm -rf *~<br />
rm -rf magnifier<br />
</syntaxhighlight><br />
<br />
uninstall.sh<br />
<br />
<syntaxhighlight lang=bash>#<br />
# Don´t use "rm -rf" in here, because you should only remove the files you created<br />
rm -f /usr/share/magnifier/topleft.bmp<br />
rm -f /usr/share/magnifier/topright.bmp<br />
rm -f /usr/share/magnifier/bottomleft.bmp<br />
rm -f /usr/share/magnifier/bottomright.bmp<br />
rm -f /usr/share/magnifier/top.bmp<br />
rm -f /usr/share/magnifier/left.bmp<br />
rm -f /usr/share/magnifier/bottom.bmp<br />
rm -f /usr/share/magnifier/right.bmp<br />
rm -f /usr/share/magnifier/icon3.ico<br />
rm -f /usr/share/magnifier/magnifier<br />
rm -f /usr/bin/magnifier<br />
rmdir /usr/share/magnifier<br />
</syntaxhighlight><br />
<br />
Makefile<br />
<br />
<syntaxhighlight lang=bash><br />
# Targets<br />
# The First target is the one build when there is nothing on make command line<br />
all:<br />
./make.sh<br />
clean:<br />
./clean.sh<br />
install:<br />
./install.sh<br />
uninstall:<br />
./uninstall.sh<br />
</syntaxhighlight><br />
<br />
== macOS Deployment ==<br />
<br />
=== An Application Bundle ===<br />
<br />
See [[Application Bundle]] for information on how to create an application bundle (a directory with application files that is treated by macOS as an executable).<br />
<br />
Most macOS applications are distributed as a disk image file (.dmg extension). Normally you download or copy a program's disk image to your Mac and double-click it. This mounts the disk image and opens a window on the desktop, where you'll typically see an application bundle as described in the previous point. To install, a user simply drags the bundle to the hard drive, typically into his or the general Applications folder. Therefore, many disk images present a link to the general Applications folder for easier dragging. "Uninstalling" is by deleting the bundle. <br />
<br />
Once the installation is complete, you eject (unmount) the mounted disk image, for example by dragging it to the trash. You can also delete the .dmg file by dragging it to the trash as well.<br />
<br />
Your bonus point is, if the application can also run directly from the (read-only) disk image.<br />
<br />
Here is the <tt>app2dmg.sh</tt> script which I use to create a .dmg file for an application bundle:<br />
<br />
<syntaxhighlight lang=sh><br />
#!/bin/sh<br />
<br />
if [ "${1}" = "" ]<br />
then<br />
echo "Usage: app2dmg.sh app_name.app disk_size_in_mb"<br />
exit<br />
fi<br />
<br />
if [ "${2}" = "" ]<br />
then<br />
echo "Usage: app2dmg.sh app_name.app disk_size_in_mb"<br />
exit<br />
fi<br />
<br />
if [ ! -r "${1}" ]<br />
then<br />
echo "${1} is not in the current directory!"<br />
exit<br />
fi<br />
<br />
APP=`echo "${1}" | sed "s/\.app//"`<br />
DATE=`date "+%d%m%Y"`<br />
VOLUME="${APP}_${DATE}"<br />
<br />
echo "Application name: ${APP}"<br />
echo "Volume name: ${VOLUME}"<br />
<br />
if [ -r ${APP}*.dmg.sparseimage ]<br />
then<br />
rm ${APP}*.dmg.sparseimage<br />
fi<br />
<br />
hdiutil create -size ${2}M -type SPARSE -volname "${VOLUME}" -fs HFS+ ${VOLUME}.dmg<br />
<br />
hdiutil attach ${VOLUME}.dmg.sparseimage<br />
cp -R ${APP}.app "/Volumes/${VOLUME}/"<br />
cp README_FIRST.TXT "/Volumes/${VOLUME}/"<br />
hdiutil detach -force "/Volumes/${VOLUME}"<br />
<br />
hdiutil convert "${VOLUME}.dmg.sparseimage" -format UDBZ -o "${VOLUME}.dmg" -ov -imagekey zlib-level=9<br />
rm ${VOLUME}*.dmg.sparseimage<br />
</syntaxhighlight><br />
<br />
You can also read [http://el-tramo.be/guides/fancy-dmg this guide] for how to create a fancy disk image.<br />
<br />
=== Using Packages on macOS ===<br />
<br />
The Apple <tt>pkgbuild</tt> and <tt>productbuild</tt> command line tools can produce package .pkg files or the aptly named, third party GUI [http://s.sudre.free.fr/Software/Packages/about.html <tt>Packages</tt>] application which builds flat packages (cf bundle-style packages built by the same author's GUI [http://s.sudre.free.fr/Software/Iceberg.html <tt>Iceberg</tt>] application. <br />
<br />
If you absolutely require that several files are installed in different locations, then (and only then!) should you create a package file (.pkg extension) for the Apple Installer. This package file can then be moved, downloaded or emailed. Once the end user has it, they can double-click the package and the <tt>Installer.app</tt>, which will perform the installation, is launched.<br />
<br />
Package files have certain advantages:<br />
* You have control over permissions;<br />
* Multiple files can be placed in different locations;<br />
* You can run scripts as part of the installation process;<br />
* A logged-in user is not needed to install a package;<br />
* Most, if not all, Mac management systems can install Apple installer packages.<br />
<br />
The installer .pkg file is actually a directory, as is the resulting application bundle (.app extension) that it copies to the Applications folder. To the user, .pkg and .app files look and act like ordinary files, but they're really directories whose details have been hidden from the user. You can see what's inside a .pkg or .app file by entering normal <tt>cd</tt> commands in a Terminal window (for example, <tt>cd progname.app</tt>) or by Ctrl-Clicking the file and choosing ''Show Package Contents'' from the popup menu.<br />
<br />
To create a .dmg file, run the macOS Disk Utility (located in Applications > Utilities). Select Images > New > Image from Folder and choose the folder containing your .pkg file and any other files you want to include in the disk image. In the Convert Image dialog, enter the name of the .dmg file to create, select where it should be saved, and select "compressed" as the image format. The .dmg file that Disk Utility creates is then ready for distribution.<br />
<br />
=== Installing X11 and GTK on macOS ===<br />
<br />
GUI apps created with Lazarus that use the GTK widgetset require X11 and the GTK libraries to run. The [https://www.xquartz.org XQuartz open source project] <tt>X11.app</tt> was shipped with Leopard 10.5 through Lion 10.7 as an optional installation. After Lion 10.7, Apple stopped providing X11 but it can still be downloaded from the XQuartz project website.<br />
<br />
To install the GTK libraries on a user's system, you should include instructions for using [http://www.finkproject.org/ Fink] or [http://www.macports.org/ MacPorts]. Do ''not'' manually package the libraries and install those in the default Fink/MacPorts locations, because then they may be overwritten in case the user decides to install one of these distributions. A good practice is to put those libraries in the application bundle itself, which requires [http://qin.laya.com/tech_coding_help/dylib_linking.html using the install_name_tool] program. Putting them somewhere else is possible, but in most cases not conform to the Apple Guidelines as well as not what users expect. Before simply using directories common to other systems, you should carefully read the guidelines about the file system layout [http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html File System Overview].<br />
<br />
=== Code signing and Notarization ===<br />
<br />
See [[Code Signing for macOS]] (required from macOS 10.7+) and [[Notarization for macOS 10.14.5+|Notarization for macOS]] (required from macOS 10.14.5+). <br />
<br />
Note: It is still possible not to code sign and notarise your applications if you do not mind your endusers facing scary warning dialogs from Apple - Gatekeeper can (still) be by-passed by Conctrol-Clicking on the application or right clicking on the application for the context menu, and then choosing ''Open'' and not ''Move to trash'' or ''Cancel''. Notarization requires you to enrol in the [https://developer.apple.com/programs/ Apple Developer Program] ($US 99 annually).<br />
<br />
=== See also ===<br />
<br />
* [https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/SoftwareDistribution4/Introduction/Introduction.html Apple's Software Delivery Legacy Guide].<br />
<br />
* [https://github.com/unixorn/luggage/wiki The Luggage] Uses a Makefile describing where you want each file in the package to end up on the target machines with rules that will generate a package root with appropriate permissions, copy the files into place, create a package version-stamped with the date, then wrap the package in a disk image file. This allows packages to be built in a consistent and repeatable way using source files and scripts.<br />
<br />
* [https://github.com/munki/munki-pkg munkipkg] is a simple tool for building packages in a consistent, repeatable manner from source files and scripts in a project directory. Files, scripts, and metadata are stored in a way that is easy to track and manage using a version control system like git.<br />
<br />
* [[macOS PackageMaker]] - legacy - discontinued after Xcode 4.4.<br />
<br />
== Android Deployment ==<br />
<br />
(This information needs to be consolidated here and the below links adjusted)<br />
* [[Android]]<br />
* [[FPC JVM Android Development]]<br />
* [[Android Programming]]<br />
<br />
== Apple iOS Deployment ==<br />
<br />
(This information needs to be consolidated here and the below links adjusted)<br />
* [[iOS Designer]]<br />
* [[Portal:iOS|iOS Portal]]<br />
* [[iPhone/iPod development]]<br />
<br />
== Other, General Cross-Platform Deployment ==<br />
<br />
=== BitRock ===<br />
<br />
[[File:gui-newproject.png||600px]]<br />
<br />
[[BitRockInstallBuilder|Bitrock]] (website www.bitrock.com) make an installer that will deploy to Windows, Mac OS and many flavors of Linux. If your application is open-source, they will give you a full license to download and use their 'InstallBuilder' application.[[http://installbuilder.bitrock.com/open-source-licenses.html Application form link]]. Commercial application licenses are available.<br />
<br />
=== fpGUI Installer ===<br />
<br />
This is a cross-platform CLI and GUI installer. It is loosely based on the concept of the Loki Installer (implemented in the C programming language) created by [http://www.lokigames.com/ Loki Games]. The difference being that fpGUI Installer is implemented from scratch using Object Pascal and the fpGUI Toolkit for the GUI parts. This installer is still under active development, but to date no public release has been made. A public release is planned though. No official name has been given to this project either - thus the not ideal "fpGUI Installer" name.<br />
<br />
Here is a screenshot of fpGUI Installer replacing the original Kylix 3 installer:<br />
[[File:fpgui_installer.png|right|fpGUI Installer|400px]]<br />
<br />
Features:<br />
* Installer setup is done via an easily managed XML file. A GUI front-end is used to edit the XML, but it can be done by hand too.<br />
* CD-ROM or Downloadable installers. The difference being that the CD-ROM installer is normally unpacked and multiple languages, tools etc are included. A Downloadable installer is a single file download and normally packaged for a specific language.<br />
* Automatic icon shortcut generation<br />
* No external libraries or runtime environments required. The idea is that a installer must not have system requirements (eg: a JVM or the Qt library etc), hence fpGUI toolkit was used for the GUI installer, because it talks directly to GDI or X11.<br />
* Command Line Installer and GUI Installer included as standard.<br />
* Support uninstall as well<br />
* fpGUI Installer has been tested on Windows (Win98 thru Win7), Linux (various distros), FreeBSD and OpenSolaris.<br />
* Supports 32-bit and 64-bit setup files.<br />
* Group installer mode: The installer can present a user friendly interface to install multiple other projects.<br />
* Customisable graphics banner and UI theme.<br />
<br />
=== InstallJammer ===<br />
<br />
InstallJammer is a multiplatform GUI installer designed to be completely cross-platform and function on Windows and most all versions of UNIX.<br />
<br />
InstallJammer features a very powerful install builder with support for multiple themes and a high level of configurability for installers. Installers are built as single executable files for easy distribution over the web and handle installing everything you need for your application in a simple, cross-platform way.<br />
*Active development of InstallJammer has been discontinued. The source is available for all versions and will always remain so, but your efforts might be better spent on an installer that is active in its development.<br />
*Download: https://sourceforge.net/projects/installjammer/files/InstallJammer/<br />
*Documentation: http://installjammer.com/docs/<br />
<br />
=== CMake/CPack ===<br />
<br />
CMake is a multiplatform build system that manages the compilation, linking, testing, and setup creation process. It is mainly intended for C/C++ software development, but can also be used for creating setups for Lazarus/FPC projects. The part of CMake that creates the setups is called CPack and is actually a front-end for other software packages that do the real work. In an FPC context, you would write a CMakeLists.txt file that contains lists of files to be installed and then have CPack call NSIS/WiX/... to perform the actual work.<br />
<br />
Features:<br />
* Windows (32+64 Bit), Linux, macOS support<br />
* Works with all important back-ends (NSIS, WiX, DEB...)<br />
* Just one text file CMakeLists.txt needs to be mainained for all target platforms<br />
* Multi-platform setups can be created with minimal work<br />
* Download: http://www.cmake.org/<br />
<br />
Using CMake/CPack makes most sense if you have a mixed-language project with Pascal and C/C++ parts that all go into one installer, and you need a platform-independent solution for both parts. If you have a pure FPC project, the overhead might be too much for you.</div>Chronoshttps://wiki.freepascal.org/index.php?title=Flatpack&diff=157733Flatpack2023-11-20T20:16:03Z<p>Chronos: Chronos moved page Flatpack to Flatpak: Corrected page name.</p>
<hr />
<div>#REDIRECT [[Flatpak]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Flatpak&diff=157732Flatpak2023-11-20T20:16:03Z<p>Chronos: Chronos moved page Flatpack to Flatpak: Corrected page name.</p>
<hr />
<div>Flathub offers a very limited number of "platforms" that your application needs to fit into. It does not offer a GTK2 one but does have a QT5 one. However that platform does not contain all the libraries normally found on a Qt5 system so expect to have to bundle libraries into your Flatpack if your application makes use of other libraries.<br />
<br />
Does not sound like a very FPC/Lazarus (as it stands now) friendly environment but there are some of "our" applications there.<br />
<br />
=See also=<br />
<br />
* [[Deploying Your Application]]<br />
<br />
==External links==<br />
<br />
* [https://github.com/search?q=org%3Aflathub+lazbuild&type=code Existing flatpack projects built with Lazarus]<br />
* [https://flathub.org/ flathub.org]<br />
* [https://discourse.flathub.org/t/questions-on-building/1975 A forum Post]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Games&diff=156362Projects using Lazarus - Games2023-05-02T14:07:58Z<p>Chronos: </p>
<hr />
<div>{{Sidebar-LazProjects}}<br />
<br />
== 15-puzzle ==<br />
<br />
[[15-puzzle]] is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The object of the puzzle is to place the tiles in order by making sliding moves that use the empty space. <br />
<br />
[[image:puzzle15.png]]<br />
<br />
== 2048 ==<br />
<br />
[https://app.zdechov.net/2048 2048] is a Lazarus implementation of famous block sliding puzzle [https://en.wikipedia.org/wiki/2048_(video_game) video game].<br />
<br />
[[Image:2048.png|200px]]<br />
<br />
== Bomber Kat ==<br />
<br />
Commercial game developed with FPC for iOS (both arm and arm64 platforms are supported). [[ZenGL]] based. Lazarus has been used as a primary IDE. Link: [https://itunes.apple.com/app/bomber-kat/id1109783786?ls=1&mt=8 App Store]<br />
<br />
== C-evo: New Horizons ==<br />
<br />
[https://app.zdechov.net/c-evo C-evo: New Horizons] is a fork of the well designed turn-based empire building game [http://c-evo.org/ C-evo] inspired by Civilization II game. It was originally developed for Windows using Delphi 4 but later fully porter to Lazarus to support also Linux.<br />
<br />
[[File:C-evo start.png|border|270px]]<br />
[[File:C-evo game.png|border|270px]]<br />
[[File:C-evo game2.jpg|border|270px]]<br />
<br />
== Castle Game Engine ==<br />
<br />
[[Castle Game Engine]] ([http://castle-engine.sourceforge.net/ project page]) is a 3D open-source game engine. The engine was developed from the beginning using Free Pascal (we have also Lazarus components) in nice and clean ObjectPascal code. We support many 3D model formats, including [http://castle-engine.sourceforge.net/vrml_x3d.php VRML/X3D], Collada, 3DS and many others. Tools and games using the engine include: <br />
* [http://castle-engine.sourceforge.net/view3dscene.php view3dscene - 3D model viewer, VRML/X3D browser], <br />
* [http://castle-engine.sourceforge.net/castle.php The Castle - FPS game in a dark fantasy world], <br />
* [http://castle-engine.sourceforge.net/darkest_before_dawn.php Darkest Before the Dawn - small scary 3D game for standalone and Android (also on Google Play)]<br />
<br />
== Common Loon Hearts ==<br />
<br />
[https://web.ncf.ca/di874/computers/hearts/hearts.html Common Loon Hearts] is the card game Hearts. It is written in Free Pascal with the Lazarus IDE for Windows and Linux. Source code is available [https://github.com/oldgizahub/hearts here].<br />
<br />
[[Image:hearts_screen.png|320px]]<br />
<br />
== DMines ==<br />
<br />
[http://dmines.sourceforge.net/ DMines] is an edition of the classic game Minesweeper with a dynamic twist, unrevealed mines can change location every set number of seconds.<br />
<br />
[[Image: DMinesExample.jpg|400px]]<br />
<br />
== Dreams of a Geisha ==<br />
<br />
Take a journey through the magical and wonderful world of Geisha. Help Ichisumi in this incredible adventure to reopen the temples of Geisha and restore a world of beauty and passion. Dive into this engaging Match 3 game with beautiful scenery and relaxing music. Overcome obstacles, collect puzzle pieces, and be prepared to solve challenging puzzles in [http://www.dreamsofageisha.com Dreams of a Geisha]!<br />
<br />
Powered by Lazarus FPC, [http://www.zengl.org/ ZenGL], [http://www.phoenixlib.net/ PhoenixLib], [http://www.lua.org/ LUA] and [http://www.codeandweb.com/texturepacker TexturePacker]. Developed by [http://www.greensaucegames.com Green Sauce Games] and Released by [http://www.bigfishgames.com Big Fish Games].<br />
<br />
Demo available for [http://www.bigfishgames.com/download-games/12814/dreams-of-a-geisha/index.html Windows], [http://www.bigfishgames.com/download-games/13045/mac/dreams-of-a-geisha/index.html Mac], [http://itunes.apple.com/us/app/dreams-of-a-geisha/id460180656?mt=8 iPhone], [http://itunes.apple.com/us/app/dreams-of-a-geisha-hd/id459801505?mt=8 iPad].<br />
<br />
[[File:Dreams of a Geisha - Screenshot 1.jpg|border|270px]]<br />
<br />
== Eschecs ==<br />
<br />
[https://github.com/rchastain/eschecs Eschecs] is an application to play chess against different artificial opponents. ''Eschecs'' uses the [[fpGUI]] Toolkit, and the [[uos]] and [[BGRABitmap]] libraries.<br />
<br />
[[Image:eschecs500f.png|300x300px]] <br />
<br />
== Fairtris ==<br />
<br />
[https://github.com/furious-programming/Fairtris Fairtris] is a video game, a clone of the 32-year-old [https://en.wikipedia.org/wiki/Tetris_(NES_video_game) Tetris®] game produced by [https://www.nintendo.com Nintendo] for the [https://en.wikipedia.org/wiki/Nintendo_Entertainment_System Famicom] and [https://en.wikipedia.org/wiki/Nintendo_Entertainment_System NES] consoles, designed for modern Windows systems. Fairtris is not an emulator — it is a full-fledged game with OpenGL support via the [https://www.libsdl.org SDL library] (using the [https://github.com/PascalGameDevelopment/SDL2-for-Pascal SDL2-for-Pascal] headers). Thanks to this combination, it is super-fast and ultra-light. This project was initially created as a tool to test various RNG algorithms, but after some time it turned into a complete and rich video game and a knowledge base for those who would like to know more about the internal mechanisms of the classic version of this game. For more information, see the [https://github.com/furious-programming/Fairtris/wiki project wiki] on GitHub.<br />
<br />
'''Important features:'''<br />
<br />
* implementation of gameplay mechanics compatible with the [https://en.wikipedia.org/wiki/Tetris_(NES_video_game) Nintendo Tetris®] game,<br />
* [https://www.youtube.com/watch?v=JeccfAI_ujo DAS] mechanics fixed and spin buffering added, making the controls fabulously responsive,<br />
* extended mechanics with basic wall kick, hard-drop and multi-spawn soft-drop,<br />
* support for eight regional versions of the game, including original NTSC and PAL versions,<br />
* support for as many as seven random piece generators, including the classic RNG,<br />
* support for free marathon and speedrun modes, qualifications and matches with same piece set,<br />
* the ability to start the game from any level up to the killscreen,<br />
* the ability to play on a keyboard or any USB controller (with input mapping support),<br />
* supports window mode and exclusive video mode,<br />
* support for additional meters, such as TRT, BRN, as well as gain popup,<br />
* stores the best results for each game region and RNG type,<br />
* has a pause menu with the ability to quickly restart the game and change settings,<br />
* shows the game summary screen after each game,<br />
* support for two themes (minimalistic dark and classic skin),<br />
* possibility to use it with [https://nestrischamps.herokuapp.com NestrisChamps] and [https://maxoutclub.com MaxoutClub],<br />
* it's light and very fast — should run smoothly even on a heavily loaded PC,<br />
* it is fully portable, no installation required,<br />
* and many more!<br />
<br />
[[Image:Fairtris prime menu.png|240px]]<br />
[[Image:Fairtris gameplay.png|240px]]<br />
[[Image:Fairtris prime menu 2.png|240px]]<br />
[[Image:Fairtris gameplay 2.png|240px]]<br />
<br />
== fpChess ==<br />
<br />
[[fpChess]] is still under construction. It should support playing via the internet as well as against a computer AI. <br />
<br />
[[Image:Fpchess.png|240px]]<br />
<br />
== Game Maker ==<br />
<br />
[http://www.yoyogames.com/gamemaker Game Maker] allows you to make computer games using easy to learn drag-and-drop actions. You can create professional looking games within very little time. You can make games with backgrounds, animated graphics, music and sound effects, and even 3D games! And when you've become more experienced, there is a built-in programming language, which gives you the full flexibility of creating games with Game Maker. What is best, is the fact that Game Maker can be used free of charge.<br />
<br />
Originally written in Delphi, Lazarus/Free Pascal was used to port it from Win32 to macOS. Available for Windows desktop, macOS, Ubuntu, Android, iOS, tvOS, fireTV, Android TV, Microsoft UWP, HTML5, PlayStation 4, and Xbox One.<br />
<br />
== Hedge Wars ==<br />
<br />
[http://www.hedgewars.org/ Hedge Wars] is a worm-like game with very nice graphics and good AI. The game features typical worms gameplay including net play. The game itself is written in FPC while the config application is C++/Qt.<br />
<br />
[[Image: HedgeWarsPage.png|320px| HedgeWars Scene]]<br />
<br />
== JavaneseChess ==<br />
<br />
[https://bitbucket.org/leledumbo/javanese-chess JavaneseChess] is a Javanese chess game implementation. Available for Desktop platforms and Android (not feature complete yet).<br />
<br />
== Juegos Iniciales ==<br />
<br />
[http://juegosenlazaruscostarricenses.com Juegos Iniciales] are a small collection of 3D tutorial games in<br />
Lazarus, SDL and Free Pascal. In 2016, there were only four games:<br />
[http://origamisiniciales.juegosenlazaruscostarricenses.com Origamis Iniciales], <br />
[http://bloquesiniciales.juegosenlazaruscostarricenses.com Bloques Iniciales], <br />
[http://nudosiniciales.juegosenlazaruscostarricenses.com Nudos Iniciales],<br />
[http://palitos-iniciales.juegosenlazaruscostarricenses.com Palitos Iniciales].<br />
<br />
== LazGobang ==<br />
<br />
[http://files.cnblogs.com/lazarus/LazGobang.rar LazGobang] is a Gobang game, powered by Lazarus and Free Pascal. <br />
<br />
== Lazarus Mazes ==<br />
<br />
The [https://github.com/eny-fpc/lazes Lazarus Mazes] program is a demonstration of how you can use Lazarus to create a maze. The maze generation is based on a [http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search depth-first backtracking] algorithm. As a bonus, a simple maze solver is also implemented that shows a route from the start of the maze to the exit.<br />
<br />
[[Image:mazedemo1.png|400px]]<br />
<br />
== LBP Level Logger ==<br />
<br />
[http://code.google.com/p/lbplevellogger/ LBP Level Logger] is a small system tray application designed to log [http://www.littlebigplanet.com/ LittleBigPlanet] level statistics from [http://lbp.me/ lbp.me] over time for graphing/visualisation. It is written in Free Pascal/Lazarus.<br />
<br />
[[File:lbplevellogger-screenshot.png]]<br />
<br />
== Lentil Wars ==<br />
<br />
[http://lwars.sourceforge.net/ Lentil Wars] is an arcade action game for Linux and Windows that is still under development. Players combat each other in multiple nicely designed levels. Lentil Wars can be played both on a single computer as well as over a network.<br />
<br />
[[Image:LentilWars.jpg|320px| Lentil Wars Scene]]<br />
<br />
== Mundo Medieval 3D MMORPG ==<br />
<br />
Featuring a virtual world of more than 1.000.000 m2, plus caves and hell sceneries, 17 NPCs, 21 kinds of monsters, including 7 bosses, 58 different items and 100 quests, this is a really large game made with Free Pascal/Lazarus. The project is 100% free software, both code and media are licensed under GPL. The project sites are [http://www.gamemundo.com/ http://www.gamemundo.com/] and [http://sourceforge.net/projects/gamemundo/ http://sourceforge.net/projects/gamemundo/].<br />
<br />
[[File:Mundo - Screenshot 1.png|border|270px]]<br />
[[File:Mundo - Screenshot 2.png|border|270px]]<br />
[[File:Mundo - Screenshot 3.png|border|270px]]<br />
<br />
== Peg Solitaire tutorial ==<br />
<br />
[[Peg Solitaire tutorial|Peg Solitaire]] serves as a game (Peg Solitaire) tutorial that aims at introducing the user to the basics of Lazarus application development. Source available.<br />
<br />
[[Image:tutpeg_solitaire.png|340px]]<br />
<br />
== Petris ==<br />
<br />
[[Petris]] is yet another Tetris clone. [https://github.com/eny-fpc/petris Source available].<br />
<br />
[[Image:petris.png|320px]]<br />
<br />
== Retro Ski Run ==<br />
<br />
[https://sourceforge.net/projects/retroskirun/ Retro Ski Run] is a simple ski game for Windows 32/64bit and Linux 32/64-bit.<br />
<br />
[[Image:ss_rsrStartScreen.jpg|border|270px]]<br />
<br />
== Robot - The Game ==<br />
<br />
[[Robot - The Game|Robot]] is a game in which you control a character through a world consisting of 5*5 rooms, each with 20*20 fields. Every field contains a special game object; this can be a wall, a bad robot who wants to kill you (because of the robots, the game is named Robot), a door (for each door, you need a special key) and so on. [https://sourceforge.net/projects/lazarus-ccr/files/Demos and examples/Robot 1.7/ Source available].<br />
<br />
[[Image:robot1.5-shot1.png|320px]]<br />
<br />
== Snake for ptcGraph ==<br />
<br />
[https://gitlab.com/rchastain/snake-ptcgraph Snake for ptcGraph] is a simple snake game based on the ptcGraph unit. Steer the snake with keyboard arrows and eat as many fruits as you can.<br />
<br />
[[Image:snake2.png|320px]]<br />
<br />
== TransLines ==<br />
<br />
[https://app.zdechov.net/translines TransLines] (Transit Lines) is a real-time metro building game with visual style of public transport maps. It runs on Windows, Linux and macOS (need to compile yourself for macOS).<br />
<br />
[[File:BitMetro_small.png|border|200px]]<br />
[[File:BigMetro_main.png|border|270px]]<br />
<br />
== UltraStar Deluxe ==<br />
<br />
[http://ultrastardx.sourceforge.net/ UltraStar Deluxe] is a free and open source karaoke game inspired by the Singstar™ game available on the Playstation®. It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of the singing. It is currently available for Windows, Linux, macOS and FreeBSD.<br />
<br />
[[Image:UltraStarDeluxeMainPage.png|400px|UltraStar Deluxe Main Page]] <br />
<br />
== ValisoaChess ==<br />
<br />
[https://sourceforge.net/projects/valisoachess/?source=directory ValisoaChess] is a chess game written in Free Pascal and Lazarus. The main goal is to create a simple yet powerful chess engine.<br />
<br />
[[Image:valisoachess.jpg|320px]]<br />
<br />
== Zen GL updated ==<br />
<br />
[https://sourceforge.net/p/zengllinux/code/ci/default/tree/ Zen GL] is a 2D game engine. Now Zen GL uses Steam Game Libraries. You can migrate your Delphi X or Image Sprite old 2D Delphi games with that Zen GL upgraded Game Engine. The Zen GL Linux packages are zgl.deb or zgl.rpm.<br />
<br />
And also an updated version of [https://github.com/Seenkao/New-ZenGL ZenGL] with support for Android and MacOS Cocoa. In Russian. Support for English is evolving. Inside there is a link to the iOS version but the new features are not included.<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Historical]]<br />
[[Category:Promotion]]<br />
[[Category:Software created with Lazarus]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Games]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=153975Create snap package2022-08-26T08:16:43Z<p>Chronos: Both Qt5 and Gtk2 are well supported by snaps. Not every application supports Qt5.</p>
<hr />
<div>Snap is a containerized package format which allows the distribution of programs to all Linux distributions. A snap is in a container and has only explicitly defined access to the "outside world", e.g. some libraries of the system or the user's home directory. <br />
<br />
=Create snapcraft.yaml=<br />
<br />
* Install snapcraft to your Ubuntu machine with <code>sudo apt install snapcraft</code><br />
* Create '''snap''' subdirectory in your project<br />
* Execute <code>snapcraft init</code> to create '''snap/snapcraft.yaml''' initial file<br />
* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
* Adapt the file so that it contains all necessary instructions for building the Lazarus program snap.<br />
<br />
=Example files=<br />
<br />
==Qt5==<br />
<br />
The kde-neon extension and some tricks will help you to reduce the size of the Snap package to almost the normal binary size. The only thing to keep in mind is that Qt5 needs the libqt5pas-library. [https://forum.snapcraft.io/t/reduce-size-of-qt5-app-snap/31030 In a snapcraft forum post], we were figuring out how to create a small Lazarus Qt5 snap with all needed libraries included. You can find an example at the [https://github.com/reckel-jm/cantara/blob/master/snap/snapcraft.yaml Cantara project on Github] or check the instruction below.<br />
<br />
<pre><br />
name: myapp<br />
version: 'version'<br />
summary: any summary<br />
description: |<br />
Any description<br />
confinement: strict<br />
icon: path-to-logo.png<br />
base: core20<br />
grade: stable<br />
<br />
architectures:<br />
- build-on: amd64<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages:<br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
- build-essential<br />
- libqt5pas-dev<br />
stage-packages:<br />
- libqt5pas1<br />
- libxinerama1<br />
override-build: | <br />
lazbuild -B --ws=qt5 myapp.lpi <br />
# Here you have to install (or copy) all the files of your project which you would like to distribute to $SNAPCRAFT_PART_INSTALL/ e.g. the compiled binary, icons and language files<br />
cp -r languages $SNAPCRAFT_PART_INSTALL/<br />
install myapp $SNAPCRAFT_PART_INSTALL/<br />
install myapp.desktop $SNAPCRAFT_PART_INSTALL/<br />
install myapp.ico $SNAPCRAFT_PART_INSTALL/<br />
install myapp.png $SNAPCRAFT_PART_INSTALL/<br />
stage: <br />
- lib<br />
- usr<br />
- etc<br />
# make sure that you stage the files and folders to which you have installed (copied) above!<br />
- myapp<br />
- languages<br />
- myapp.desktop<br />
- myapp.ico<br />
- myapp.png<br />
cleanup: # this will make your snap small but keeps the needed libraries<br />
after: [myapp]<br />
plugin: nil<br />
build-snaps: [kde-frameworks-5-91-qt-5-15-3-core20]<br />
override-prime: |<br />
set -eux<br />
for snap in "kde-frameworks-5-91-qt-5-15-3-core20"; do # List all content-snaps you're using here<br />
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" "$SNAPCRAFT_PRIME/usr/{}" \;<br />
done<br />
for cruft in bug lintian man icons; do<br />
rm -rf $SNAPCRAFT_PRIME/usr/share/$cruft<br />
done<br />
find $SNAPCRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete<br />
find $SNAPCRAFT_PRIME/usr/share -type d -empty -delete<br />
find $SNAPCRAFT_PRIME/usr/lib -type f,l -name 'libQt*.so*' ! -name 'libQt5Pas*.so*' -delete<br />
<br />
apps:<br />
myapp:<br />
extensions:<br />
- kde-neon # Don't remove this extension for it provides access to Qt5!<br />
command: myapp # to change: the command on which the app gets started<br />
desktop: myapp.desktop # to change: the path to the desktop file which will be used to create the entry in the start menu etc.<br />
plugs:<br />
- home<br />
- network<br />
- network-bind<br />
</pre><br />
<br />
==GTK2==<br />
<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/bin/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/bin<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
<br />
* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
<br />
=Build Snap=<br />
<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with <code>sudo snap install --dangerous myapp_1.0.0_amd64.snap</code><br />
<br />
=Publish your package in Snap Store=<br />
<pre><br />
snapcraft register<br />
snapcraft login<br />
snapcraft upload myapp.snap<br />
snapcraft release myapp 1 stable<br />
</pre><br />
<br />
Now your snap should be released and available on '''snapcraft.io''' store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/lazarus-project_2.2.2-0_amd64.deb<br />
wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/fpc-laz_3.2.2-210709_amd64.deb<br />
wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/fpc-src_3.2.2-210709_amd64.deb<br />
apt install ./lazarus-project_2.2.2-0_amd64.deb ./fpc-laz_3.2.2-210709_amd64.deb ./fpc-src_3.2.2-210709_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
And remove normal Lazarus build-packages from your app so they are not installed for build:<br />
<pre><br />
myapp<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
</pre><br />
<br />
=GTK2 theme support=<br />
<br />
There is no snapcraft extension available for GTK2 similarly to GTK3. So GTK2 theming needs to be configured with additional lines.<br />
<br />
==Content plugs only==<br />
<br />
To support GTK2 themes used by host system the app needs to have access to GTK2 themes. Standard GTK2 themes can be made available by using content plugs. Those content plugs are external shared packages so they won't make snap bigger. But the application can still print some errors into console.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
layout:<br />
/usr/share/themes:<br />
bind: $SNAP/usr/share/themes<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0:<br />
bind: $SNAP/lib/gtk-2.0<br />
</pre><br />
<br />
==Full support==<br />
<br />
To fully support GTK2 environment we need to use snapcraft desktop helper and include various standard packages. Those packages make snap bigger by ~26 MB so there is a trade-off between size of snap packages and supported features.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
parts:<br />
desktop-gtk2:<br />
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git<br />
source-subdir: gtk<br />
plugin: make<br />
make-parameters: ["FLAVOR=gtk2"]<br />
build-packages:<br />
- build-essential<br />
- libgtk2.0-dev<br />
stage-packages:<br />
- libxkbcommon0 # XKB_CONFIG_ROOT<br />
- ttf-ubuntu-font-family<br />
- dmz-cursor-theme<br />
- light-themes<br />
- adwaita-icon-theme<br />
- gnome-themes-standard<br />
- shared-mime-info<br />
- libgtk2.0-0<br />
- libgdk-pixbuf2.0-0<br />
- libglib2.0-bin<br />
- libgtk2.0-bin<br />
- unity-gtk2-module<br />
- locales-all<br />
- libappindicator1<br />
- xdg-user-dirs<br />
- ibus-gtk<br />
- libibus-1.0-5<br />
myapp:<br />
after:<br />
- desktop-gtk2<br />
<br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
environment:<br />
XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS<br />
GTK_PATH: $SNAP/lib/gtk-2.0<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp<br />
command-chain:<br />
- bin/desktop-launch<br />
<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=OpenGL support=<br />
<br />
To support 3D acceleration it is required to use opengl plug, package related libraries and set correct path for drivers.<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- libglu1-mesa<br />
- libgl1-mesa-dri<br />
<br />
apps:<br />
myapp:<br />
plugs:<br />
- opengl<br />
<br />
environment:<br />
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri<br />
</pre><br />
<br />
=SDL support=<br />
<br />
Add needed build and stage packages.<br />
<br />
<pre><br />
parts:<br />
myapp:<br />
build-packages: <br />
- libsdl2-dev<br />
- libsdl2-mixer-dev<br />
- libsdl2-image-dev<br />
stage-packages:<br />
- libsdl2-2.0-0<br />
- libsdl2-image-2.0-0<br />
- libsdl2-mixer-2.0-0<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory=<br />
<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=152389Create snap package2022-06-20T18:53:43Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with <code>sudo apt install snapcraft</code><br />
* Create '''snap''' subdirectory in your project<br />
* Execute <code>snapcraft init</code> to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/bin/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/bin<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with <code>sudo snap install --dangerous myapp_1.0.0_amd64.snap</code><br />
<br />
=Publish your package in Snap Store=<br />
<pre><br />
snapcraft register<br />
snapcraft login<br />
snapcraft upload myapp.snap<br />
snapcraft release myapp 1 stable<br />
</pre><br />
<br />
Now your snap should be released and available on '''snapcraft.io''' store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/lazarus-project_2.2.2-0_amd64.deb<br />
wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/fpc-laz_3.2.2-210709_amd64.deb<br />
wget -nc https://downloads.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/fpc-src_3.2.2-210709_amd64.deb<br />
apt install ./lazarus-project_2.2.2-0_amd64.deb ./fpc-laz_3.2.2-210709_amd64.deb ./fpc-src_3.2.2-210709_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
And remove normal Lazarus build-packages from your app so they are not installed for build:<br />
<pre><br />
myapp<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
</pre><br />
<br />
=GTK2 theme support=<br />
<br />
There is no snapcraft extension available for GTK2 similarly to GTK3. So GTK2 theming needs to be configured with additional lines.<br />
<br />
==Content plugs only==<br />
<br />
To support GTK2 themes used by host system the app needs to have access to GTK2 themes. Standard GTK2 themes can be made available by using content plugs. Those content plugs are external shared packages so they won't make snap bigger. But the application can still print some errors into console.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
layout:<br />
/usr/share/themes:<br />
bind: $SNAP/usr/share/themes<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0:<br />
bind: $SNAP/lib/gtk-2.0<br />
</pre><br />
<br />
==Full support==<br />
<br />
To fully support GTK2 environment we need to use snapcraft desktop helper and include various standard packages. Those packages make snap bigger by ~26 MB so there is a trade-off between size of snap packages and supported features.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
parts:<br />
desktop-gtk2:<br />
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git<br />
source-subdir: gtk<br />
plugin: make<br />
make-parameters: ["FLAVOR=gtk2"]<br />
build-packages:<br />
- build-essential<br />
- libgtk2.0-dev<br />
stage-packages:<br />
- libxkbcommon0 # XKB_CONFIG_ROOT<br />
- ttf-ubuntu-font-family<br />
- dmz-cursor-theme<br />
- light-themes<br />
- adwaita-icon-theme<br />
- gnome-themes-standard<br />
- shared-mime-info<br />
- libgtk2.0-0<br />
- libgdk-pixbuf2.0-0<br />
- libglib2.0-bin<br />
- libgtk2.0-bin<br />
- unity-gtk2-module<br />
- locales-all<br />
- libappindicator1<br />
- xdg-user-dirs<br />
- ibus-gtk<br />
- libibus-1.0-5<br />
myapp:<br />
after:<br />
- desktop-gtk2<br />
<br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
environment:<br />
XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS<br />
GTK_PATH: $SNAP/lib/gtk-2.0<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp<br />
command-chain:<br />
- bin/desktop-launch<br />
<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=OpenGL support=<br />
<br />
To support 3D acceleration it is required to use opengl plug, package related libraries and set correct path for drivers.<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- libglu1-mesa<br />
- libgl1-mesa-dri<br />
<br />
apps:<br />
myapp:<br />
plugs:<br />
- opengl<br />
<br />
environment:<br />
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri<br />
</pre><br />
<br />
=SDL support=<br />
<br />
Add needed build and stage packages.<br />
<br />
<pre><br />
parts:<br />
myapp:<br />
build-packages: <br />
- libsdl2-dev<br />
- libsdl2-mixer-dev<br />
- libsdl2-image-dev<br />
stage-packages:<br />
- libsdl2-2.0-0<br />
- libsdl2-image-2.0-0<br />
- libsdl2-mixer-2.0-0<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=150787Create snap package2022-02-17T14:31:29Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with <code>sudo apt install snapcraft</code><br />
* Create '''snap''' subdirectory in your project<br />
* Execute <code>snapcraft init</code> to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/bin/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/bin<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with <code>sudo snap install --dangerous myapp_1.0.0_amd64.snap</code><br />
<br />
=Publish your package in Snap Store=<br />
<pre><br />
snapcraft register<br />
snapcraft login<br />
snapcraft upload myapp.snap<br />
snapcraft release myapp 1 stable<br />
</pre><br />
<br />
Now your snap should be released and available on '''snapcraft.io''' store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.0/lazarus-project_2.2.0-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.0/fpc-laz_3.2.2-210709_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.0/fpc-src_3.2.2-210709_amd64.deb<br />
apt install ./lazarus-project_2.2.0-0_amd64.deb ./fpc-laz_3.2.2-210709_amd64.deb ./fpc-src_3.2.2-210709_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
And remove normal Lazarus build-packages from your app so they are not installed for build:<br />
<pre><br />
myapp<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
</pre><br />
<br />
=GTK2 theme support=<br />
<br />
There is no snapcraft extension available for GTK2 similarly to GTK3. So GTK2 theming needs to be configured with additional lines.<br />
<br />
==Content plugs only==<br />
<br />
To support GTK2 themes used by host system the app needs to have access to GTK2 themes. Standard GTK2 themes can be made available by using content plugs. Those content plugs are external shared packages so they won't make snap bigger. But the application can still print some errors into console.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
layout:<br />
/usr/share/themes:<br />
bind: $SNAP/usr/share/themes<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0:<br />
bind: $SNAP/lib/gtk-2.0<br />
</pre><br />
<br />
==Full support==<br />
<br />
To fully support GTK2 environment we need to use snapcraft desktop helper and include various standard packages. Those packages make snap bigger by ~26 MB so there is a trade-off between size of snap packages and supported features.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
parts:<br />
desktop-gtk2:<br />
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git<br />
source-subdir: gtk<br />
plugin: make<br />
make-parameters: ["FLAVOR=gtk2"]<br />
build-packages:<br />
- build-essential<br />
- libgtk2.0-dev<br />
stage-packages:<br />
- libxkbcommon0 # XKB_CONFIG_ROOT<br />
- ttf-ubuntu-font-family<br />
- dmz-cursor-theme<br />
- light-themes<br />
- adwaita-icon-theme<br />
- gnome-themes-standard<br />
- shared-mime-info<br />
- libgtk2.0-0<br />
- libgdk-pixbuf2.0-0<br />
- libglib2.0-bin<br />
- libgtk2.0-bin<br />
- unity-gtk2-module<br />
- locales-all<br />
- libappindicator1<br />
- xdg-user-dirs<br />
- ibus-gtk<br />
- libibus-1.0-5<br />
myapp:<br />
after:<br />
- desktop-gtk2<br />
<br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
environment:<br />
XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS<br />
GTK_PATH: $SNAP/lib/gtk-2.0<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp<br />
command-chain:<br />
- bin/desktop-launch<br />
<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=OpenGL support=<br />
<br />
To support 3D acceleration it is required to use opengl plug, package related libraries and set correct path for drivers.<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- libglu1-mesa<br />
- libgl1-mesa-dri<br />
<br />
apps:<br />
myapp:<br />
plugs:<br />
- opengl<br />
<br />
environment:<br />
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri<br />
</pre><br />
<br />
=SDL support=<br />
<br />
Add needed build and stage packages.<br />
<br />
<pre><br />
parts:<br />
myapp:<br />
build-packages: <br />
- libsdl2-dev<br />
- libsdl2-mixer-dev<br />
- libsdl2-image-dev<br />
stage-packages:<br />
- libsdl2-2.0-0<br />
- libsdl2-image-2.0-0<br />
- libsdl2-mixer-2.0-0<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Editors_and_IDEs&diff=150769Projects using Lazarus - Editors and IDEs2022-02-17T08:42:47Z<p>Chronos: </p>
<hr />
<div>{{Sidebar-LazProjects}}<br />
== AksiIDE ==<br />
<br />
[http://www.aksiide.com AksiIDE] is a light freeware multi-platform text editor written in Lazarus.<br />
very useful for PHP developers. It has these features:<br />
* PHP Project Wizard<br />
* Portable Version Available<br />
* Live View Browser<br />
* Project Management<br />
* Class Generator<br />
* Integrated With Database Explorer (MySQL + Postgresql)<br />
* Database Browser<br />
* FTP Explorer<br />
* File Explorer<br />
* Code Explorer with Function List<br />
* Code Snippet<br />
* PHP Source Minifier<br />
* PHP Source Formatter<br />
* Syntax Checker<br />
* Multi Workspace Layout<br />
<br />
[[File:Aksi_IDE.jpeg|400px]]<br />
<br />
== Anoa-Code-Editor ==<br />
<br />
[http://anoa-projects.com/anoa-code-editor/ Anoa-Code-Editor] is easy, simple, & powerful code editor. It's '''FREE''' for you.<br />
<br />
[http://anoa-projects.com/anoa-code-editor/ Download]<br />
<br />
[[File:Anoa-Syntax-Editor.png|400px]]<br />
<br />
'''Why Anoa-Code-Editor?'''<br />
* '''Easy''' to install & easy to use.<br />
* '''Simple''' user interface and simple navigation.<br />
* '''Powerful''', support many popular languages & simply running code directly for selected languages.<br />
<br />
'''What can I do with Anoa-Code-Editor?'''<br />
* Open many kind of text files, especially for codes.<br />
* Edit multiple files at the same time.<br />
* Syntax highlighting and syntax completion for many popular languages.<br />
* Find and replace text with several options, including replace text with special character like carriage return or tab.<br />
* Folding code for better readability.<br />
* Easy drag for reordering tabs.<br />
* Working with theme you love.<br />
* Running code directly from app.<br />
<br />
== CudaText Editor ==<br />
<br />
[[CudaText]] is an advanced code editor for Windows, Linux, macOS.<br />
<br />
[[File:cudatext.png|400px]]<br />
<br />
== Dexed ==<br />
<br />
[https://gitlab.com/basile.b/dexed Dexed], the D Extended Editor, is an IDE for the [https://dlang.org/ D programming language], its compilers, tools and libraries. Overview:<br />
*available for Linux and Windows<br />
*supports all the D compilers (DMD, GDC, LDC)<br />
*supports DUB <br />
*full [https://github.com/dlang-community/DCD D Completion Daemon] integration<br />
*dynamic [https://github.com/dlang-community/D-Scanner D-Scanner] linting with results displayed in the editor gutter <br />
*debugging with GDB GUI on Linux<br />
*integrated terminal emulator on Linux with GTK2 widget set<br />
<br />
== Hagen - cross platform HTML generator ==<br />
<br />
[http://buch.im-ned.de/hagen Hagen] is a open source (LGPL) cross platform html generator (or client side CMS). It supports the web developer by generating a website and writing the pages. For that purpose Hagen will automate as much tasks as it can. Features:<br />
*project management <br />
**variables, functions and settings <br />
**template based and (page) divisions <br />
**source files (.source) for content <br />
*editor <br />
**syntax highlighting <br />
**Markdown <br />
**search over all pages <br />
**insert colors, images, tables and references <br />
*repository <br />
**for data exchange <br />
**for templates <br />
*automation <br />
**automate menu generating <br />
**internal and user defined variables and functions<br />
**printing page <br />
**generates whole website<br />
<br />
== Hex ==<br />
<br />
[https://github.com/wp-xyz/Hex/tree/master/source Hex] is an open source hex editor with some features which are useful for analyzing binary files ("reverse-engineering"):<br />
* ''Numeric viewer'': displays the byte selected by the cursor and the following bytes to standard Pascal numeric data types (byte, shortint, word, ..., singe, double, real48) as a usual number.<br />
* ''Record viewer'': allows to construct "records" from the basic Pascal types. The record elements are displayed in "human-readable" form. Commands are available to scroll through the file record by record.<br />
* ''Object viewer'': displays embedded images.<br />
<br />
[[Image:hex.png|400px]]<br />
<br />
== LazEdit ==<br />
<br />
[[LazEdit]] is a simple text editor with tabbed document interface, supporting various syntax highlighters. It also has built-in functions for editing HTML.<br />
<br />
== Mep LA ==<br />
<br />
[http://software.viamep.com/mepla/ Mep LA] is a simple and fast text editor. Key features: working with txt and html/php files, replacement and some customizable scripts with shortcuts. You can configure replacement and run it with a click or keyboard combination.<br />
<br />
== NotePas ==<br />
<br />
[https://github.com/beNative/notepas NotePas] is an open source multi-platform text editor written in Lazarus. It can be compiled for multiple platforms and widget sets. [https://sourceforge.net/projects/notepas/ Downloads].<br />
<br />
[[Image:notepas_-_code_folding.png|400px]]<br />
<br />
== PiNote ==<br />
<br />
[https://pinote.sourceforge.io/ PiNote] is a free source code editor that supports several languages. Running on Windows, Linux and Raspberry Pi. Written in free pascal and Lazarus IDE, use the SynEdit component with extended syntax highlighter modules. PiNote's many features include macro recording, code highlighting, encryption and/or decryption of text and files and more.<br />
<br />
[[Image:PiNote.png|400px]]<br />
<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Promotion]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Software created with Lazarus]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=File:PiNote.png&diff=150768File:PiNote.png2022-02-17T08:41:05Z<p>Chronos: </p>
<hr />
<div></div>Chronoshttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Games&diff=149226Projects using Lazarus - Games2022-01-12T13:18:52Z<p>Chronos: </p>
<hr />
<div>{{Sidebar-LazProjects}}<br />
<br />
== 15-puzzle ==<br />
<br />
[[15-puzzle]] is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The object of the puzzle is to place the tiles in order by making sliding moves that use the empty space. <br />
<br />
[[image:puzzle15.png]]<br />
<br />
== 2048 ==<br />
<br />
[https://app.zdechov.net/2048 2048] is a Lazarus implementation of famous block sliding puzzle [https://en.wikipedia.org/wiki/2048_(video_game) video game].<br />
<br />
[[Image:2048.png|200px]]<br />
<br />
== BigMetro ==<br />
<br />
[https://app.zdechov.net/BigMetro BigMetro] is metro building game inspired by [https://en.wikipedia.org/wiki/Mini_Metro_(video_game) MiniMetro] game. Runs on Windows, Linux and macOS (need to compile yourself for macOS).<br />
<br />
[[File:BitMetro_small.png|border|200px]]<br />
[[File:BigMetro_main.png|border|270px]]<br />
<br />
== Bomber Kat ==<br />
<br />
Commercial game developed with FPC for iOS (both arm and arm64 platforms are supported). [[ZenGL]] based. Lazarus has been used as a primary IDE. Link: [https://itunes.apple.com/app/bomber-kat/id1109783786?ls=1&mt=8 App Store]<br />
<br />
== C-evo: New Horizons ==<br />
<br />
[https://app.zdechov.net/c-evo C-evo: New Horizons] is a fork of the well designed turn-based empire building game [http://c-evo.org/ C-evo] inspired by Civilization II game. It was originally developed for Windows using Delphi 4 but later fully porter to Lazarus to support also Linux.<br />
<br />
[[File:C-evo start.png|border|270px]]<br />
[[File:C-evo game.png|border|270px]]<br />
[[File:C-evo game2.jpg|border|270px]]<br />
<br />
== Castle Game Engine ==<br />
<br />
[[Castle Game Engine]] ([http://castle-engine.sourceforge.net/ project page]) is a 3D open-source game engine. The engine was developed from the beginning using Free Pascal (we have also Lazarus components) in nice and clean ObjectPascal code. We support many 3D model formats, including [http://castle-engine.sourceforge.net/vrml_x3d.php VRML/X3D], Collada, 3DS and many others. Tools and games using the engine include: <br />
* [http://castle-engine.sourceforge.net/view3dscene.php view3dscene - 3D model viewer, VRML/X3D browser], <br />
* [http://castle-engine.sourceforge.net/castle.php The Castle - FPS game in a dark fantasy world], <br />
* [http://castle-engine.sourceforge.net/darkest_before_dawn.php Darkest Before the Dawn - small scary 3D game for standalone and Android (also on Google Play)]<br />
<br />
== Common Loon Hearts ==<br />
<br />
[https://web.ncf.ca/di874/computers/hearts/hearts.html Common Loon Hearts] is the card game Hearts. It is written in Free Pascal with the Lazarus IDE for Windows and Linux. Source code is available [https://github.com/oldgizahub/hearts here].<br />
<br />
[[Image:hearts_screen.png|320px]]<br />
<br />
== DMines ==<br />
<br />
[http://dmines.sourceforge.net/ DMines] is an edition of the classic game Minesweeper with a dynamic twist, unrevealed mines can change location every set number of seconds.<br />
<br />
[[Image: DMinesExample.jpg|400px]]<br />
<br />
== Dreams of a Geisha ==<br />
<br />
Take a journey through the magical and wonderful world of Geisha. Help Ichisumi in this incredible adventure to reopen the temples of Geisha and restore a world of beauty and passion. Dive into this engaging Match 3 game with beautiful scenery and relaxing music. Overcome obstacles, collect puzzle pieces, and be prepared to solve challenging puzzles in [http://www.dreamsofageisha.com Dreams of a Geisha]!<br />
<br />
Powered by Lazarus FPC, [http://www.zengl.org/ ZenGL], [http://www.phoenixlib.net/ PhoenixLib], [http://www.lua.org/ LUA] and [http://www.codeandweb.com/texturepacker TexturePacker]. Developed by [http://www.greensaucegames.com Green Sauce Games] and Released by [http://www.bigfishgames.com Big Fish Games].<br />
<br />
Demo available for [http://www.bigfishgames.com/download-games/12814/dreams-of-a-geisha/index.html Windows], [http://www.bigfishgames.com/download-games/13045/mac/dreams-of-a-geisha/index.html Mac], [http://itunes.apple.com/us/app/dreams-of-a-geisha/id460180656?mt=8 iPhone], [http://itunes.apple.com/us/app/dreams-of-a-geisha-hd/id459801505?mt=8 iPad].<br />
<br />
[[File:Dreams of a Geisha - Screenshot 1.jpg|border|270px]]<br />
<br />
== Eschecs ==<br />
<br />
[https://github.com/rchastain/eschecs Eschecs] is an application to play chess against different artificial opponents. ''Eschecs'' uses the [[fpGUI]] Toolkit, and the [[uos]] and [[BGRABitmap]] libraries.<br />
<br />
[[Image:eschecs500f.png|300x300px]] <br />
<br />
== Fairtris ==<br />
<br />
[https://github.com/furious-programming/Fairtris Fairtris] is a fair implementation of Classic Tetris® video game.<br />
<br />
[[Image:Fairtris prime menu.png|240px]]<br />
[[Image:Fairtris gameplay.png|240px]]<br />
[[Image:Fairtris prime menu 2.png|240px]]<br />
[[Image:Fairtris gameplay 2.png|240px]]<br />
<br />
== fpChess ==<br />
<br />
[[fpChess]] is still under construction. It should support playing via the internet as well as against a computer AI. <br />
<br />
[[Image:Fpchess.png|240px]]<br />
<br />
== Game Maker ==<br />
<br />
[http://www.yoyogames.com/gamemaker Game Maker] allows you to make computer games using easy to learn drag-and-drop actions. You can create professional looking games within very little time. You can make games with backgrounds, animated graphics, music and sound effects, and even 3D games! And when you've become more experienced, there is a built-in programming language, which gives you the full flexibility of creating games with Game Maker. What is best, is the fact that Game Maker can be used free of charge.<br />
<br />
Originally written in Delphi, Lazarus/Free Pascal was used to port it from Win32 to macOS. Available for Windows desktop, macOS, Ubuntu, Android, iOS, tvOS, fireTV, Android TV, Microsoft UWP, HTML5, PlayStation 4, and Xbox One.<br />
<br />
== Hedge Wars ==<br />
<br />
[http://www.hedgewars.org/ Hedge Wars] is a worm-like game with very nice graphics and good AI. The game features typical worms gameplay including net play. The game itself is written in FPC while the config application is C++/Qt.<br />
<br />
[[Image: HedgeWarsPage.png|320px| HedgeWars Scene]]<br />
<br />
== JavaneseChess ==<br />
<br />
[https://bitbucket.org/leledumbo/javanese-chess JavaneseChess] is a Javanese chess game implementation. Available for Desktop platforms and Android (not feature complete yet).<br />
<br />
== Juegos Iniciales ==<br />
<br />
[http://juegosenlazaruscostarricenses.com Juegos Iniciales] are a small collection of 3D tutorial games in<br />
Lazarus, SDL and Free Pascal. In 2016, there were only four games:<br />
[http://origamisiniciales.juegosenlazaruscostarricenses.com Origamis Iniciales], <br />
[http://bloquesiniciales.juegosenlazaruscostarricenses.com Bloques Iniciales], <br />
[http://nudosiniciales.juegosenlazaruscostarricenses.com Nudos Iniciales],<br />
[http://palitos-iniciales.juegosenlazaruscostarricenses.com Palitos Iniciales].<br />
<br />
== LazGobang ==<br />
<br />
[http://files.cnblogs.com/lazarus/LazGobang.rar LazGobang] is a Gobang game, powered by Lazarus and Free Pascal. <br />
<br />
== Lazarus Mazes ==<br />
<br />
The [https://github.com/eny-fpc/lazes Lazarus Mazes] program is a demonstration of how you can use Lazarus to create a maze. The maze generation is based on a [http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search depth-first backtracking] algorithm. As a bonus, a simple maze solver is also implemented that shows a route from the start of the maze to the exit.<br />
<br />
[[Image:mazedemo1.png|400px]]<br />
<br />
== LBP Level Logger ==<br />
<br />
[http://code.google.com/p/lbplevellogger/ LBP Level Logger] is a small system tray application designed to log [http://www.littlebigplanet.com/ LittleBigPlanet] level statistics from [http://lbp.me/ lbp.me] over time for graphing/visualisation. It is written in Free Pascal/Lazarus.<br />
<br />
[[File:lbplevellogger-screenshot.png]]<br />
<br />
== Lentil Wars ==<br />
<br />
[http://lwars.sourceforge.net/ Lentil Wars] is an arcade action game for Linux and Windows that is still under development. Players combat each other in multiple nicely designed levels. Lentil Wars can be played both on a single computer as well as over a network.<br />
<br />
[[Image:LentilWars.jpg|320px| Lentil Wars Scene]]<br />
<br />
== Mundo Medieval 3D MMORPG ==<br />
<br />
Featuring a virtual world of more than 1.000.000 m2, plus caves and hell sceneries, 17 NPCs, 21 kinds of monsters, including 7 bosses, 58 different items and 100 quests, this is a really large game made with Free Pascal/Lazarus. The project is 100% free software, both code and media are licensed under GPL. The project sites are [http://www.gamemundo.com/ http://www.gamemundo.com/] and [http://sourceforge.net/projects/gamemundo/ http://sourceforge.net/projects/gamemundo/].<br />
<br />
[[File:Mundo - Screenshot 1.png|border|270px]]<br />
[[File:Mundo - Screenshot 2.png|border|270px]]<br />
[[File:Mundo - Screenshot 3.png|border|270px]]<br />
<br />
== Peg Solitaire tutorial ==<br />
<br />
[[Peg Solitaire tutorial|Peg Solitaire]] serves as a game (Peg Solitaire) tutorial that aims at introducing the user to the basics of Lazarus application development. Source available.<br />
<br />
[[Image:tutpeg_solitaire.png|340px]]<br />
<br />
== Petris ==<br />
<br />
[[Petris]] is yet another Tetris clone. [https://github.com/eny-fpc/petris Source available].<br />
<br />
[[Image:petris.png|320px]]<br />
<br />
== Retro Ski Run ==<br />
<br />
[https://sourceforge.net/projects/retroskirun/ Retro Ski Run] is a simple ski game for Windows 32/64bit and Linux 32/64-bit.<br />
<br />
[[Image:ss_rsrStartScreen.jpg|border|270px]]<br />
<br />
== Robot - The Game ==<br />
<br />
[[Robot - The Game|Robot]] is a game in which you control a character through a world consisting of 5*5 rooms, each with 20*20 fields. Every field contains a special game object; this can be a wall, a bad robot who wants to kill you (because of the robots, the game is named Robot), a door (for each door, you need a special key) and so on. [https://sourceforge.net/projects/lazarus-ccr/files/Demos and examples/Robot 1.7/ Source available].<br />
<br />
[[Image:robot1.5-shot1.png|320px]]<br />
<br />
== Snake for ptcGraph ==<br />
<br />
[https://gitlab.com/rchastain/snake-ptcgraph Snake for ptcGraph] is a simple snake game based on the ptcGraph unit. Steer the snake with keyboard arrows and eat as many fruits as you can.<br />
<br />
[[Image:snake2.png|320px]]<br />
<br />
== UltraStar Deluxe ==<br />
<br />
[http://ultrastardx.sourceforge.net/ UltraStar Deluxe] is a free and open source karaoke game inspired by the Singstar™ game available on the Playstation®. It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of the singing. It is currently available for Windows, Linux, macOS and FreeBSD.<br />
<br />
[[Image:UltraStarDeluxeMainPage.png|400px|UltraStar Deluxe Main Page]] <br />
<br />
== ValisoaChess ==<br />
<br />
[https://sourceforge.net/projects/valisoachess/?source=directory ValisoaChess] is a chess game written in Free Pascal and Lazarus. The main goal is to create a simple yet powerful chess engine.<br />
<br />
[[Image:valisoachess.jpg|320px]]<br />
<br />
== Zen GL updated ==<br />
<br />
[https://sourceforge.net/p/zengllinux/code/ci/default/tree/ Zen GL] is a 2D game engine. Now Zen GL uses Steam Game Libraries. You can migrate your Delphi X or Image Sprite old 2D Delphi games with that Zen GL upgraded Game Engine. The Zen GL Linux packages are zgl.deb or zgl.rpm.<br />
<br />
And also an updated version of [https://github.com/Seenkao/New-ZenGL ZenGL] with support for Android and MacOS Cocoa. In Russian. Support for English is evolving. Inside there is a link to the iOS version but the new features are not included.<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Historical]]<br />
[[Category:Promotion]]<br />
[[Category:Software created with Lazarus]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Games]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=File:Fairtris_gameplay_2.png&diff=149224File:Fairtris gameplay 2.png2022-01-12T13:16:56Z<p>Chronos: </p>
<hr />
<div></div>Chronoshttps://wiki.freepascal.org/index.php?title=File:Fairtris_prime_menu_2.png&diff=149223File:Fairtris prime menu 2.png2022-01-12T13:16:31Z<p>Chronos: </p>
<hr />
<div></div>Chronoshttps://wiki.freepascal.org/index.php?title=File:Fairtris_gameplay.png&diff=149222File:Fairtris gameplay.png2022-01-12T13:16:09Z<p>Chronos: </p>
<hr />
<div></div>Chronoshttps://wiki.freepascal.org/index.php?title=File:Fairtris_prime_menu.png&diff=149221File:Fairtris prime menu.png2022-01-12T13:15:11Z<p>Chronos: </p>
<hr />
<div></div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=149213Create snap package2022-01-12T10:16:26Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with <code>sudo apt install snapcraft</code><br />
* Create '''snap''' subdirectory in your project<br />
* Execute <code>snapcraft init</code> to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/bin/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/bin<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with <code>sudo snap install --dangerous myapp_1.0.0_amd64.snap</code><br />
<br />
=Publish your package in Snap Store=<br />
<pre><br />
snapcraft register<br />
snapcraft login<br />
snapcraft upload myapp.snap<br />
snapcraft release myapp 1 stable<br />
</pre><br />
<br />
Now your snap should be released and available on '''snapcraft.io''' store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/lazarus-project_2.0.12-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-laz_3.2.0-1_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-src_3.2.0-1_amd64.deb<br />
apt install ./lazarus-project_2.0.12-0_amd64.deb ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
And remove normal Lazarus build-packages from your app so they are not installed for build:<br />
<pre><br />
myapp<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
</pre><br />
<br />
=GTK2 theme support=<br />
<br />
There is no snapcraft extension available for GTK2 similarly to GTK3. So GTK2 theming needs to be configured with additional lines.<br />
<br />
==Content plugs only==<br />
<br />
To support GTK2 themes used by host system the app needs to have access to GTK2 themes. Standard GTK2 themes can be made available by using content plugs. Those content plugs are external shared packages so they won't make snap bigger. But the application can still print some errors into console.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
layout:<br />
/usr/share/themes:<br />
bind: $SNAP/usr/share/themes<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0:<br />
bind: $SNAP/lib/gtk-2.0<br />
</pre><br />
<br />
==Full support==<br />
<br />
To fully support GTK2 environment we need to use snapcraft desktop helper and include various standard packages. Those packages make snap bigger by ~26 MB so there is a trade-off between size of snap packages and supported features.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
parts:<br />
desktop-gtk2:<br />
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git<br />
source-subdir: gtk<br />
plugin: make<br />
make-parameters: ["FLAVOR=gtk2"]<br />
build-packages:<br />
- build-essential<br />
- libgtk2.0-dev<br />
stage-packages:<br />
- libxkbcommon0 # XKB_CONFIG_ROOT<br />
- ttf-ubuntu-font-family<br />
- dmz-cursor-theme<br />
- light-themes<br />
- adwaita-icon-theme<br />
- gnome-themes-standard<br />
- shared-mime-info<br />
- libgtk2.0-0<br />
- libgdk-pixbuf2.0-0<br />
- libglib2.0-bin<br />
- libgtk2.0-bin<br />
- unity-gtk2-module<br />
- locales-all<br />
- libappindicator1<br />
- xdg-user-dirs<br />
- ibus-gtk<br />
- libibus-1.0-5<br />
myapp:<br />
after:<br />
- desktop-gtk2<br />
<br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
environment:<br />
XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS<br />
GTK_PATH: $SNAP/lib/gtk-2.0<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp<br />
command-chain:<br />
- bin/desktop-launch<br />
<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=OpenGL support=<br />
<br />
To support 3D acceleration it is required to use opengl plug, package related libraries and set correct path for drivers.<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- libglu1-mesa<br />
- libgl1-mesa-dri<br />
<br />
apps:<br />
myapp:<br />
plugs:<br />
- opengl<br />
<br />
environment:<br />
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri<br />
</pre><br />
<br />
=SDL support=<br />
<br />
Add needed build and stage packages.<br />
<br />
<pre><br />
parts:<br />
myapp:<br />
build-packages: <br />
- libsdl2-dev<br />
- libsdl2-mixer-dev<br />
- libsdl2-image-dev<br />
stage-packages:<br />
- libsdl2-2.0-0<br />
- libsdl2-image-2.0-0<br />
- libsdl2-mixer-2.0-0<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=149212Create snap package2022-01-12T10:16:08Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with <code>sudo apt install snapcraft</code><br />
* Create '''snap''' subdirectory in your project<br />
* Execute <code>snapcraft init</code> to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/bin/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/bin<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with <code>sudo snap install --dangerous myapp_1.0.0_amd64.snap</code><br />
<br />
=Publish your package in Snap Store=<br />
<pre><br />
snapcraft register<br />
snapcraft login<br />
snapcraft upload myapp.snap<br />
snapcraft release myapp 1 stable<br />
</pre><br />
<br />
Now your snap should be released and available on '''snapcraft.io''' store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/lazarus-project_2.0.12-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-laz_3.2.0-1_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-src_3.2.0-1_amd64.deb<br />
apt install ./lazarus-project_2.0.12-0_amd64.deb ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
And remove normal Lazarus build-packages from your app so they are not installed for build:<br />
<pre><br />
myapp<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
</pre><br />
<br />
=GTK2 theme support=<br />
<br />
There is no snapcraft extension available for GTK2 similarly to GTK3. So GTK2 theming needs to be configured with additional lines.<br />
<br />
==Content plugs only==<br />
<br />
To support GTK2 themes used by host system the app needs to have access to GTK2 themes. Standard GTK2 themes can be made available by using content plugs. Those content plugs are external shared packages so they won't make snap bigger. But the application can still print some errors into console.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
layout:<br />
/usr/share/themes:<br />
bind: $SNAP/usr/share/themes<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0:<br />
bind: $SNAP/lib/gtk-2.0<br />
</pre><br />
<br />
==Full support==<br />
<br />
To fully support GTK2 environment we need to use snapcraft desktop helper and include various standard packages. Those packages make snap bigger by ~26 MB so there is a trade-off between size of snap packages and supported features.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
parts:<br />
desktop-gtk2:<br />
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git<br />
source-subdir: gtk<br />
plugin: make<br />
make-parameters: ["FLAVOR=gtk2"]<br />
build-packages:<br />
- build-essential<br />
- libgtk2.0-dev<br />
stage-packages:<br />
- libxkbcommon0 # XKB_CONFIG_ROOT<br />
- ttf-ubuntu-font-family<br />
- dmz-cursor-theme<br />
- light-themes<br />
- adwaita-icon-theme<br />
- gnome-themes-standard<br />
- shared-mime-info<br />
- libgtk2.0-0<br />
- libgdk-pixbuf2.0-0<br />
- libglib2.0-bin<br />
- libgtk2.0-bin<br />
- unity-gtk2-module<br />
- locales-all<br />
- libappindicator1<br />
- xdg-user-dirs<br />
- ibus-gtk<br />
- libibus-1.0-5<br />
myapp:<br />
after:<br />
- desktop-gtk2<br />
<br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
environment:<br />
XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS<br />
GTK_PATH: $SNAP/lib/gtk-2.0<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp<br />
command-chain:<br />
- bin/desktop-launch<br />
<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=OpenGL support=<br />
<br />
To support 3D acceleration it is required to use opengl plug, package related libraries and set correct path for drivers.<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- libglu1-mesa<br />
- libgl1-mesa-dri<br />
<br />
apps:<br />
myapp:<br />
plugs:<br />
- opengl<br />
<br />
environment:<br />
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri<br />
</pre><br />
<br />
=SDL support=<br />
<br />
Add needed build and stage packages.<br />
<br />
<pre><br />
parts:<br />
myapp:<br />
build-packages: <br />
- libsdl2-dev<br />
- libsdl2-mixer-dev<br />
- libsdl2-image-dev<br />
stage-packages:<br />
- libsdl2-2.0-0<br />
- libsdl2-image-2.0-0<br />
- libsdl2-mixer-2.0-0<br />
</pre><br />
<br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=148724Create snap package2021-12-22T13:57:21Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/bin/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/bin<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft upload myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 stable</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/lazarus-project_2.0.12-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-laz_3.2.0-1_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-src_3.2.0-1_amd64.deb<br />
apt install ./lazarus-project_2.0.12-0_amd64.deb ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
And remove normal Lazarus build-packages from your app so they are not installed for build:<br />
<pre><br />
myapp<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
</pre><br />
<br />
=GTK2 theme support=<br />
<br />
There is no snapcraft extension available for GTK2 similarly to GTK3. So GTK2 theming needs to be configured with additional lines.<br />
<br />
==Content plugs only==<br />
<br />
To support GTK2 themes used by host system the app needs to have access to GTK2 themes. Standard GTK2 themes can be made available by using content plugs. Those content plugs are external shared packages so they won't make snap bigger. But the application can still print some errors into console.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
layout:<br />
/usr/share/themes:<br />
bind: $SNAP/usr/share/themes<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0:<br />
bind: $SNAP/lib/gtk-2.0<br />
</pre><br />
<br />
==Full support==<br />
<br />
To fully support GTK2 environment we need to use snapcraft desktop helper and include various standard packages. Those packages make snap bigger by ~26 MB so there is a trade-off between size of snap packages and supported features.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
parts:<br />
desktop-gtk2:<br />
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git<br />
source-subdir: gtk<br />
plugin: make<br />
make-parameters: ["FLAVOR=gtk2"]<br />
build-packages:<br />
- build-essential<br />
- libgtk2.0-dev<br />
stage-packages:<br />
- libxkbcommon0 # XKB_CONFIG_ROOT<br />
- ttf-ubuntu-font-family<br />
- dmz-cursor-theme<br />
- light-themes<br />
- adwaita-icon-theme<br />
- gnome-themes-standard<br />
- shared-mime-info<br />
- libgtk2.0-0<br />
- libgdk-pixbuf2.0-0<br />
- libglib2.0-bin<br />
- libgtk2.0-bin<br />
- unity-gtk2-module<br />
- locales-all<br />
- libappindicator1<br />
- xdg-user-dirs<br />
- ibus-gtk<br />
- libibus-1.0-5<br />
myapp:<br />
after:<br />
- desktop-gtk2<br />
<br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
environment:<br />
XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS<br />
GTK_PATH: $SNAP/lib/gtk-2.0<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp<br />
command-chain:<br />
- bin/desktop-launch<br />
<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=148715Create snap package2021-12-20T21:55:03Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/bin<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/bin/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/bin<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft upload myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 stable</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/lazarus-project_2.0.12-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-laz_3.2.0-1_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-src_3.2.0-1_amd64.deb<br />
apt install ./lazarus-project_2.0.12-0_amd64.deb ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
And remove normal Lazarus build-packages from your app so they are not installed for build:<br />
<pre><br />
myapp<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
</pre><br />
<br />
=GTK2 theme support=<br />
<br />
There is no snapcraft extension available for GTK2 similarly to GTK3. So GTK2 theming needs to be configured with additional lines.<br />
<br />
==Content plugs only==<br />
<br />
To support GTK2 themes used by host system the app needs to have access to GTK2 themes. Standard GTK2 themes can be made available by using content plugs. Those content plugs are external shared packages so they won't make snap bigger. But the application can still print some errors into console.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
layout:<br />
/usr/share/themes:<br />
bind: $SNAP/usr/share/themes<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gtk-2.0:<br />
bind: $SNAP/lib/gtk-2.0<br />
</pre><br />
<br />
==Full support==<br />
<br />
To fully support GTK2 environment we need to use snapcraft desktop helper and include various standard packages. Those packages make snap bigger by ~26 MB so there is a trade-off between size of snap packages and supported features.<br />
<br />
Extend your snapcraft.yaml file with the following:<br />
<pre><br />
parts:<br />
desktop-gtk2:<br />
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git<br />
source-subdir: gtk<br />
plugin: make<br />
make-parameters: ["FLAVOR=gtk2"]<br />
build-packages:<br />
- build-essential<br />
- libgtk2.0-dev<br />
stage-packages:<br />
- libxkbcommon0 # XKB_CONFIG_ROOT<br />
- ttf-ubuntu-font-family<br />
- dmz-cursor-theme<br />
- light-themes<br />
- adwaita-icon-theme<br />
- gnome-themes-standard<br />
- shared-mime-info<br />
- libgtk2.0-0<br />
- libgdk-pixbuf2.0-0<br />
- libglib2.0-bin<br />
- libgtk2.0-bin<br />
- unity-gtk2-module<br />
- locales-all<br />
- libappindicator1<br />
- xdg-user-dirs<br />
- ibus-gtk<br />
- libibus-1.0-5<br />
myapp:<br />
after:<br />
- desktop-gtk2<br />
<br />
# Additional plugs to pick up the GTK theme and icons from the system<br />
plugs: <br />
icon-themes:<br />
interface: content<br />
target: $SNAP/data-dir/icons<br />
default-provider: gtk-common-themes<br />
sound-themes:<br />
interface: content<br />
target: $SNAP/data-dir/sounds<br />
default-provider: gtk-common-themes<br />
gtk-2-engines:<br />
interface: content<br />
target: $SNAP/lib/gtk-2.0<br />
default-provider: gtk2-common-themes:gtk-2-engines<br />
gtk-2-themes:<br />
interface: content<br />
target: $SNAP/usr/share/themes<br />
default-provider: gtk2-common-themes:gtk-2-themes<br />
<br />
environment:<br />
XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS<br />
GTK_PATH: $SNAP/lib/gtk-2.0<br />
<br />
apps:<br />
myapp:<br />
command: usr/bin/myapp<br />
command-chain:<br />
- bin/desktop-launch<br />
<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=148587Create snap package2021-12-15T08:34:59Z<p>Chronos: /* Use newer Lazarus version */</p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft upload myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 stable</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/lazarus-project_2.0.12-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-laz_3.2.0-1_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-src_3.2.0-1_amd64.deb<br />
apt install ./lazarus-project_2.0.12-0_amd64.deb ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
And remove normal Lazarus build-packages from your app so they are not installed for build:<br />
<pre><br />
myapp<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Business_Software&diff=148586Projects using Lazarus - Business Software2021-12-15T08:29:06Z<p>Chronos: List sorted and added vCardStudio.</p>
<hr />
<div>{{LanguageBar}}<br />
{{Sidebar-LazProjects}}<br />
== AddressBook ==<br />
<br />
[http://www.cnblogs.com/lazarus/articles/2051659.html AddressBook] using the Sqlite store data, Support for Simplified Chinese, Traditional Chinese, English three languages. Support the list shows, support to add, delete, right-click pop-up list menu to delete, change, check; Support importing csv, export csv file; import file format to export csv files can fill in; Contact the system into the same name as the default if there is to add a new record; Encoding exported file system based on user language encoding decisions; support the dynamic selection of countries or companies and added;<br />
support the department or group of dynamic selection and add; support the phonetic code or short code quick search contacts. For example: the Monkey King of the alphabet code, SWK. may enter the code in the alphabet Jane S, Sun will contact all the names are listed; [http://pic002.cnblogs.com/images/2011/300662/2011052008585591.png Screen Shot]<br />
<br />
== Bilancio Facile ==<br />
<br />
[http://www.magicdev.org Bilancio Facile] is a simple application to manage the family budget. Developed by Jonathan.<br />
<br />
[[Image:winprev.jpg|400px]]<br />
<br />
== BRP-Software ==<br />
<br />
[http://www.brp-software.com/ BRP-Software] is a powerful and extremely flexible ERP System, that uses the Firebird database as backend. The first major release is in use with several different database structures to handle the needs of different business types. We have seperate databases for container logistics, laser cut metal production, software distribution and computershops. All databases use the same base application written in Lazarus.<br />
<br />
BRP Software is currently only focusing on the German speaking market, but it is developed for international usage. We plan to publish an international version in second half of 2013. There is a special free version already called Personal edition available now. This has only one restriction: it can not be used with more than one network user. This version includes the computershop database out of the box.<br />
<br />
[[File:BRP.gif|400px]]<br />
<br />
== Contact Contacts ==<br />
<br />
[http://www.trustfm.net/GeneralTools/SoftwareContactContacts.php Contact Contacts] is a free of charge portable and secure '''organizer''' that supports bulk emails and SMS. All data is stored '''securely''' into an encrypted database. The '''documentation''' is located [http://www.trustfm.net/GeneralTools/SoftwareContactContacts.php?page=ContactContactsTutorial here]<br />
<br />
[[Image:ContactContactsWin7.png|400px]]<br />
<br />
== DJPDV - Software for cashier ==<br />
<br />
DJPDV is an application to use in sales cashiers, that was developed to cater all commercial establishments that seeking a practical solution, reliable and that, above all, is on accordance with all legal specifications. It's a robust software that have innovative technological features that will streamline the sales process, significantly. Overall, the system is completely intuitive and objective, and easy to understand for users. Official website: [http://www.djpdv.com.br/index.php www.djpdv.com.br]<br />
<br />
[[Image:djpdv-img1.png|400px]]<br />
<br />
== eMyCar-Monitor ==<br />
<br />
[http://users.atw.hu/tamascsorgo/ eMyCar-Monitor] is comprehensive car care & fleet information management software for Windows. You can follow and track all information about your vehicle with this free vehicle tracker software.<br />
<br />
[[Image:emycar.png|400px]]<br />
<br />
== Extended Man/XML Frames ==<br />
<br />
[http://bugs.freepascal.fr My projects] use [https://sourceforge.net/p/xml-frames-vrad-lazarus/code/ci/default/tree/README.md GNU GPL license].<br />
[http://hg.code.sf.net/u/matthieugiroux/extended Extended] is some data components packages or some INI packages. There is also a tree data [https://sourceforge.net/p/virtualdbtreeex/code/ci/default/tree/ selecting interface linked to data] or a [https://sourceforge.net/projects/obo-components-library/ Gantt chart]. They are interactives, visuals or hiddens. There is intuitive data relationships. It becomes BPM with XML Frames. You have file copying, extracting or traducing images. There is also un updating component with its INI creating project. You can also create reports from data.<br />
<br />
[http://www.manframes.fr Man Frames] is a set of data components. Some data and properties Forms can manage some diverse dataset's types. This project contains some data receive using asynchronous pull and multi-tiers link. An example creates easily your management project. This project uses [https://sourceforge.net/projects/xml-frames-vrad-lazarus/files Extended]. A [http://www.dtra.fr DTRA]'s [http://www.xmlframes.fr engine] creates a management project from [https://fr.wikipedia.org/wiki/Business_Process_Model_and_Notation BPMN 2 XML] W4 Express files. On Windows, Linux and MacOSX.<br />
<br />
[https://sourceforge.net/projects/xml-frames-vrad-lazarus/files/weo_firebird.tar.7z/download Some demos].<br />
<br />
[https://sourceforge.net/projects/cai/ MDA Extend]<br />
<br />
[[File:2010-10_extended.png|380px]][[File:2010-10 xmlframes.png|350px]]<br />
<br />
== FXGest ==<br />
<br />
[http://www.magicdev.org/fxgest FXGuest] is a simple application to manage the company budget. Based on Bilancio facile engine. Developed by Jonathan.<br />
<br />
[[Image:cliente.jpg|400px]]<br />
<br />
== Gestinux ==<br />
<br />
[https://gestinux.net/mediawiki/index.php?title=Main_Page&oldid=3787 Gestinux] is a small accounting and invoicing software, to enter moves and import in various formats, to reconcile, and to print usual reports. You can produce quotes, orders and invoices, record customer payments. It is translated into english, spanish and italian from french, and can easily be translated to other languages. It is possible to setup specific reports for various countries. It runs on Linux, Windows and macOS, using MySql, MariaDb and PostgreSQL. [MediaWiki website has been vandalised. Gestinux link changed to old unvandalised page.]<br />
<br />
== ID Validation ==<br />
<br />
[https://www.erpware.co/en/idvalidation/ ID Validation] is our User Interface for our ID Validation. ID Validation is an application for validating, purging and verification of master data.<br />
<br />
[[File:01-modules-vat-validation.png]]<br />
<br />
== MK Express ==<br />
<br />
[http://MKExpress.com MK Express], created by [http://balsa.co.nz Balsa software], is a multi-platform desktop application which designs Master Key locking systems. This standalone application calculates key codes and pinning to produce a non-hierarchal access control in a mechanical locking system. MK Express is available on Linux, Windows and macOS with a demo version for the Raspberry PI too.<br />
<br />
[[File:MKExpress_Locks.png|400px]]<br />
<br />
== opsi ==<br />
<br />
[http://opsi.org/ opsi] is an open source Client Management System for Windows clients and is based on Linux servers. Key features:<br />
* Automatic OS installation (unattended or image based)<br />
* Automatic software distribution and patch management<br />
* Hardware and software inventories<br />
* multiple location support<br />
<br />
opsi server runs on Debian, Ubuntu, OpenSuse, SLES, CentOS, UCS and RHEL. We use Lazarus for the component opsi-winst which is the script driven generic setup program which does all the installations and system manipulations on the windows boxes.<br />
<br />
== PARKEER == <br />
<br />
[http://www.parkeer.com.br PARKEER] is a commercial software for parking control.<br />
<br />
[[File:parkeer-software-estacionamentos-atendimento-caixa.jpeg|400px]]<br />
<br />
== Rednaxel RNGE3 ==<br />
<br />
[http://rednaxel.com/software/ RNGE3] is a Small-Medium Business ERP System (with WMS module) for Brazilian companies. It emits Nota Fiscal Eletronica, the government-mandated electronic invoice.<br />
<br />
[[File:sshot-fat2.png|400px]]<br />
<br />
== Tasjeel Accounting ==<br />
<br />
[http://www.code.sd/tasjeel/index.html Tasjeel] is an Arabic Accounting system with stock control module, cheques module, barcode sales point module, and simple document management module. It is available for Linux and Windows. It uses Firebird database engine.<br />
<br />
[[image:tasjeel.png|400px]]<br />
<br />
== The Userman ==<br />
<br />
[https://sourceforge.net/projects/the-userman/ theuserman] is a simple desktop application to manage user mikrotik hotspot (Windows & Linux). Can be used to generate randomly mikrotik hotspot users and export them into voucher as pdf files.<br />
<br />
[[image:halaman-utama-windows.png|400px]] [[image:custom-voucher-template.png|400px]]<br />
<br />
== TruckBites ==<br />
<br />
[http://www.truckbites.com TruckBites] is a business management software for independent trucking companies and owner/operators (for the USA.) Written under contract by [[user:Tonymaro | Tony Maro]] for both Linux and Windows for "Partners in Trucking, LLC". Still under development, anticipated release in the next few months.<br />
<br />
== vCard Studio ==<br />
<br />
[https://app.zdechov.net/vcard-studio vCardStudio] is a multi-platform and open source contact management application with support for vCard file format (.vcf).<br />
<br />
[[File:vCard_Studio.png|400px]][[File:vCard Studio General.png|400px]]<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Promotion]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Software created with Lazarus]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=File:vCard_Studio_General.png&diff=148585File:vCard Studio General.png2021-12-15T08:27:14Z<p>Chronos: </p>
<hr />
<div></div>Chronoshttps://wiki.freepascal.org/index.php?title=File:vCard_Studio.png&diff=148584File:vCard Studio.png2021-12-15T08:25:46Z<p>Chronos: </p>
<hr />
<div></div>Chronoshttps://wiki.freepascal.org/index.php?title=Deploying_Your_Application&diff=148045Deploying Your Application2021-11-22T22:01:32Z<p>Chronos: </p>
<hr />
<div>{{Deploying Your Application}}<br />
<br />
You've created your application in Lazarus, tested within the IDE. Now it's time to deploy it to test it on a specific platform.<br />
<br />
== Windows Deployment ==<br />
<br />
=== InnoSetup ===<br />
<br />
[[Inno Setup]] [http://www.jrsoftware.org/] is a free installer for Windows programs. It may be used completely free of charge, even when deploying commercial applications, full Delphi source code is available.<br />
See [[Inno Setup]] for more details and links to the Lazarus installer that is written using Inno.<br />
<br />
Features:<br />
* Inno supports all versions of Windows in use today -- Windows 95, 98, ME, NT4, 2000, 2003, XP, Vista, 7, 8. The latest version that can create installers for Windows versions before Windows 2000 is version 5.4. See [http://www.jrsoftware.org/files/is5-whatsnew.htm]<br />
* It can compare file version info, replace in-use files, use shared file counting.<br />
* It can register DLL/OCXs and type libraries<br />
* It can install fonts.<br />
* It can create shortcuts anywhere, including in the Start Menu and on the desktop. <br />
* It can create registry and .INI entries<br />
* It has integrated Pascal scripting engine that allows e.g. manipulation of COM/ActiveX objects (e.g. MS Word), setting firewall rules etc.<br />
* It supports multilingual installs<br />
* It supports passworded and encrypted installs<br />
* It supports silent install and uninstall. <br />
<br />
While it is free for use, Inno Setup is copyrighted software, not public domain software. There are some restrictions on distribution and use; see the http://www.jrsoftware.org/files/is/license.txt file for details.<br />
<br />
Inno Setup is used to create the Lazarus installer for Windows.<br />
<br />
=== HJ-Install ===<br />
HJ-Install is a freeware installer for Windows 95, 98, ME, NT 4.0, 2000 and XP. It is created with Internet distributed, CD-Rom, single-floppy and multi-floppy installations in mind, but it can also be used in network situations and as a stand-alone scripting engine. The installer is small and adds only 138 Kb. It doesn't support changing the registry and ini files, and un-install. See http://www.freebyte.com/hjinstall/<br />
<br />
=== LizaJet Installer ===<br />
LizaJet Installer is a commercial installer, but a free edition is available. Uses Object Pascal for scripting. See http://www.lizajet.com<br />
<br />
=== NSIS (Nullsoft Scriptable Install System) ===<br />
A professional open source system to create Windows installers. A full-featured NSIS installer has an overhead of only 34 KB. See http://nsis.sourceforge.net/Main_Page and http://hmne.sourceforge.net/<br />
<br />
=== Windows Installer XML (WiX) toolset ===<br />
A toolset that builds Windows installation packages from XML source code. The toolset supports a command line environment that developers may integrate into their build processes to build MSI and MSM setup packages. See http://wix.sourceforge.net/<br />
<br />
=== Code signing ===<br />
<br />
For details of code signing Windows executables to avoid your end users receiving warnings that the publisher of the software is "unknown" when attempting to run your executable, see [[Code Signing for Windows]].<br />
<br />
== Linux Deployment ==<br />
<br />
=== Creating a RPM Package on Linux ===<br />
<br />
On Linux, the best way to deploy applications is by using the native package system. Of the many package systems available, RPM (RedHat Package Manager) is the most commonly utilized format, and is defined as the standard one in the Linux Standard Base.<br />
<br />
To create a RPM file, you need to create a spec text file with the information necessary to build the software, and also an environment to build that spec. The best editor to create RPM packages is Emacs, because it recognizes the spec extension, highlights the text appropriately and even has a menu option to build rpm packages.<br />
<br />
To build the rpm file use either the emacs menu or this command line (man rpmbuild for more information):<br />
<br />
rpmbuild -ba --clean $HOME/RPM/SPECS/myprogram.spec<br />
<br />
==== Setting up your build environment ====<br />
<br />
RPM Packages are installed as root to the base system (/ directory), but an accident as root can destroy your machine. To avoid this, packages can be build as a normal user. The build process includes a real install, to make sure the package works, but this install is made to a fake root directory represented by the $RPM_BUILD_ROOT variable.<br />
<br />
First, go to your home directory (or another directory inside it) and create the following directory structure:<br />
<br />
* RPM<br />
* RPM/BUILD - This directory is utilized by RPM to build the package.<br />
* RPM/RPMS - Here you can find binary RPMs after you build them.<br />
* RPM/SOURCES - Place your compressed tar files and patches here.<br />
* RPM/SPECS - Place all your spec files here.<br />
* RPM/SRPMS - Here you can find source RPMs after you build them.<br />
<br />
Next you will need to create a configuration file to tell rpm builder software where he can find your build directories. Go to your home directory and create a file named .rpmmacros and place the text below on it. Make sure to change the directories to the correct ones on your system.<br />
<br />
<pre><br />
%_topdir /home/felipe/RPM/<br />
%_tmppath /home/felipe/tmp<br />
<br />
%_signature gpg<br />
%_gpg_name Mandrakelinux<br />
%_gpg_path ~/.gnupg<br />
</pre><br />
<br />
==== Creating a binary only package ====<br />
<br />
The easiest way to create a RPM package is to make it install already compiled software. There are some reason why we might want to avoid compiling the software in the spec file:<br />
<br />
* It requires creating a Makefile and makefiles are complex<br />
<br />
* Some packages don't have any binary software in them, so they don't need to be built.<br />
<br />
Each RPM Package contains a single compressed tar archive. Place the archive under the RPM/SOURCES directory. Zip, gz and bz2 compressions should work ok. The file can either contain the full source of the project if you with to create a source and a binary package or a directory with the files already in place, like if they were installed in the user machine, if you with to create a binary only package.<br />
<br />
To build a binary package open a spec file with Emacs text editor. On Emacs open the menu "RPM spec" --> "RPM Build" --> "Build Binary Package". This will create a .rpm file under the directory RPM/RPMS<br />
<br />
Below is a spec file that doesn't build the software. In this case the software is a Braille Course composed of html and Macromedia Flash files. Flash files cannot be build on Linux, so it's not possible to create a source package in this case.<br />
<br />
<pre><br />
%define name braillevirtual <br />
%define version 1.0 <br />
%define release mdk <br />
%define dir braillevirtual<br />
%define root /home/felipe/tmp/ROOT/<br />
<br />
Summary: Curso On-Line de Braille<br />
Name: %{name}<br />
Version: %{version}<br />
Release: %{release}<br />
Vendor: Laboratório de Brinquedos da Faculdade de Educação da USP<br />
URL: www.braillevirtual.fe.usp.br<br />
License: Distribuível livremente<br />
Group: Books/Other<br />
Packager: Felipe Monteiro de Carvalho<br />
Source0: home/felipe/Programacao/SOURCES/braillevirtual.tar.bz2<br />
BuildRoot: %{root}<br />
<br />
%description<br />
O Braille Virtual é um curso on-line público e gratuito destinado à difusão e ensino do sistema Braille de leitura e escrita para cegos a pessoas que vêem. É orientado especialmente a pais, crianças, professores e funcionários de escolas inclusivas e pretende facilitar a comunicação entre estas pessoas e as pessoas com cegueira.<br />
<br />
%prep<br />
cd $RPM_SOURCE_DIR<br />
cp braillevirtual.tar.bz2 $RPM_BUILD_DIR<br />
cd $RPM_BUILD_DIR<br />
rm -rf %{dir}<br />
rm -f braillevirtual.tar<br />
bunzip2 -d braillevirtual.tar.bz2<br />
tar -xvf braillevirtual.tar<br />
<br />
%install<br />
mkdir -p $RPM_BUILD_ROOT/usr/share/<br />
rm -rf $RPM_BUILD_ROOT/usr/share/%{dir}<br />
cp -r $RPM_BUILD_DIR/%{dir} $RPM_BUILD_ROOT/usr/share/<br />
<br />
%clean<br />
rm -rf $RPM_BUILD_DIR/*.*<br />
<br />
%files<br />
/usr/share/%{dir}/<br />
<br />
%changelog<br />
<br />
* Mon Oct 24 2005 1.0-mdk.noarch.rpm<br />
<br />
- Nova atualização do pacote de instalação. Inclusão dos exercícios avançados.<br />
<br />
* Wed May 12 2005 1.0-mdk.noarch.rpm<br />
<br />
- Atualizei o pacote para refletir as mudanças no site. Várias pequenas mudanças.<br />
<br />
* Sun May 05 2005 1.0-1mdk.i586.rpm<br />
<br />
- O pacote de instalação do braille Virtual para linux é criado.<br />
</pre><br />
<br />
===== Tip: =====<br />
<br />
The following packages are required for an very basic GUI Application in GTK+ (binary only):<br />
<br />
libc6 libx11-6 libgdk-pixbuf2.0-0 libgtk2.0-0 libglib2.0-0<br />
libpango-1.0-0 libcairo2 libatk1.0-0 libxcb1 libglib2.0-0<br />
libpangocairo-1.0-0 libxfixes3 libpangoft2-1.0-0 libfontconfig1 libxrender1<br />
libxinerama1 libxi6 libxrandr2 libxcursor1 libxcomposite1<br />
libxdamage1 libxext6 libffi6 libpcre3 libthai0<br />
libpixman-1-0 libfreetype6 libpng12-0 libxcb-shm0 libxcb-render0<br />
zlib1g libxau6 libxdmcp6 libselinux1 libharfbuzz0b<br />
libexpat1 libdatrie1 libgraphite2-3<br />
<br />
You can get a list of used libraries with: <tt>ldd [executable of your project]</tt>.<br />
<br />
And find the packages in which it belongs: <br />
<br />
RPM based: <tt>rpm -qf <lib name></tt><br />
<br />
DEB based: <tt>dpkg -S <lib name></tt><br />
<br />
Where <lib name> is the name of library, before => or ")" in list<br />
<br />
Example: <tt>rpm -qf libgtk-x11-2.0.so.0</tt><br />
<br />
A script (DEB based) using pipes, in order to join all these commands in a single command line, could be (replace 'amd64' by 'i386' if you install 32 bits packages):<br />
<br />
$ ldd yourAppli | awk '/=>/{print $(NF-1)}' | while read n; do dpkg -S $n; done | awk '{print $1}' | sed 's/:amd64://' | sort | uniq | while read n; do echo "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --> Usefullness of the package named $n:"; apt-cache search ^$n; echo "...which installs the following libraries on the system:"; dpkg -L $n |grep .so; echo "...and which depends itself on the following packages on the system:"; apt show $n | grep Depends; done;<br />
<br />
==== Creating a source and binary package ====<br />
<br />
Linux distributions only accept RPM packages that can build the software. This will probably require creating build scripts and/or a Makefile. For more information see the section [[#Creating_a_Makefile_for_your_Lazarus_software|Creating a Makefile for your Lazarus software]]. <br />
<br />
You need to use the %build section to compile the software. Below is an example of a spec file capable of building the software. Be very careful when studying this as every little detail is important and follows a precise pattern.<br />
<br />
<syntaxhighlight lang=text><br />
Name: magnifier<br />
Version: 3.2.1<br />
Release: 1 <br />
Summary: Virtual Magnifying Glass<br />
Group: Accessibility<br />
License: GPL Version 2<br />
URL: http://magnifier.sourceforge.net<br />
Source0: http://internap.dl.sourceforge.net/sourceforge/magnifier/magnifier-3.2.1.zip<br />
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)<br />
BuildRequires: fpc >= 2.0.2, lazarus >= 0.9.12<br />
Requires: ImageMagick<br />
<br />
%description<br />
Virtual Magnifying Glass is a free, open source, multiplatform, screen magnification tool. It is simple, customizable, and easy-to-use.<br />
<br />
%prep<br />
%setup -q magnifier<br />
%build<br />
make TARGET=%{_target_cpu}<br />
<br />
%install<br />
./install.sh DESTDIR=$RPM_BUILD_ROOT<br />
<br />
%clean<br />
rm -rf $RPM_BUILD_ROOT/<br />
<br />
%files<br />
%defattr(-,root,root,-)<br />
/usr/share/magnifier/<br />
/usr/bin/magnifier<br />
<br />
%changelog<br />
* Wed Feb 15 2006 Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com> - 3.2-mdk.i386.rpm<br />
- The Linux RPM package is created.<br />
</syntaxhighlight><br />
<br />
=== Creating a Debian Package on Linux ===<br />
<br />
Debian packages are similar to installers. They can be downloaded by users from a website or ftp. You can craft them manually from the binary file by using their [[Debian package structure|specific structure]] and a .deb extension. However, they will not be automatically included in Debian distributions.<br />
<br />
If you want to make a package available into Debian distributions, you need to provide a [[Debian upstream|source upstream]] that can generate the Debian package as well as other files like the .orig.tar.gz and .dsc file. Those will be necessary for anybody to build your package for their target platform.<br />
<br />
There is an IDE plugin here:<br />
https://github.com/prof7bit/LazPackager<br />
<br />
=== Automating the creation of RPM and DEB packages ===<br />
<br />
To simplify the work of creating RPM and DEB packages one can create a script which generates them, just like is done here:<br />
<br />
http://sourceforge.net/p/magnifier/code/HEAD/tree/trunk/build/build_package.sh<br />
<br />
=== Snap ===<br />
<br />
See [[Create snap package]].<br />
<br />
=== Flatpack ===<br />
<br />
See [[Flatpack]].<br />
<br />
=== GUInseng ===<br />
<br />
[http://www.guinseng.de/ GUInseng] is a a GTK+ based installer for Linux released under GPL.<br />
<br />
=== The Zero Install system ===<br />
<br />
[http://0install.net/ The Zero Install system] is a Python based install system that aims to provide a better way of installing software than traditional systems <br />
(tarballs, apt-get, bundles, setup.exe, etc).<br />
<br />
===Simple deployment of Lazarus application directly to Desktop Environment (e.g., KDE Plasma 5/Manjaro)===<br />
<br />
One of the first things anyone coming from Delphi/Windows environment wants to know is how to QUICKLY deploy a newly-created Linux GUI program outside of the IDE, without spending a lot of time having to first study various package management systems. Unlike Windows, Linux is a disparate collection of Distributions ("Distros" - e.g., Debian, Arch, Ubuntu, etc.) and Desktop Environments ("DE" - e.g., KDE, Gnome, XFCE, Mate, etc.) Deployment entails some knowledge of one's Disto and DE, however the learning curve and effort is a tiny fraction of the effort required to set up and use an installation package system (e.g., DEB or RPM installation systems). The following focuses on Manjaro (ArchLinux) Distribution running the KDE Plasma 5 Desktop Environment. <br />
Before getting started, the following are required. <br />
<br />
''Prerequisites''<br />
<br />
'''You must know the Path to your application's Binary.''' <br />
It will be located in the Target directory that you specified under ''Project Options''. If you just left default settings, the Binary will be located for example for Linux x86-64 target at: ''[...]/MyProgram/lib/x86_64-linux''. The file will generally not have any extension (no ''.exe'') and will have the same name as your Project. Linux executable binaries typically either have .bin extension or no extension.<br />
<br />
'''You must have sufficient rights to the file.'''<br />
By default, Lazarus should have created the file with your username and group as owner. If not for some reason, change ownership using ''chown'' terminal command or file manager, if available. (KDE Dolphin no longer allows ''sudo'' changes within the file manager.)<br />
<br />
'''The file must be executable.'''<br />
Lazarus should have already set the file to be executable, but if not, change this using ''chmod'' or file manager, if available.<br />
<br />
'''As inital test, make sure your application can be launched directly from the Terminal.'''<br />
For example, within the same directory as you application binary (e.g., MyProgram) execute:<br />
<syntaxhighlight lang="bash"><br />
$ ./MyProgram<br />
</syntaxhighlight><br />
Make sure you can launch your application from Terminal before proceeding.<br />
<br />
''Desktop entries''<br />
<br />
To get your application to correctly launch in your Desktop Environment, you have to tell it some information by way of creating a ''Desktop Entry'' file ending in ''.desktop'' extension. This is simply a text file located in a particular directory and having specific keys. For Manjaro/ArchLinux, the following is helpful reference material:<br />
<br />
ArchLinux Desktop Entries [https://wiki.archlinux.org/index.php/Desktop_Entries]<br />
<br />
The foregoing is simply a guide, not to be taken too literally. For example, for KDE Plasma 5 on Manjaro, use of separate Path and Exec keys does NOT work. Instead, a single Exec with the application binary's full path is required. You can uncover such details and quirks by examining the existing .desktop files of other applications already installed for your particular Distro and DE.<br />
<br />
Using the example of KDE Plasma 5 on Manjaro, proceed as follows, using hypothetical ''MyApp'' application program just created with Lazarus. Determine the location for ''.desktop'' files. For Manjaro, these were found to be at ''/usr/share/applications/''. Now, create your ''.desktop'' file:<br />
<syntaxhighlight lang="bash"><br />
$ sudo nano /usr/share/applications/myapp.desktop<br />
</syntaxhighlight><br />
By convention, use lowercase for the foregoing file name. Now, enter your application details (using hypothetical "MyApp" application binary). <br />
<syntaxhighlight lang="bash"><br />
[Desktop Entry]<br />
Type=Application<br />
# Change Name to your application<br />
Name=My Application<br />
# Change icon to your icon - leave OFF any file extension<br />
Icon=myappicon<br />
Comment=My First App<br />
# The FULL path to the folder in which the executable is run<br />
# Change to your actual application binary's full path<br />
Exec=/mysamplepath/Lazarus/MyApp/lib/x86_64-linux/MyApp<br />
Terminal=false<br />
# Sample Category - will determine where it is listed in Menu tree<br />
Categories=Office;<br />
</syntaxhighlight><br />
You will be storing your icon separately, as required by your DE, so that it may be displayed in the DE's menu along with your application name. In Manjaro, icons are required to be placed at ''/usr/share/pixmaps''. If needed, a good source for icons is available at:<br />
Open Icon Library [https://sourceforge.net/projects/openiconlibrary/]<br />
For KDE Plasma 5 on Manjaro, 48x48 PNGs work well. Note that you must leave .png extension off above icon reference to avoid validation errors.<br />
Now validate your Desktop Entry file:<br />
<syntaxhighlight lang="bash"><br />
$ sudo desktop-file-validate /usr/share/applications/myapp.desktop<br />
</syntaxhighlight><br />
Correct any errors. <br />
Finally, complete installation by updating the DE's desktop database:<br />
<syntaxhighlight lang="bash"><br />
$ sudo update-desktop-database<br />
</syntaxhighlight><br />
Your application should now be listed in KDE's menu tree and easily launched with mouse click. If you need to clean up KDE's menu (e.g., delete incorrect menu item), launch ''kmenuedit'' from Terminal or right click (if available) directly on menu item.<br />
<br />
== Creating a Makefile for your Lazarus software ==<br />
<br />
The following is a command line build system for a Lazarus software. This is particularly useful if you wish to create an RPM package suitable for including on GNU/Linux distributions. The comments on the files should explain what each part does.<br />
<br />
make.sh<br />
<br />
<syntaxhighlight lang=bash><br />
# Detects and parses the architecture<br />
ARCH=$(uname -m)<br />
<br />
case "$ARCH" in<br />
"i686") ARCH="i386";;<br />
"i586") ARCH="i386";;<br />
"i486") ARCH="i386";;<br />
esac<br />
<br />
echo "Target architecture: $ARCH"<br />
<br />
# Detects and parses the OS<br />
OS="linux"<br />
<br />
echo "Target operating system: $OS"<br />
<br />
# Command line to build the sofware<br />
fpc -S2cgi -OG1 -gl -WG -vewnhi -l -Fu/usr/lib/lazarus/components/opengl/gtk2x11/ -Fi/usr/lib/lazarus/components/opengl/gtk2x11/include/ -Fu/usr/lib/lazarus/components/jpeg/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/ -Fu/usr/lib/lazarus/lcl/units/$ARCH-$OS/gtk2/ -Fu/usr/lib/lazarus/packager/units/$ARCH-$OS/ -Fu. -o./magnifier -dLCL -dLCLgtk2 magnifier.dpr<br />
</syntaxhighlight><br />
<br />
install.sh<br />
<br />
<syntaxhighlight lang=bash><br />
# Parses command line options. Currently supported options are:<br />
# DESTDIR Destination root directory<br />
<br />
DESTDIR=""<br />
<br />
for arg; do<br />
case $arg in<br />
DESTDIR=*) DESTDIR=${arg#DESTDIR=};;<br />
esac;<br />
done<br />
<br />
# Does the install<br />
# "mkdir -p" is equivalent to ForceDirectories Pascal function<br />
<br />
mkdir -p $DESTDIR/usr/share/magnifier<br />
<br />
cp ./topleft.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./topright.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./bottomleft.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./bottomright.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./top.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./left.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./bottom.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./right.bmp $DESTDIR/usr/share/magnifier/<br />
cp ./icon3.ico $DESTDIR/usr/share/magnifier/<br />
<br />
mkdir -p $DESTDIR/usr/bin<br />
<br />
cp ./magnifier $DESTDIR/usr/bin/<br />
</syntaxhighlight><br />
<br />
clean.sh<br />
<br />
<syntaxhighlight lang=bash>rm -rf *.o<br />
rm -rf *.ppu<br />
rm -rf *.pas~<br />
rm -rf *.sh~<br />
rm -rf *.bak<br />
rm -rf *~<br />
rm -rf magnifier<br />
</syntaxhighlight><br />
<br />
uninstall.sh<br />
<br />
<syntaxhighlight lang=bash>#<br />
# Don´t use "rm -rf" in here, because you should only remove the files you created<br />
rm -f /usr/share/magnifier/topleft.bmp<br />
rm -f /usr/share/magnifier/topright.bmp<br />
rm -f /usr/share/magnifier/bottomleft.bmp<br />
rm -f /usr/share/magnifier/bottomright.bmp<br />
rm -f /usr/share/magnifier/top.bmp<br />
rm -f /usr/share/magnifier/left.bmp<br />
rm -f /usr/share/magnifier/bottom.bmp<br />
rm -f /usr/share/magnifier/right.bmp<br />
rm -f /usr/share/magnifier/icon3.ico<br />
rm -f /usr/share/magnifier/magnifier<br />
rm -f /usr/bin/magnifier<br />
rmdir /usr/share/magnifier<br />
</syntaxhighlight><br />
<br />
Makefile<br />
<br />
<syntaxhighlight lang=bash><br />
# Targets<br />
# The First target is the one build when there is nothing on make command line<br />
all:<br />
./make.sh<br />
clean:<br />
./clean.sh<br />
install:<br />
./install.sh<br />
uninstall:<br />
./uninstall.sh<br />
</syntaxhighlight><br />
<br />
== macOS Deployment ==<br />
<br />
=== An Application Bundle ===<br />
<br />
See [[Application Bundle]] for information on how to create an application bundle (a directory with application files that is treated by macOS as an executable).<br />
<br />
Most macOS applications are distributed as a disk image file (.dmg extension). Normally you download or copy a program's disk image to your Mac and double-click it. This mounts the disk image and opens a window on the desktop, where you'll typically see an application bundle as described in the previous point. To install, a user simply drags the bundle to the hard drive, typically into his or the general Applications folder. Therefore, many disk images present a link to the general Applications folder for easier dragging. "Uninstalling" is by deleting the bundle. <br />
<br />
Once the installation is complete, you eject (unmount) the mounted disk image, for example by dragging it to the trash. You can also delete the .dmg file by dragging it to the trash as well.<br />
<br />
Your bonus point is, if the application can also run directly from the (read-only) disk image.<br />
<br />
Here is the <tt>app2dmg.sh</tt> script which I use to create a .dmg file for an application bundle:<br />
<br />
<syntaxhighlight lang=sh><br />
#!/bin/sh<br />
<br />
if [ "${1}" = "" ]<br />
then<br />
echo "Usage: app2dmg.sh app_name.app disk_size_in_mb"<br />
exit<br />
fi<br />
<br />
if [ "${2}" = "" ]<br />
then<br />
echo "Usage: app2dmg.sh app_name.app disk_size_in_mb"<br />
exit<br />
fi<br />
<br />
if [ ! -r "${1}" ]<br />
then<br />
echo "${1} is not in the current directory!"<br />
exit<br />
fi<br />
<br />
APP=`echo "${1}" | sed "s/\.app//"`<br />
DATE=`date "+%d%m%Y"`<br />
VOLUME="${APP}_${DATE}"<br />
<br />
echo "Application name: ${APP}"<br />
echo "Volume name: ${VOLUME}"<br />
<br />
if [ -r ${APP}*.dmg.sparseimage ]<br />
then<br />
rm ${APP}*.dmg.sparseimage<br />
fi<br />
<br />
hdiutil create -size ${2}M -type SPARSE -volname "${VOLUME}" -fs HFS+ ${VOLUME}.dmg<br />
<br />
hdiutil attach ${VOLUME}.dmg.sparseimage<br />
cp -R ${APP}.app "/Volumes/${VOLUME}/"<br />
cp README_FIRST.TXT "/Volumes/${VOLUME}/"<br />
hdiutil detach -force "/Volumes/${VOLUME}"<br />
<br />
hdiutil convert "${VOLUME}.dmg.sparseimage" -format UDBZ -o "${VOLUME}.dmg" -ov -imagekey zlib-level=9<br />
rm ${VOLUME}*.dmg.sparseimage<br />
</syntaxhighlight><br />
<br />
You can also read [http://el-tramo.be/guides/fancy-dmg this guide] for how to create a fancy disk image.<br />
<br />
=== Using Packages on macOS ===<br />
<br />
The Apple <tt>pkgbuild</tt> and <tt>productbuild</tt> command line tools can produce package .pkg files or the aptly named, third party GUI [http://s.sudre.free.fr/Software/Packages/about.html <tt>Packages</tt>] application which builds flat packages (cf bundle-style packages built by the same author's GUI [http://s.sudre.free.fr/Software/Iceberg.html <tt>Iceberg</tt>] application. <br />
<br />
If you absolutely require that several files are installed in different locations, then (and only then!) should you create a package file (.pkg extension) for the Apple Installer. This package file can then be moved, downloaded or emailed. Once the end user has it, they can double-click the package and the <tt>Installer.app</tt>, which will perform the installation, is launched.<br />
<br />
Package files have certain advantages:<br />
* You have control over permissions;<br />
* Multiple files can be placed in different locations;<br />
* You can run scripts as part of the installation process;<br />
* A logged-in user is not needed to install a package;<br />
* Most, if not all, Mac management systems can install Apple installer packages.<br />
<br />
The installer .pkg file is actually a directory, as is the resulting application bundle (.app extension) that it copies to the Applications folder. To the user, .pkg and .app files look and act like ordinary files, but they're really directories whose details have been hidden from the user. You can see what's inside a .pkg or .app file by entering normal <tt>cd</tt> commands in a Terminal window (for example, <tt>cd progname.app</tt>) or by Ctrl-Clicking the file and choosing ''Show Package Contents'' from the popup menu.<br />
<br />
To create a .dmg file, run the macOS Disk Utility (located in Applications > Utilities). Select Images > New > Image from Folder and choose the folder containing your .pkg file and any other files you want to include in the disk image. In the Convert Image dialog, enter the name of the .dmg file to create, select where it should be saved, and select "compressed" as the image format. The .dmg file that Disk Utility creates is then ready for distribution.<br />
<br />
=== Installing X11 and GTK on macOS ===<br />
<br />
GUI apps created with Lazarus that use the GTK widgetset require X11 and the GTK libraries to run. The [https://www.xquartz.org XQuartz open source project] <tt>X11.app</tt> was shipped with Leopard 10.5 through Lion 10.7 as an optional installation. After Lion 10.7, Apple stopped providing X11 but it can still be downloaded from the XQuartz project website.<br />
<br />
To install the GTK libraries on a user's system, you should include instructions for using [http://www.finkproject.org/ Fink] or [http://www.macports.org/ MacPorts]. Do ''not'' manually package the libraries and install those in the default Fink/MacPorts locations, because then they may be overwritten in case the user decides to install one of these distributions. A good practice is to put those libraries in the application bundle itself, which requires [http://qin.laya.com/tech_coding_help/dylib_linking.html using the install_name_tool] program. Putting them somewhere else is possible, but in most cases not conform to the Apple Guidelines as well as not what users expect. Before simply using directories common to other systems, you should carefully read the guidelines about the file system layout [http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html File System Overview].<br />
<br />
=== Code signing and Notarization ===<br />
<br />
See [[Code Signing for macOS]] (required from macOS 10.7+) and [[Notarization for macOS 10.14.5+|Notarization for macOS]] (required from macOS 10.14.5+). <br />
<br />
Note: It is still possible not to code sign and notarise your applications if you do not mind your endusers facing scary warning dialogs from Apple - Gatekeeper can (still) be by-passed by Conctrol-Clicking on the application or right clicking on the application for the context menu, and then choosing ''Open'' and not ''Move to trash'' or ''Cancel''. Notarization requires you to enrol in the [https://developer.apple.com/programs/ Apple Developer Program] ($US 99 annually).<br />
<br />
=== See also ===<br />
<br />
* [https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/SoftwareDistribution4/Introduction/Introduction.html Apple's Software Delivery Legacy Guide].<br />
<br />
* [https://github.com/unixorn/luggage/wiki The Luggage] Uses a Makefile describing where you want each file in the package to end up on the target machines with rules that will generate a package root with appropriate permissions, copy the files into place, create a package version-stamped with the date, then wrap the package in a disk image file. This allows packages to be built in a consistent and repeatable way using source files and scripts.<br />
<br />
* [https://github.com/munki/munki-pkg munkipkg] is a simple tool for building packages in a consistent, repeatable manner from source files and scripts in a project directory. Files, scripts, and metadata are stored in a way that is easy to track and manage using a version control system like git.<br />
<br />
== Android Deployment ==<br />
<br />
(This information needs to be consolidated here and the below links adjusted)<br />
* [[Android]]<br />
* [[FPC JVM Android Development]]<br />
* [[Android Programming]]<br />
<br />
== Apple iOS Deployment ==<br />
<br />
(This information needs to be consolidated here and the below links adjusted)<br />
* [[iOS Designer]]<br />
* [[Portal:iOS|iOS Portal]]<br />
* [[iPhone/iPod development]]<br />
<br />
== Other, General Cross-Platform Deployment ==<br />
<br />
=== BitRock ===<br />
<br />
[[File:gui-newproject.png||600px]]<br />
<br />
[[BitRockInstallBuilder|Bitrock]] (website www.bitrock.com) make an installer that will deploy to Windows, Mac OS and many flavors of Linux. If your application is open-source, they will give you a full license to download and use their 'InstallBuilder' application.[[http://installbuilder.bitrock.com/open-source-licenses.html Application form link]]. Commercial application licenses are available.<br />
<br />
=== fpGUI Installer ===<br />
<br />
This is a cross-platform CLI and GUI installer. It is loosely based on the concept of the Loki Installer (implemented in the C programming language) created by [http://www.lokigames.com/ Loki Games]. The difference being that fpGUI Installer is implemented from scratch using Object Pascal and the fpGUI Toolkit for the GUI parts. This installer is still under active development, but to date no public release has been made. A public release is planned though. No official name has been given to this project either - thus the not ideal "fpGUI Installer" name.<br />
<br />
Here is a screenshot of fpGUI Installer replacing the original Kylix 3 installer:<br />
[[File:fpgui_installer.png|right|fpGUI Installer|400px]]<br />
<br />
Features:<br />
* Installer setup is done via an easily managed XML file. A GUI front-end is used to edit the XML, but it can be done by hand too.<br />
* CD-ROM or Downloadable installers. The difference being that the CD-ROM installer is normally unpacked and multiple languages, tools etc are included. A Downloadable installer is a single file download and normally packaged for a specific language.<br />
* Automatic icon shortcut generation<br />
* No external libraries or runtime environments required. The idea is that a installer must not have system requirements (eg: a JVM or the Qt library etc), hence fpGUI toolkit was used for the GUI installer, because it talks directly to GDI or X11.<br />
* Command Line Installer and GUI Installer included as standard.<br />
* Support uninstall as well<br />
* fpGUI Installer has been tested on Windows (Win98 thru Win7), Linux (various distros), FreeBSD and OpenSolaris.<br />
* Supports 32-bit and 64-bit setup files.<br />
* Group installer mode: The installer can present a user friendly interface to install multiple other projects.<br />
* Customisable graphics banner and UI theme.<br />
<br />
=== InstallJammer ===<br />
<br />
InstallJammer is a multiplatform GUI installer designed to be completely cross-platform and function on Windows and most all versions of UNIX.<br />
<br />
InstallJammer features a very powerful install builder with support for multiple themes and a high level of configurability for installers. Installers are built as single executable files for easy distribution over the web and handle installing everything you need for your application in a simple, cross-platform way.<br />
*Active development of InstallJammer has been discontinued. The source is available for all versions and will always remain so, but your efforts might be better spent on an installer that is active in its development.<br />
*Download: https://sourceforge.net/projects/installjammer/files/InstallJammer/<br />
*Documentation: http://installjammer.com/docs/<br />
<br />
=== CMake/CPack ===<br />
<br />
CMake is a multiplatform build system that manages the compilation, linking, testing, and setup creation process. It is mainly intended for C/C++ software development, but can also be used for creating setups for Lazarus/FPC projects. The part of CMake that creates the setups is called CPack and is actually a front-end for other software packages that do the real work. In an FPC context, you would write a CMakeLists.txt file that contains lists of files to be installed and then have CPack call NSIS/WiX/... to perform the actual work.<br />
<br />
Features:<br />
* Windows (32+64 Bit), Linux, macOS support<br />
* Works with all important back-ends (NSIS, WiX, DEB...)<br />
* Just one text file CMakeLists.txt needs to be mainained for all target platforms<br />
* Multi-platform setups can be created with minimal work<br />
* Download: http://www.cmake.org/<br />
<br />
Using CMake/CPack makes most sense if you have a mixed-language project with Pascal and C/C++ parts that all go into one installer, and you need a platform-independent solution for both parts. If you have a pure FPC project, the overhead might be too much for you.<br />
<br />
== See also ==<br />
<br />
* [[Create snap package|How to create an Ubuntu snap package]]<br />
* [[Publish project on Launchpad]]<br />
* [[macOS PackageMaker]] - legacy - discontinued after Xcode 4.4.</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=148044Create snap package2021-11-22T21:59:23Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft upload myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 stable</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/lazarus-project_2.0.12-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-laz_3.2.0-1_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-src_3.2.0-1_amd64.deb<br />
apt install ./lazarus-project_2.0.12-0_amd64.deb ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
* [[Deploying Your Application]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Flatpak&diff=148043Flatpak2021-11-22T21:59:08Z<p>Chronos: Created page with " =See also= * Deploying Your Application ==External links== * [https://github.com/search?q=org%3Aflathub+lazbuild&type=code Existing flatpack projects built with Lazaru..."</p>
<hr />
<div><br />
<br />
=See also=<br />
* [[Deploying Your Application]]<br />
<br />
==External links==<br />
<br />
* [https://github.com/search?q=org%3Aflathub+lazbuild&type=code Existing flatpack projects built with Lazarus]<br />
* [https://flathub.org/ flathub.org]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=147916Create snap package2021-11-16T09:51:41Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of the package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: strict<br />
base: core20<br />
grade: stable<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft upload myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 stable</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/lazarus-project_2.0.12-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-laz_3.2.0-1_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-src_3.2.0-1_amd64.deb<br />
apt install ./lazarus-project_2.0.12-0_amd64.deb ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=147902Create snap package2021-11-15T23:24:56Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft upload myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 edge</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Use newer Lazarus version=<br />
<br />
Normally you can use Lazarus IDE version provided by current base (2.0.6 for core20). To use latest stable version with new features you can add following part into your snapcraft.yaml file. This part should be executed before myapp part. You need to update fixed URL based on required Lazarus version. Then those packages will be downloaded and installed before build.<br />
<br />
<pre><br />
parts:<br />
lazarus:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- wget<br />
- libgtk2.0-dev<br />
override-build: |<br />
wget -nc https://deac-ams.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/lazarus-project_2.0.12-0_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-laz_3.2.0-1_amd64.deb<br />
wget -nc https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.0.12/fpc-src_3.2.0-1_amd64.deb<br />
apt install ./lazarus-project_2.0.12-0_amd64.deb ./fpc-laz_3.2.0-1_amd64.deb ./fpc-src_3.2.0-1_amd64.deb<br />
prime: [-*]<br />
myapp:<br />
after: [lazarus]<br />
</pre><br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Games&diff=147761Projects using Lazarus - Games2021-11-10T09:12:10Z<p>Chronos: </p>
<hr />
<div>{{Sidebar-LazProjects}}<br />
<br />
== 15-puzzle ==<br />
<br />
[[15-puzzle]] is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The object of the puzzle is to place the tiles in order by making sliding moves that use the empty space. <br />
<br />
[[image:puzzle15.png]]<br />
<br />
== 2048 ==<br />
<br />
[https://app.zdechov.net/2048 2048] is a Lazarus implementation of famous block sliding puzzle [https://en.wikipedia.org/wiki/2048_(video_game) video game].<br />
<br />
[[Image:2048.png|200px]]<br />
<br />
== BigMetro ==<br />
<br />
[https://app.zdechov.net/BigMetro BigMetro] is metro building game inspired by [https://en.wikipedia.org/wiki/Mini_Metro_(video_game) MiniMetro] game. Runs on Windows, Linux and macOS (need to compile yourself for macOS).<br />
<br />
[[File:BitMetro_small.png|border|200px]]<br />
[[File:BigMetro_main.png|border|270px]]<br />
<br />
== Bomber Kat ==<br />
<br />
Commercial game developed with FPC for iOS (both arm and arm64 platforms are supported). [[ZenGL]] based. Lazarus has been used as a primary IDE. Link: [https://itunes.apple.com/app/bomber-kat/id1109783786?ls=1&mt=8 App Store]<br />
<br />
== C-evo: New Horizons ==<br />
<br />
[https://app.zdechov.net/c-evo C-evo: New Horizons] is a fork of the well designed turn-based empire building game [http://c-evo.org/ C-evo] inspired by Civilization II game. It was originally developed for Windows using Delphi 4 but later fully porter to Lazarus to support also Linux.<br />
<br />
[[File:C-evo start.png|border|270px]]<br />
[[File:C-evo game.png|border|270px]]<br />
[[File:C-evo game2.jpg|border|270px]]<br />
<br />
== Castle Game Engine ==<br />
<br />
[[Castle Game Engine]] ([http://castle-engine.sourceforge.net/ project page]) is a 3D open-source game engine. The engine was developed from the beginning using Free Pascal (we have also Lazarus components) in nice and clean ObjectPascal code. We support many 3D model formats, including [http://castle-engine.sourceforge.net/vrml_x3d.php VRML/X3D], Collada, 3DS and many others. Tools and games using the engine include: <br />
* [http://castle-engine.sourceforge.net/view3dscene.php view3dscene - 3D model viewer, VRML/X3D browser], <br />
* [http://castle-engine.sourceforge.net/castle.php The Castle - FPS game in a dark fantasy world], <br />
* [http://castle-engine.sourceforge.net/darkest_before_dawn.php Darkest Before the Dawn - small scary 3D game for standalone and Android (also on Google Play)]<br />
<br />
== Common Loon Hearts ==<br />
<br />
[https://web.ncf.ca/di874/computers/hearts/hearts.html Common Loon Hearts] is the card game Hearts. It is written in Free Pascal with the Lazarus IDE for Windows and Linux. Source code is available [https://github.com/oldgizahub/hearts here].<br />
<br />
[[Image:hearts_screen.png|320px]]<br />
<br />
== DMines ==<br />
<br />
[http://dmines.sourceforge.net/ DMines] is an edition of the classic game Minesweeper with a dynamic twist, unrevealed mines can change location every set number of seconds.<br />
<br />
[[Image: DMinesExample.jpg|400px]]<br />
<br />
== Dreams of a Geisha ==<br />
<br />
Take a journey through the magical and wonderful world of Geisha. Help Ichisumi in this incredible adventure to reopen the temples of Geisha and restore a world of beauty and passion. Dive into this engaging Match 3 game with beautiful scenery and relaxing music. Overcome obstacles, collect puzzle pieces, and be prepared to solve challenging puzzles in [http://www.dreamsofageisha.com Dreams of a Geisha]!<br />
<br />
Powered by Lazarus FPC, [http://www.zengl.org/ ZenGL], [http://www.phoenixlib.net/ PhoenixLib], [http://www.lua.org/ LUA] and [http://www.codeandweb.com/texturepacker TexturePacker]. Developed by [http://www.greensaucegames.com Green Sauce Games] and Released by [http://www.bigfishgames.com Big Fish Games].<br />
<br />
Demo available for [http://www.bigfishgames.com/download-games/12814/dreams-of-a-geisha/index.html Windows], [http://www.bigfishgames.com/download-games/13045/mac/dreams-of-a-geisha/index.html Mac], [http://itunes.apple.com/us/app/dreams-of-a-geisha/id460180656?mt=8 iPhone], [http://itunes.apple.com/us/app/dreams-of-a-geisha-hd/id459801505?mt=8 iPad].<br />
<br />
[[File:Dreams of a Geisha - Screenshot 1.jpg|border|270px]]<br />
<br />
== Eschecs ==<br />
<br />
[https://github.com/rchastain/eschecs Eschecs] is an application to play chess against different artificial opponents. ''Eschecs'' uses the [[fpGUI]] Toolkit, and the [[uos]] and [[BGRABitmap]] libraries.<br />
<br />
[[Image:eschecs500f.png|300x300px]] <br />
<br />
== fpChess ==<br />
<br />
[[fpChess]] is still under construction. It should support playing via the internet as well as against a computer AI. <br />
<br />
[[Image:Fpchess.png|240px]]<br />
<br />
== Game Maker ==<br />
<br />
[http://www.yoyogames.com/gamemaker Game Maker] allows you to make computer games using easy to learn drag-and-drop actions. You can create professional looking games within very little time. You can make games with backgrounds, animated graphics, music and sound effects, and even 3D games! And when you've become more experienced, there is a built-in programming language, which gives you the full flexibility of creating games with Game Maker. What is best, is the fact that Game Maker can be used free of charge.<br />
<br />
Originally written in Delphi, Lazarus/Free Pascal was used to port it from Win32 to macOS. Available for Windows desktop, macOS, Ubuntu, Android, iOS, tvOS, fireTV, Android TV, Microsoft UWP, HTML5, PlayStation 4, and Xbox One.<br />
<br />
== Hedge Wars ==<br />
<br />
[http://www.hedgewars.org/ Hedge Wars] is a worm-like game with very nice graphics and good AI. The game features typical worms gameplay including net play. The game itself is written in FPC while the config application is C++/Qt.<br />
<br />
[[Image: HedgeWarsPage.png|320px| HedgeWars Scene]]<br />
<br />
== JavaneseChess ==<br />
<br />
[https://bitbucket.org/leledumbo/javanese-chess JavaneseChess] is a Javanese chess game implementation. Available for Desktop platforms and Android (not feature complete yet).<br />
<br />
== Juegos Iniciales ==<br />
<br />
[http://juegosenlazaruscostarricenses.com Juegos Iniciales] are a small collection of 3D tutorial games in<br />
Lazarus, SDL and Free Pascal. In 2016, there were only four games:<br />
[http://origamisiniciales.juegosenlazaruscostarricenses.com Origamis Iniciales], <br />
[http://bloquesiniciales.juegosenlazaruscostarricenses.com Bloques Iniciales], <br />
[http://nudosiniciales.juegosenlazaruscostarricenses.com Nudos Iniciales],<br />
[http://palitos-iniciales.juegosenlazaruscostarricenses.com Palitos Iniciales].<br />
<br />
== LazGobang ==<br />
<br />
[http://files.cnblogs.com/lazarus/LazGobang.rar LazGobang] is a Gobang game, powered by Lazarus and Free Pascal. <br />
<br />
== Lazarus Mazes ==<br />
<br />
The [https://github.com/eny-fpc/lazes Lazarus Mazes] program is a demonstration of how you can use Lazarus to create a maze. The maze generation is based on a [http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search depth-first backtracking] algorithm. As a bonus, a simple maze solver is also implemented that shows a route from the start of the maze to the exit.<br />
<br />
[[Image:mazedemo1.png|400px]]<br />
<br />
== LBP Level Logger ==<br />
<br />
[http://code.google.com/p/lbplevellogger/ LBP Level Logger] is a small system tray application designed to log [http://www.littlebigplanet.com/ LittleBigPlanet] level statistics from [http://lbp.me/ lbp.me] over time for graphing/visualisation. It is written in Free Pascal/Lazarus.<br />
<br />
[[File:lbplevellogger-screenshot.png]]<br />
<br />
== Lentil Wars ==<br />
<br />
[http://lwars.sourceforge.net/ Lentil Wars] is an arcade action game for Linux and Windows that is still under development. Players combat each other in multiple nicely designed levels. Lentil Wars can be played both on a single computer as well as over a network.<br />
<br />
[[Image:LentilWars.jpg|320px| Lentil Wars Scene]]<br />
<br />
== Mundo Medieval 3D MMORPG ==<br />
<br />
Featuring a virtual world of more than 1.000.000 m2, plus caves and hell sceneries, 17 NPCs, 21 kinds of monsters, including 7 bosses, 58 different items and 100 quests, this is a really large game made with Free Pascal/Lazarus. The project is 100% free software, both code and media are licensed under GPL. The project sites are [http://www.gamemundo.com/ http://www.gamemundo.com/] and [http://sourceforge.net/projects/gamemundo/ http://sourceforge.net/projects/gamemundo/].<br />
<br />
[[File:Mundo - Screenshot 1.png|border|270px]]<br />
[[File:Mundo - Screenshot 2.png|border|270px]]<br />
[[File:Mundo - Screenshot 3.png|border|270px]]<br />
<br />
== Peg Solitaire tutorial ==<br />
<br />
[[Peg Solitaire tutorial|Peg Solitaire]] serves as a game (Peg Solitaire) tutorial that aims at introducing the user to the basics of Lazarus application development. Source available.<br />
<br />
[[Image:tutpeg_solitaire.png|340px]]<br />
<br />
== Petris ==<br />
<br />
[[Petris]] is yet another Tetris clone. [https://github.com/eny-fpc/petris Source available].<br />
<br />
[[Image:petris.png|320px]]<br />
<br />
== Retro Ski Run ==<br />
<br />
[https://sourceforge.net/projects/retroskirun/ Retro Ski Run] is a simple ski game for Windows 32/64bit and Linux 32/64-bit.<br />
<br />
[[Image:ss_rsrStartScreen.jpg|border|270px]]<br />
<br />
== Robot - The Game ==<br />
<br />
[[Robot - The Game|Robot]] is a game in which you control a character through a world consisting of 5*5 rooms, each with 20*20 fields. Every field contains a special game object; this can be a wall, a bad robot who wants to kill you (because of the robots, the game is named Robot), a door (for each door, you need a special key) and so on. [https://sourceforge.net/projects/lazarus-ccr/files/Demos and examples/Robot 1.7/ Source available].<br />
<br />
[[Image:robot1.5-shot1.png|320px]]<br />
<br />
== Snake for ptcGraph ==<br />
<br />
[https://gitlab.com/rchastain/snake-ptcgraph Snake for ptcGraph] is a simple snake game based on the ptcGraph unit. Steer the snake with keyboard arrows and eat as many fruits as you can.<br />
<br />
[[Image:snake2.png|320px]]<br />
<br />
== UltraStar Deluxe ==<br />
<br />
[http://ultrastardx.sourceforge.net/ UltraStar Deluxe] is a free and open source karaoke game inspired by the Singstar™ game available on the Playstation®. It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of the singing. It is currently available for Windows, Linux, macOS and FreeBSD.<br />
<br />
[[Image:UltraStarDeluxeMainPage.png|400px|UltraStar Deluxe Main Page]] <br />
<br />
== ValisoaChess ==<br />
<br />
[https://sourceforge.net/projects/valisoachess/?source=directory ValisoaChess] is a chess game written in Free Pascal and Lazarus. The main goal is to create a simple yet powerful chess engine.<br />
<br />
[[Image:valisoachess.jpg|320px]]<br />
<br />
== Zen GL updated ==<br />
<br />
[https://sourceforge.net/p/zengllinux/code/ci/default/tree/ Zen GL] is a 2D game engine. Now Zen GL uses Steam Game Libraries. You can migrate your Delphi X or Image Sprite old 2D Delphi games with that Zen GL upgraded Game Engine. The Zen GL Linux packages are zgl.deb or zgl.rpm.<br />
<br />
And also an updated version of [https://github.com/Seenkao/New-ZenGL ZenGL] with support for Android and MacOS Cocoa. In Russian. Support for English is evolving. Inside there is a link to the iOS version but the new features are not included.<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Historical]]<br />
[[Category:Promotion]]<br />
[[Category:Software created with Lazarus]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Games]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Games&diff=147760Games2021-11-10T09:09:01Z<p>Chronos: /* Game lists */</p>
<hr />
<div>{{Menu_Game_Development}}<br />
<br />
==Games==<br />
<br />
Games written with Free Pascal. Currently active projects commercial, closed or open source. Some more also [[Projects using Lazarus#Games]].<br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Name <br />
! Site <br />
! Open Source<br />
! Notes<br />
|- <br />
| Darkest Before the Dawn<br />
| http://castle-engine.sourceforge.net/darkest_before_dawn.php [https://play.google.com/store/apps/details?id=net.sourceforge.castleengine.darkestbeforedawn Google Play (Android version)]<br />
| {{Yes}}<br />
| Using Castle Game Engine<br />
|- <br />
| Castle<br />
| http://castle-engine.sourceforge.net/castle.php<br />
| {{Yes}}<br />
| Using Castle Game Engine<br />
|- <br />
| Diablo Roguelike<br />
| [http://diablo.chaosforge.org/ doom.chaosforge.org] [http://sourceforge.net/projects/diablorl/ Sourceforge.net]<br />
| {{Yes}}<br />
|<br />
|- <br />
| Doom Roguelike<br />
| [http://doom.chaosforge.org/ doom.chaosforge.org]<br />
| {{No}}<br />
|<br />
|- <br />
| Escape from the Universe<br />
| https://play.google.com/store/apps/details?id=com.catastrophe.games.escape.universe.space.shooter<br />
| {{No}}<br />
| Using Castle Game Engine<br />
|-<br />
| HedgeWars<br />
| [http://www.hedgewars.org/ www.hedgewars.org]<br />
| {{Yes}}<br />
| <br />
|- <br />
| Project "W"<br />
| [http://www.pascalgamedevelopment.com/showthread.php?3594-Projekt-quot-W-quot PascalGameDevelopment.com ]<br />
| {{No}}<br />
|<br />
|- <br />
| Scrabble 3D<br />
| [http://sourceforge.net/projects/scrabble/ sourceforge.net]<br />
| {{Yes}}<br />
|<br />
|- <br />
| UltraStar Deluxe<br />
| [http://sourceforge.net/projects/ultrastardx/ sourceforge.net]<br />
| {{Yes}}<br />
|<br />
|- <br />
| Minimon 3D<br />
| [http://www.minimon3d.com http://www.minimon3d.com]<br />
| {{No}}<br />
|<br />
|- <br />
| Mountains of Fire<br />
| http://castle-engine.sourceforge.net/mountains_of_fire.php<br />
| {{Yes}}<br />
| Using Castle Game Engine<br />
|- <br />
| Shu<br />
| [http://sourceforge.net/projects/rr-rr sourceforge.net]<br />
| {{Yes}}<br />
| Interesting looking RPG - in progress<br />
|- <br />
| Project Helena<br />
| [https://sourceforge.net/projects/projecthelena/ sourceforge.net]<br />
| {{Yes}}<br />
| A game by Eugene Loza<br />
|- <br />
| Asteroids vs You<br />
| [https://github.com/dimsa/ShadowEngine/ github.com], [https://play.google.com/store/apps/details?id=com.ShadowEngine.AsteroidsVsYou Google Play (Android version)]<br />
| {{Yes}}<br />
| Open Source Demo Game for SO Engine<br />
|}<br />
<br />
==Notable games written in Pascal==<br />
Here's a list of notable games made in Pascal or Object Pascal.<br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Name<br />
! Site<br />
! License<br />
! Source available<br />
! Notes<br />
|-<br />
| Peg Solitaire<br />
| [[Peg Solitaire tutorial]]<br />
| Public Domain<br />
<br />
There's no license note, so I'm wondering. It may be ''Creative Commons'' as well.<br />
| {{Yes}}<br />
| A step-by-step explanation of how to build a [http://en.wikipedia.org/wiki/Peg_solitaire Peg Solitaire] using Lazarus.<br />
|-<br />
| Hedgewars<br />
| [http://www.hedgewars.org/ www.hedgewars.org]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
| {{Yes}}<br />
| A well known [https://en.wikipedia.org/wiki/Worms_%28series%29 Worms] clone.<br />
|-<br />
| [https://en.wikipedia.org/wiki/List_of_minor_Apogee_Software_video_games#Beyond_the_Titanic Beyond the Titanic]<br />
| [http://legacy.3drealms.com/downloads.html#titanic Download page at 3DReams website]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
| {{Yes}}<br />
| An early game by Apogee.<br />
|- <br />
| Darkest Before the Dawn<br />
|<br />
[https://play.google.com/store/apps/details?id=net.sourceforge.castleengine.darkestbeforedawn Google Play]<br />
[https://github.com/castle-engine/darkest-before-dawn GitHub]<br />
[http://castle-engine.sourceforge.net/darkest_before_dawn.php Sourceforge]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
| {{Yes}}<br />
| First game using [[Castle Game Engine]] in Android.<br />
|- <br />
| Ultrastar Deluxe (USDX)<br />
| [https://github.com/UltraStar-Deluxe/USDX GitHub]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
| {{Yes}}<br />
|A karaoke game, basically an OSS Singstar clone<br />
|-<br />
| Mundo<br />
| [https://sourceforge.net/projects/gamemundo/ SourceForge]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
| {{Yes}}<br />
| Maybe the first [https://en.wikipedia.org/wiki/Massively_multiplayer_online_role-playing_game MMORPG] written in Pascal.<br />
|-<br />
| Petris<br />
| [[Petris]]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
| {{Yes}}<br />
| A simple Lazarus/Freepascal implementation of the popular block dropping game<br />
|}<br />
<br />
==Pascal Ported Games==<br />
This list contains games written in other languages ported to Pascal. Note that most them were written for [[Delphi]] but may be they can be compiled/ported to Free Pascal too.<br />
<br />
{| class="wikitable sortable" width="100%"<br />
! Name <br />
! Site <br />
! License<br />
! Notes<br />
|-<br />
| Delphi Doom<br />
| [http://sourceforge.net/projects/delphidoom/ Sourceforge]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
|<br />
|- <br />
| Quake to Delphi<br />
| [http://sourceforge.net/projects/delphiquake/ Sourceforge] <br />
[http://www.geocities.ws/jimmyvalavanis/applications/delphiquake.html Geocities]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
| Sourcefoge is the active one. The old-site appears to be quite dead now. Though the source code can still be downloaded.<br />
|-<br />
| Quake II Delphi (Quake 2 Delphi)<br />
| [http://www.sulaco.co.za/quake2/ www.sulaco.co.za]<br />
| [https://opensource.org/licenses/gpl-license GNU General Public License]<br />
| <br />
|-<br />
| C-evo<br />
| [http://www.c-evo.org/ www.c-evo.org]<br />
| Public Domain<br />
| The game is inspired by Civilization 2 game. It was spotted on [http://forum.lazarus.freepascal.org/index.php/topic,7914.0.html the forum] back in 2009. The engine used is not the original Civilization II engine. So as long as graphical resources are different, it's quite good TBS engine.<br />
|}<br />
<br />
==Game lists==<br />
You can find more games in the next links:<br />
<br />
* [[Projects using Lazarus - Games]].<br />
* [http://forum.lazarus.freepascal.org/index.php/topic,39425.0.html Games from the Lazarus Graphics Contest]<br />
* [http://www.sourcecodeonline.com/sources/delphi/games.html Delphi games]<br />
* [http://www.pascalgamedevelopment.com/showthread.php?4519-The-great-list-of-Pascal-Games The great list of Pascal Games]<br />
<br />
Available [[Game Engine|game engines]] and [[Game framework|game frameworks]] also include examples and game demos.<br />
<br />
[[Category:Games]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=146446Create snap package2021-08-18T14:41:15Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft upload myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 edge</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Games&diff=146333Projects using Lazarus - Games2021-08-10T15:41:26Z<p>Chronos: </p>
<hr />
<div>{{Sidebar-LazProjects}}<br />
<br />
== 15-puzzle ==<br />
<br />
[[15-puzzle]] is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The object of the puzzle is to place the tiles in order by making sliding moves that use the empty space. <br />
<br />
[[image:puzzle15.png]]<br />
<br />
== 2048 ==<br />
<br />
[https://app.zdechov.net/2048 2048] is a Lazarus implementation of famous block sliding puzzle [https://en.wikipedia.org/wiki/2048_(video_game) video game].<br />
<br />
[[Image:2048.png|200px]]<br />
<br />
== BigMetro ==<br />
<br />
[https://app.zdechov.net/BigMetro BigMetro] is metro building game inspired by [https://en.wikipedia.org/wiki/Mini_Metro_(video_game) MiniMetro] game. Runs on Windows, Linux and macOS (need to compile yourself for macOS).<br />
<br />
[[File:BitMetro_small.png|border|200px]]<br />
[[File:BigMetro_main.png|border|270px]]<br />
<br />
== Bomber Kat ==<br />
<br />
Commercial game developed with FPC for iOS (both arm and arm64 platforms are supported). [[ZenGL]] based. Lazarus has been used as a primary IDE. Link: [https://itunes.apple.com/app/bomber-kat/id1109783786?ls=1&mt=8 App Store]<br />
<br />
== C-evo ==<br />
<br />
[https://app.zdechov.net/c-evo C-evo] is a turn-based empire building game inspired by Civilization II game. It was [http://c-evo.org/ originally] developed using Delphi 4 but later fully porter to Lazarus.<br />
<br />
[[File:C-evo start.png|border|270px]]<br />
[[File:C-evo game.png|border|270px]]<br />
[[File:C-evo game2.jpg|border|270px]]<br />
<br />
== Castle Game Engine ==<br />
<br />
[[Castle Game Engine]] ([http://castle-engine.sourceforge.net/ project page]) is a 3D open-source game engine. The engine was developed from the beginning using Free Pascal (we have also Lazarus components) in nice and clean ObjectPascal code. We support many 3D model formats, including [http://castle-engine.sourceforge.net/vrml_x3d.php VRML/X3D], Collada, 3DS and many others. Tools and games using the engine include: <br />
* [http://castle-engine.sourceforge.net/view3dscene.php view3dscene - 3D model viewer, VRML/X3D browser], <br />
* [http://castle-engine.sourceforge.net/castle.php The Castle - FPS game in a dark fantasy world], <br />
* [http://castle-engine.sourceforge.net/darkest_before_dawn.php Darkest Before the Dawn - small scary 3D game for standalone and Android (also on Google Play)]<br />
<br />
== Common Loon Hearts ==<br />
<br />
[https://web.ncf.ca/di874/computers/hearts/hearts.html Common Loon Hearts] is the card game Hearts. It is written in Free Pascal with the Lazarus IDE for Windows and Linux. Source code is available [https://github.com/oldgizahub/hearts here].<br />
<br />
[[Image:hearts_screen.png|320px]]<br />
<br />
== DMines ==<br />
<br />
[http://dmines.sourceforge.net/ DMines] is an edition of the classic game Minesweeper with a dynamic twist, unrevealed mines can change location every set number of seconds.<br />
<br />
[[Image: DMinesExample.jpg|400px]]<br />
<br />
== Dreams of a Geisha ==<br />
<br />
Take a journey through the magical and wonderful world of Geisha. Help Ichisumi in this incredible adventure to reopen the temples of Geisha and restore a world of beauty and passion. Dive into this engaging Match 3 game with beautiful scenery and relaxing music. Overcome obstacles, collect puzzle pieces, and be prepared to solve challenging puzzles in [http://www.dreamsofageisha.com Dreams of a Geisha]!<br />
<br />
Powered by Lazarus FPC, [http://www.zengl.org/ ZenGL], [http://www.phoenixlib.net/ PhoenixLib], [http://www.lua.org/ LUA] and [http://www.codeandweb.com/texturepacker TexturePacker]. Developed by [http://www.greensaucegames.com Green Sauce Games] and Released by [http://www.bigfishgames.com Big Fish Games].<br />
<br />
Demo available for [http://www.bigfishgames.com/download-games/12814/dreams-of-a-geisha/index.html Windows], [http://www.bigfishgames.com/download-games/13045/mac/dreams-of-a-geisha/index.html Mac], [http://itunes.apple.com/us/app/dreams-of-a-geisha/id460180656?mt=8 iPhone], [http://itunes.apple.com/us/app/dreams-of-a-geisha-hd/id459801505?mt=8 iPad].<br />
<br />
[[File:Dreams of a Geisha - Screenshot 1.jpg|border|270px]]<br />
<br />
== Eschecs ==<br />
<br />
[https://github.com/rchastain/eschecs Eschecs] is an application to play chess against different artificial opponents. ''Eschecs'' uses the [[fpGUI]] Toolkit, and the [[uos]] and [[BGRABitmap]] libraries.<br />
<br />
[[Image:eschecs500f.png|300x300px]] <br />
<br />
== fpChess ==<br />
<br />
[[fpChess]] is still under construction. It should support playing via the internet as well as against a computer AI. <br />
<br />
[[Image:Fpchess.png|240px]]<br />
<br />
== Game Maker ==<br />
<br />
[http://www.yoyogames.com/gamemaker Game Maker] allows you to make computer games using easy to learn drag-and-drop actions. You can create professional looking games within very little time. You can make games with backgrounds, animated graphics, music and sound effects, and even 3D games! And when you've become more experienced, there is a built-in programming language, which gives you the full flexibility of creating games with Game Maker. What is best, is the fact that Game Maker can be used free of charge.<br />
<br />
Originally written in Delphi, Lazarus/Free Pascal was used to port it from Win32 to macOS. Available for Windows desktop, macOS, Ubuntu, Android, iOS, tvOS, fireTV, Android TV, Microsoft UWP, HTML5, PlayStation 4, and Xbox One.<br />
<br />
== Hedge Wars ==<br />
<br />
[http://www.hedgewars.org/ Hedge Wars] is a worm-like game with very nice graphics and good AI. The game features typical worms gameplay including net play. The game itself is written in FPC while the config application is C++/Qt.<br />
<br />
[[Image: HedgeWarsPage.png|320px| HedgeWars Scene]]<br />
<br />
== JavaneseChess ==<br />
<br />
[https://bitbucket.org/leledumbo/javanese-chess JavaneseChess] is a Javanese chess game implementation. Available for Desktop platforms and Android (not feature complete yet).<br />
<br />
== Juegos Iniciales ==<br />
<br />
[http://juegosenlazaruscostarricenses.com Juegos Iniciales] are a small collection of 3D tutorial games in<br />
Lazarus, SDL and Free Pascal. In 2016, there were only four games:<br />
[http://origamisiniciales.juegosenlazaruscostarricenses.com Origamis Iniciales], <br />
[http://bloquesiniciales.juegosenlazaruscostarricenses.com Bloques Iniciales], <br />
[http://nudosiniciales.juegosenlazaruscostarricenses.com Nudos Iniciales],<br />
[http://palitos-iniciales.juegosenlazaruscostarricenses.com Palitos Iniciales].<br />
<br />
== LazGobang ==<br />
<br />
[http://files.cnblogs.com/lazarus/LazGobang.rar LazGobang] is a Gobang game, powered by Lazarus and Free Pascal. <br />
<br />
== Lazarus Mazes ==<br />
<br />
The [https://github.com/eny-fpc/lazes Lazarus Mazes] program is a demonstration of how you can use Lazarus to create a maze. The maze generation is based on a [http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search depth-first backtracking] algorithm. As a bonus, a simple maze solver is also implemented that shows a route from the start of the maze to the exit.<br />
<br />
[[Image:mazedemo1.png|400px]]<br />
<br />
== LBP Level Logger ==<br />
<br />
[http://code.google.com/p/lbplevellogger/ LBP Level Logger] is a small system tray application designed to log [http://www.littlebigplanet.com/ LittleBigPlanet] level statistics from [http://lbp.me/ lbp.me] over time for graphing/visualisation. It is written in Free Pascal/Lazarus.<br />
<br />
[[File:lbplevellogger-screenshot.png]]<br />
<br />
== Lentil Wars ==<br />
<br />
[http://lwars.sourceforge.net/ Lentil Wars] is an arcade action game for Linux and Windows that is still under development. Players combat each other in multiple nicely designed levels. Lentil Wars can be played both on a single computer as well as over a network.<br />
<br />
[[Image:LentilWars.jpg|320px| Lentil Wars Scene]]<br />
<br />
== Mundo Medieval 3D MMORPG ==<br />
<br />
Featuring a virtual world of more than 1.000.000 m2, plus caves and hell sceneries, 17 NPCs, 21 kinds of monsters, including 7 bosses, 58 different items and 100 quests, this is a really large game made with Free Pascal/Lazarus. The project is 100% free software, both code and media are licensed under GPL. The project sites are [http://www.gamemundo.com/ http://www.gamemundo.com/] and [http://sourceforge.net/projects/gamemundo/ http://sourceforge.net/projects/gamemundo/].<br />
<br />
[[File:Mundo - Screenshot 1.png|border|270px]]<br />
[[File:Mundo - Screenshot 2.png|border|270px]]<br />
[[File:Mundo - Screenshot 3.png|border|270px]]<br />
<br />
== Peg Solitaire tutorial ==<br />
<br />
[[Peg Solitaire tutorial|Peg Solitaire]] serves as a game (Peg Solitaire) tutorial that aims at introducing the user to the basics of Lazarus application development. Source available.<br />
<br />
[[Image:tutpeg_solitaire.png|340px]]<br />
<br />
== Petris ==<br />
<br />
[[Petris]] is yet another Tetris clone. [https://github.com/eny-fpc/petris Source available].<br />
<br />
[[Image:petris.png|320px]]<br />
<br />
== Retro Ski Run ==<br />
<br />
[https://sourceforge.net/projects/retroskirun/ Retro Ski Run] is a simple ski game for Windows 32/64bit and Linux 32/64-bit.<br />
<br />
[[Image:ss_rsrStartScreen.jpg|border|270px]]<br />
<br />
== Robot - The Game ==<br />
<br />
[[Robot - The Game|Robot]] is a game in which you control a character through a world consisting of 5*5 rooms, each with 20*20 fields. Every field contains a special game object; this can be a wall, a bad robot who wants to kill you (because of the robots, the game is named Robot), a door (for each door, you need a special key) and so on. [https://sourceforge.net/projects/lazarus-ccr/files/Demos and examples/Robot 1.7/ Source available].<br />
<br />
[[Image:robot1.5-shot1.png|320px]]<br />
<br />
== Snake for ptcGraph ==<br />
<br />
[https://gitlab.com/rchastain/snake-ptcgraph Snake for ptcGraph] is a simple snake game based on the ptcGraph unit. Steer the snake with keyboard arrows and eat as many fruits as you can.<br />
<br />
[[Image:snake2.png|320px]]<br />
<br />
== UltraStar Deluxe ==<br />
<br />
[http://ultrastardx.sourceforge.net/ UltraStar Deluxe] is a free and open source karaoke game inspired by the Singstar™ game available on the Playstation®. It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of the singing. It is currently available for Windows, Linux, macOS and FreeBSD.<br />
<br />
[[Image:UltraStarDeluxeMainPage.png|400px|UltraStar Deluxe Main Page]] <br />
<br />
== ValisoaChess ==<br />
<br />
[https://sourceforge.net/projects/valisoachess/?source=directory ValisoaChess] is a chess game written in Free Pascal and Lazarus. The main goal is to create a simple yet powerful chess engine.<br />
<br />
[[Image:valisoachess.jpg|320px]]<br />
<br />
== Zen GL updated ==<br />
<br />
[https://sourceforge.net/p/zengllinux/code/ci/default/tree/ Zen GL] is a 2D game engine. Now Zen GL uses Steam Game Libraries. You can migrate your Delphi X or Image Sprite old 2D Delphi games with that Zen GL upgraded Game Engine. The Zen GL Linux packages are zgl.deb or zgl.rpm.<br />
<br />
And also an updated version of [https://github.com/Seenkao/New-ZenGL ZenGL] with support for Android and MacOS Cocoa. In Russian. Support for English is evolving. Inside there is a link to the iOS version but the new features are not included.<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Historical]]<br />
[[Category:Promotion]]<br />
[[Category:Software created with Lazarus]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Games]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=145060Create snap package2021-06-02T16:38:04Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -s -m 755 myapp $SNAPCRAFT_PART_INSTALL/usr/share/myapp<br />
install -d -m 755 $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft push myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 edge</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144912Create snap package2021-05-12T19:41:17Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
- x11<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft push myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 edge</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:/run/user/1000/pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144907Create snap package2021-05-10T21:45:20Z<p>Chronos: /* Sound support */</p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft push myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 edge</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Sound support=<br />
Snap supports sound through '''audio-playback''' plug.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- audio-playback<br />
</pre><br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add additional stage-packages to myapp part and setup sox player for pulseaudio:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
<br />
environment:<br />
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio<br />
PULSE_SERVER: unix:$XDG_RUNTIME_DIR/../pulse/native<br />
<br />
layout:<br />
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox:<br />
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/sox<br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144797Create snap package2021-05-03T17:26:15Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Publish your package in Snap Store=<br />
* <pre>snapcraft register</pre><br />
* <pre>snapcraft login</pre><br />
* <pre>snapcraft push myapp.snap</pre><br />
* <pre>snapcraft release myapp 1 edge</pre><br />
* Now your snap should be released and available on snapcraft.io store.<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Sound support=<br />
Snap supports sound through plugs pulseaudio and audio-playback.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- pulseaudio<br />
- audio-playback<br />
</pre><br />
See [https://snapcraft.io/docs/alsa-interface The alsa interface] and [https://snapcraft-alsa.readthedocs.io/en/latest/ snapcraft-alsa] for ALSA support in snap.<br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add stage-packages to myapp part:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144749Create snap package2021-04-28T16:15:55Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Debug snap=<br />
<br />
To get to console of snap virtual filesystem use:<br />
<pre>snap run --shell myapp<br />
cd $SNAP</pre><br />
Type '''exit''' to leave snap environment.<br />
See [https://snapcraft.io/docs/debug-snaps Debugging snaps] for more information.<br />
<br />
=Sound support=<br />
Snap supports sound through plugs pulseaudio and audio-playback.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- pulseaudio<br />
- audio-playback<br />
</pre><br />
See [https://snapcraft.io/docs/alsa-interface The alsa interface] and [https://snapcraft-alsa.readthedocs.io/en/latest/ snapcraft-alsa] for ALSA support in snap.<br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add stage-packages to myapp part:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Play_Sound_Multiplatform&diff=144743Play Sound Multiplatform2021-04-26T18:12:10Z<p>Chronos: </p>
<hr />
<div>==Summary==<br />
<br />
* The object is to play a simple WAV sound both in Windows and Linux (Sync and ASync)<br />
* There are lots of libraries to do this in a complicated way, but this code should suffice for simple use<br />
<br />
===Download Component===<br />
<br />
Download from the lazarus CCR [https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/playsoundpackage/ here] (playsoundpackage)<br />
<br />
===Installation of component===<br />
<br />
*Download all the 'playsoundpackage' package files from the Lazarus CCR repository and copy the whole folder structure to an empty folder off your lazarus components folder<br />
*Install the package (open it, Compile then Install it) and '''TPlaysound''' will appear on your 'LazControls' components tab<br />
*Drop onto a form, set properties and you are good to go<br />
*PlayCommand property is populated automatically by testing which will work with your system.<br />
*Opening the demo application will give you a good idea how to set the additional properties and use the component<br />
<br />
===Version===<br />
<br />
*As reported in the IDE. Initial version is 0.0.2<br />
<br />
===License===<br />
<br />
*LGPLv2<br />
<br />
==Code==<br />
<br />
*Here is the Uses clause in the Implementation section:<br />
<br />
<syntaxhighlight lang="pascal"><br />
..other units..<br />
FileUtil{$IFDEF WINDOWS},mmsystem{$ELSE},asyncprocess,process{$ENDIF},StrUtils<br />
..other units..<br />
</syntaxhighlight><br />
<br />
*Declare a type:<br />
<br />
<syntaxhighlight lang="pascal"><br />
TPlayStyle = (psAsync,psSync);<br />
</syntaxhighlight><br />
<br />
*Declare some variables:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{$IFNDEF WINDOWS}<br />
SoundPlayerAsyncProcess:Tasyncprocess;<br />
SoundPlayerSyncProcess:Tprocess;<br />
{$ENDIF}<br />
fPathToSoundFile:String;<br />
fPlayStyle:TPlayStyle;<br />
</syntaxhighlight><br />
<br />
*And a worker function:<br />
<br />
<syntaxhighlight lang="pascal"><br />
procedure PlaySound(Const szSoundFilename:String);<br />
</syntaxhighlight><br />
<br />
*And a couple of constants:<br />
<br />
<syntaxhighlight lang="pascal"><br />
CONST C_UnableToPlay = 'Unable to play ';<br />
{$IFNDEF WINDOWS}<br />
// Defined in mmsystem<br />
SND_SYNC=0;<br />
SND_ASYNC=1;<br />
SND_NODEFAULT=2;<br />
{$ENDIF}<br />
</syntaxhighlight><br />
<br />
*Now you are good to go:<br />
<br />
<syntaxhighlight lang="pascal"><br />
fPlayStyle := psASync;<br />
fPathToSoundFile:='mysound.wav';<br />
If FileExistsUTF8(fPathToSoundFile) then PlaySound(fPathToSoundFile);<br />
</syntaxhighlight><br />
<br />
*Here's the PlaySound procedure<br />
<br />
<syntaxhighlight lang="pascal"><br />
procedure PlaySound(const szSoundFilename: string);<br />
var<br />
flags: word;<br />
szNonWindowsPlayCommand: string;<br />
begin<br />
szNonWindowsPlayCommand := '';<br />
{$IFDEF WINDOWS}<br />
if fPlayStyle = psASync then<br />
flags := SND_ASYNC or SND_NODEFAULT<br />
else<br />
flags := SND_SYNC or SND_NODEFAULT;<br />
try<br />
sndPlaySound(PChar(szSoundFilename), flags);<br />
except<br />
On E: Exception do<br />
E.CreateFmt(C_UnableToPlay +<br />
'%s Message:%s', [szSoundFilename, E.Message]);<br />
end;<br />
{$ELSE}<br />
// How to play in Linux? Use generic Linux commands<br />
// Use asyncprocess to play sound as SND_ASYNC<br />
// Try play<br />
if (FindDefaultExecutablePath('play') <> '') then<br />
szNonWindowsPlayCommand := 'play -q';<br />
// Try aplay<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('aplay') <> '') then<br />
szNonWindowsPlayCommand := 'aplay -q ';<br />
// Try paplay<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('paplay') <> '') then<br />
szNonWindowsPlayCommand := 'paplay';<br />
// Try mplayer<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('mplayer') <> '') then<br />
szNonWindowsPlayCommand := 'mplayer -really-quiet ';<br />
// Try CMus<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('CMus') <> '') then<br />
szNonWindowsPlayCommand := 'CMus ';<br />
// Try pacat<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('pacat') <> '') then<br />
szNonWindowsPlayCommand := 'pacat -p ';<br />
// Try ffplay<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('ffplay') <> '') then<br />
szNonWindowsPlayCommand := 'ffplay -autoexit -nodisp -loglevel quiet';<br />
// Try cvlc<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('cvlc') <> '') then<br />
szNonWindowsPlayCommand := 'cvlc -q --play-and-exit ';<br />
// Try canberra-gtk-play<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('canberra-gtk-play') <> '') then<br />
szNonWindowsPlayCommand := 'canberra-gtk-play -c never -f ';<br />
// Try Macintosh command?<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('afplay') <> '') then<br />
szNonWindowsPlayCommand := 'afplay';<br />
// Try mpg321<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('mpg321') <> '') then<br />
szNonWindowsPlayCommand := 'mpg321 -q';<br />
// proceed if we managed to find a valid command<br />
if (szNonWindowsPlayCommand <> '') then<br />
begin<br />
if fPlayStyle = psASync then<br />
begin<br />
if SoundPlayerAsyncProcess = nil then<br />
SoundPlayerAsyncProcess := Tasyncprocess.Create(nil);<br />
SoundPlayerAsyncProcess.CurrentDirectory := ExtractFileDir(szSoundFilename);<br />
SoundPlayerAsyncProcess.Executable :=<br />
FindDefaultExecutablePath(Copy2Space(szNonWindowsPlayCommand));<br />
SoundPlayerAsyncProcess.Parameters.Clear;<br />
SoundPlayerAsyncProcess.Parameters.Add(szSoundFilename);<br />
try<br />
SoundPlayerAsyncProcess.Execute;<br />
except<br />
On E: Exception do<br />
E.CreateFmt('Playstyle=paASync: ' + C_UnableToPlay +<br />
'%s Message:%s', [szSoundFilename, E.Message]);<br />
end;<br />
end<br />
else<br />
begin<br />
if SoundPlayerSyncProcess = nil then<br />
SoundPlayerSyncProcess := Tprocess.Create(nil);<br />
SoundPlayerSyncProcess.CurrentDirectory := ExtractFileDir(szSoundFilename);<br />
SoundPlayerSyncProcess.Executable :=<br />
FindDefaultExecutablePath(Copy2Space(szNonWindowsPlayCommand));<br />
SoundPlayersyncProcess.Parameters.Clear;<br />
SoundPlayerSyncProcess.Parameters.Add(szSoundFilename);<br />
try<br />
SoundPlayerSyncProcess.Execute;<br />
SoundPlayersyncProcess.WaitOnExit;<br />
except<br />
On E: Exception do<br />
E.CreateFmt('Playstyle=paSync: ' + C_UnableToPlay +<br />
'%s Message:%s', [szSoundFilename, E.Message]);<br />
end;<br />
end;<br />
end<br />
else<br />
raise Exception.CreateFmt('The play command %s does not work on your system',<br />
[szNonWindowsPlayCommand]);<br />
{$ENDIF}<br />
end;<br />
</syntaxhighlight><br />
<br />
*Destroy the process objects in your Destroy procedure:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{$IFNDEF WINDOWS}<br />
FreeAndNil(SoundPlayerSyncProcess);<br />
FreeAndNil(SoundPlayerAsyncProcess);<br />
{$ENDIF}<br />
</syntaxhighlight><br />
<br />
[[Category:Audio]]<br />
[[Category:Components]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144742Create snap package2021-04-26T17:52:29Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
:* [https://github.com/search?q=filename%3Asnapcraft.yaml+%22lazbuild%22&amp;type=Code Sample snapcraft.yaml files using lazbuild on Github]<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Sound support=<br />
Snap supports sound through plugs pulseaudio and audio-playback.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- pulseaudio<br />
- audio-playback<br />
</pre><br />
See [https://snapcraft.io/docs/alsa-interface The alsa interface] and [https://snapcraft-alsa.readthedocs.io/en/latest/ snapcraft-alsa] for ALSA support in snap.<br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add stage-packages to myapp part:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144731Create snap package2021-04-25T11:23:08Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
plugs:<br />
- home<br />
- desktop<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=Sound support=<br />
Snap supports sound through plugs pulseaudio and audio-playback.<br />
<pre><br />
apps:<br />
myapp:<br />
plugs:<br />
- pulseaudio<br />
- audio-playback<br />
</pre><br />
See [https://snapcraft.io/docs/alsa-interface The alsa interface] and [https://snapcraft-alsa.readthedocs.io/en/latest/ snapcraft-alsa] for ALSA support in snap.<br />
<br />
You can play wav and mp3 files from command line using '''play''' command. See [[Play Sound Multiplatform]]. Then you also need to add stage-packages to myapp part:<br />
<pre><br />
parts:<br />
myapp:<br />
stage-packages: <br />
- sox<br />
- libsox-fmt-mp3<br />
- libsox-fmt-pulse<br />
- libpulse0 <br />
</pre><br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Play_Sound_Multiplatform&diff=144730Play Sound Multiplatform2021-04-25T11:00:55Z<p>Chronos: Added mpg321 as another possible command for playing sound files.</p>
<hr />
<div>==Summary==<br />
<br />
* The object is to play a simple WAV sound both in Windows and Linux (Sync and ASync)<br />
* There are lots of libraries to do this in a complicated way, but this code should suffice for simple use<br />
<br />
===Download Component===<br />
<br />
Download from the lazarus CCR [https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/playsoundpackage/ here] (playsoundpackage)<br />
<br />
===Installation of component===<br />
<br />
*Download all the 'playsoundpackage' package files from the Lazarus CCR repository and copy the whole folder structure to an empty folder off your lazarus components folder<br />
*Install the package (open it, Compile then Install it) and '''TPlaysound''' will appear on your 'LazControls' components tab<br />
*Drop onto a form, set properties and you are good to go<br />
*PlayCommand property is populated automatically by testing which will work with your system.<br />
*Opening the demo application will give you a good idea how to set the additional properties and use the component<br />
<br />
===Version===<br />
<br />
*As reported in the IDE. Initial version is 0.0.2<br />
<br />
===License===<br />
<br />
*LGPLv2<br />
<br />
==Code==<br />
<br />
*Here is the Uses clause in the Implementation section:<br />
<br />
<syntaxhighlight lang="pascal"><br />
..other units..<br />
FileUtil{$IFDEF WINDOWS},mmsystem{$ELSE},asyncprocess,process{$ENDIF},StrUtils<br />
..other units..<br />
</syntaxhighlight><br />
<br />
*Declare a type:<br />
<br />
<syntaxhighlight lang="pascal"><br />
TPlayStyle = (psAsync,psSync);<br />
</syntaxhighlight><br />
<br />
*Declare some variables:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{$IFNDEF WINDOWS}<br />
SoundPlayerAsyncProcess:Tasyncprocess;<br />
SoundPlayerSyncProcess:Tprocess;<br />
{$ENDIF}<br />
fPathToSoundFile:String;<br />
fPlayStyle:TPlayStyle;<br />
</syntaxhighlight><br />
<br />
*And a worker function:<br />
<br />
<syntaxhighlight lang="pascal"><br />
procedure PlaySound(Const szSoundFilename:String);<br />
</syntaxhighlight><br />
<br />
*And a couple of constants:<br />
<br />
<syntaxhighlight lang="pascal"><br />
CONST C_UnableToPlay = 'Unable to play ';<br />
{$IFNDEF WINDOWS}<br />
// Defined in mmsystem<br />
SND_SYNC=0;<br />
SND_ASYNC=1;<br />
SND_NODEFAULT=2;<br />
{$ENDIF}<br />
</syntaxhighlight><br />
<br />
*Now you are good to go:<br />
<br />
<syntaxhighlight lang="pascal"><br />
fPlayStyle := psASync;<br />
fPathToSoundFile:='mysound.wav';<br />
If FileExistsUTF8(fPathToSoundFile) then PlaySound(fPathToSoundFile);<br />
</syntaxhighlight><br />
<br />
*Here's the PlaySound procedure<br />
<br />
<syntaxhighlight lang="pascal"><br />
procedure PlaySound(const szSoundFilename: string);<br />
var<br />
flags: word;<br />
szNonWindowsPlayCommand: string;<br />
begin<br />
szNonWindowsPlayCommand := '';<br />
{$IFDEF WINDOWS}<br />
if fPlayStyle = psASync then<br />
flags := SND_ASYNC or SND_NODEFAULT<br />
else<br />
flags := SND_SYNC or SND_NODEFAULT;<br />
try<br />
sndPlaySound(PChar(szSoundFilename), flags);<br />
except<br />
On E: Exception do<br />
E.CreateFmt(C_UnableToPlay +<br />
'%s Message:%s', [szSoundFilename, E.Message]);<br />
end;<br />
{$ELSE}<br />
// How to play in Linux? Use generic Linux commands<br />
// Use asyncprocess to play sound as SND_ASYNC<br />
// Try play<br />
if (FindDefaultExecutablePath('play') <> '') then<br />
szNonWindowsPlayCommand := 'play';<br />
// Try aplay<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('aplay') <> '') then<br />
szNonWindowsPlayCommand := 'aplay -q ';<br />
// Try paplay<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('paplay') <> '') then<br />
szNonWindowsPlayCommand := 'paplay';<br />
// Try mplayer<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('mplayer') <> '') then<br />
szNonWindowsPlayCommand := 'mplayer -really-quiet ';<br />
// Try CMus<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('CMus') <> '') then<br />
szNonWindowsPlayCommand := 'CMus ';<br />
// Try pacat<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('pacat') <> '') then<br />
szNonWindowsPlayCommand := 'pacat -p ';<br />
// Try ffplay<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('ffplay') <> '') then<br />
szNonWindowsPlayCommand := 'ffplay -autoexit -nodisp ';<br />
// Try cvlc<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('cvlc') <> '') then<br />
szNonWindowsPlayCommand := 'cvlc -q --play-and-exit ';<br />
// Try canberra-gtk-play<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('canberra-gtk-play') <> '') then<br />
szNonWindowsPlayCommand := 'canberra-gtk-play -c never -f ';<br />
// Try Macintosh command?<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('afplay') <> '') then<br />
szNonWindowsPlayCommand := 'afplay';<br />
// Try mpg321<br />
if (szNonWindowsPlayCommand = '') then<br />
if (FindDefaultExecutablePath('mpg321') <> '') then<br />
szNonWindowsPlayCommand := 'mpg321 -q';<br />
// proceed if we managed to find a valid command<br />
if (szNonWindowsPlayCommand <> '') then<br />
begin<br />
if fPlayStyle = psASync then<br />
begin<br />
if SoundPlayerAsyncProcess = nil then<br />
SoundPlayerAsyncProcess := Tasyncprocess.Create(nil);<br />
SoundPlayerAsyncProcess.CurrentDirectory := ExtractFileDir(szSoundFilename);<br />
SoundPlayerAsyncProcess.Executable :=<br />
FindDefaultExecutablePath(Copy2Space(szNonWindowsPlayCommand));<br />
SoundPlayerAsyncProcess.Parameters.Clear;<br />
SoundPlayerAsyncProcess.Parameters.Add(szSoundFilename);<br />
try<br />
SoundPlayerAsyncProcess.Execute;<br />
except<br />
On E: Exception do<br />
E.CreateFmt('Playstyle=paASync: ' + C_UnableToPlay +<br />
'%s Message:%s', [szSoundFilename, E.Message]);<br />
end;<br />
end<br />
else<br />
begin<br />
if SoundPlayerSyncProcess = nil then<br />
SoundPlayerSyncProcess := Tprocess.Create(nil);<br />
SoundPlayerSyncProcess.CurrentDirectory := ExtractFileDir(szSoundFilename);<br />
SoundPlayerSyncProcess.Executable :=<br />
FindDefaultExecutablePath(Copy2Space(szNonWindowsPlayCommand));<br />
SoundPlayersyncProcess.Parameters.Clear;<br />
SoundPlayerSyncProcess.Parameters.Add(szSoundFilename);<br />
try<br />
SoundPlayerSyncProcess.Execute;<br />
SoundPlayersyncProcess.WaitOnExit;<br />
except<br />
On E: Exception do<br />
E.CreateFmt('Playstyle=paSync: ' + C_UnableToPlay +<br />
'%s Message:%s', [szSoundFilename, E.Message]);<br />
end;<br />
end;<br />
end<br />
else<br />
raise Exception.CreateFmt('The play command %s does not work on your system',<br />
[szNonWindowsPlayCommand]);<br />
{$ENDIF}<br />
end;<br />
</syntaxhighlight><br />
<br />
*Destroy the process objects in your Destroy procedure:<br />
<br />
<syntaxhighlight lang="pascal"><br />
{$IFNDEF WINDOWS}<br />
FreeAndNil(SoundPlayerSyncProcess);<br />
FreeAndNil(SoundPlayerAsyncProcess);<br />
{$ENDIF}<br />
</syntaxhighlight><br />
<br />
[[Category:Audio]]<br />
[[Category:Components]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144723Create snap package2021-04-24T21:52:10Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: usr/share/myapp/myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
=External links=<br />
* [https://www.digitalocean.com/community/tutorials/how-to-package-and-publish-a-snap-application-on-ubuntu-18-04 How To Package and Publish a Snap Application on Ubuntu 18.04]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144722Create snap package2021-04-24T20:28:03Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: .<br />
source-type: local<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- etc<br />
- lib<br />
- usr<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
</pre><br />
:* See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
:* Lazarus still uses old Gtk2 libraries. See [https://snapcraft.io/docs/gtk2-applications GTK2 Applications] page.<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144720Create snap package2021-04-24T16:03:08Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Example file:<br />
<pre><br />
name: myapp<br />
version: '1.0.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: nil<br />
source: https://somehost/source/location<br />
source-type: subversion<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
stage-packages:<br />
# Autodetected dependencies<br />
- libatk1.0-0<br />
- libcairo2<br />
- libdatrie1<br />
- libfontconfig1<br />
- libfreetype6<br />
- libfribidi0<br />
- libgdk-pixbuf2.0-0<br />
- libgraphite2-3<br />
- libgtk2.0-0<br />
- libharfbuzz0b<br />
- libpango-1.0-0<br />
- libpangocairo-1.0-0<br />
- libpangoft2-1.0-0<br />
- libpixman-1-0<br />
- libpng16-16<br />
- libthai0<br />
- libx11-6<br />
- libxau6<br />
- libxcb-render0<br />
- libxcb-shm0<br />
- libxcb1<br />
- libxcomposite1<br />
- libxcursor1<br />
- libxdamage1<br />
- libxdmcp6<br />
- libxext6<br />
- libxfixes3<br />
- libxi6<br />
- libxinerama1<br />
- libxrandr2<br />
- libxrender1<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
ROOT=/root/parts/myapp/install<br />
install -d -m 755 $ROOT/usr/share/myapp<br />
install -s -m 755 myapp $ROOT/usr/share/myapp<br />
install -d -m 755 $ROOT/usr/share/applications<br />
install -m 755 Install/deb/myapp.desktop $ROOT/usr/share/applications<br />
stage:<br />
- usr/share/myapp<br />
- usr/share/applications/myapp.desktop<br />
<br />
apps:<br />
myapp:<br />
command: myapp<br />
desktop: usr/share/applications/myapp.desktop<br />
</pre><br />
See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
<br />
* Build snap using '''snapcraft''' command<br />
* Install newly created snap with '''sudo snap install --dangerous --devmode myapp_1.0.0_amd64.snap'''<br />
<br />
=snapcraft.yaml file in non-standard subdirectory =<br />
Snapcraft normally expect snapcraft.yaml file in snap directory. If your project has packaging for multiple other packaging formats, then you need to use build workaround script. Such shell script can put into directory like myapp/install/snap/local as build.sh file.<br />
<syntaxhighlight lang="bash"><br />
#!/bin/bash<br />
ln -s install/snap ../../../snap<br />
pushd ../../..<br />
snapcraft<br />
popd<br />
rm ../../../snap<br />
</syntaxhighlight><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144716Create snap package2021-04-24T11:36:58Z<p>Chronos: </p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Sample file:<br />
<pre><br />
name: myapp<br />
version: '1.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core20<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: dump<br />
source: https://somehost/source/location<br />
source-type: subversion<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
override-build: |<br />
lazbuild --build-mode=Release myapp.lpi<br />
<br />
apps:<br />
myapp:<br />
command: myapp<br />
desktop: /usr/share/applications/myapp.desktop<br />
</pre><br />
See [https://snapcraft.io/docs/snapcraft-yaml-reference Snapcraft.yaml reference] for full list of supported properties.<br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Create_snap_package&diff=144713Create snap package2021-04-24T10:53:34Z<p>Chronos: Created page with "=Create snapcraft.yaml= * Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft''' * Create '''snap''' subdirectory in your project * Execute '''snapcraf..."</p>
<hr />
<div>=Create snapcraft.yaml=<br />
* Install snapcraft to your Ubuntu machine with '''sudo apt install snapcraft'''<br />
* Create '''snap''' subdirectory in your project<br />
* Execute '''snapcraft init''' to create '''snap/snapcraft.yaml''' initial file<br />
* Sample file:<br />
<pre><br />
name: myapp<br />
version: '1.0'<br />
summary: Short description of package.<br />
description: |<br />
Some more detailed multi-line description.<br />
confinement: devmode<br />
base: core18<br />
grade: devel<br />
<br />
parts:<br />
myapp:<br />
plugin: dump<br />
source: https://somehost/source/location<br />
source-type: subversion<br />
build-packages: <br />
- fpc<br />
- lazarus<br />
- lcl<br />
- lcl-utils<br />
<br />
apps:<br />
myapp:<br />
command: myapp<br />
</pre><br />
<br />
=Register app in snap store=<br />
* Login into https://snapcraft.io with your user account<br />
* Register new snap package name https://snapcraft.io/account/register-snap<br />
* Go to your newly registered package and fill all needed details https://snapcraft.io/snaps<br />
<br />
=Setup build on Launchpad=<br />
Snap packages can be built automatically on [https://launchpad.net/ Launchpad]. Open '''Create snap package''' link form your application branch page.<br />
<br />
=See also=<br />
* [[Publish project on Launchpad]]<br />
<br />
[[Category:Linux]]<br />
[[Category:Deployment]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Application_full_screen_mode&diff=141255Application full screen mode2020-11-26T11:04:56Z<p>Chronos: /* Universal way to use full-screen */</p>
<hr />
<div>{{Application_full_screen_mode}}<br />
<br />
==Introduction==<br />
<br />
Some applications like some web browsers allow show in full screen mode using key {{keypress|F11}}. In full screen mode window hasn't border and uses entire screen space.<br />
<br />
==Standard way==<br />
<br />
You can switch form to full screen mode simply by assigning '''wsFullScreen''' value to '''TForm.WindowState''' property. You can do that directly in design time in Object Inspector window or in runtime:<br />
<br />
<syntaxhighlight lang=pascal><br />
procedure TForm1.FormShow(Sender: TObject);<br />
begin<br />
WindowState := wsFullScreen;<br />
end;<br />
</syntaxhighlight><br />
<br />
==Universal way to use full-screen==<br />
<br />
Universal way exists, using LCL, you need to call ShowWindow() with SW_SHOWFULLSCREEN. This ShowWindow call is handled inside widgetset, using low-level API (for example, OS X Carbon API, or GTK2 API). Example:<br />
<br />
<syntaxhighlight lang=pascal><br />
uses<br />
..., LCLIntf, LCLType;<br />
<br />
procedure TfmMain.SetFullScreen_Universal(AValue: boolean);<br />
begin<br />
if AValue then<br />
ShowWindow(Handle, SW_SHOWFULLSCREEN)<br />
else<br />
ShowWindow(Handle, SW_SHOWNORMAL); <br />
//maybe consider here previous maximized state?<br />
end;<br />
</syntaxhighlight><br />
<br />
==Win32 way to use full-screen==<br />
<br />
Universal way, above, works for Win32, but window border still stays, so better code which works:<br />
<br />
<syntaxhighlight lang=pascal><br />
procedure TfmMain.SetFullScreen_Win32(AValue: boolean);<br />
begin<br />
if AValue then<br />
begin<br />
FOrigWndState:= WindowState;<br />
FOrigBounds:= BoundsRect;<br />
<br />
BorderStyle:= bsNone;<br />
BoundsRect:= Monitor.BoundsRect;<br />
end<br />
else<br />
begin<br />
WindowState:= FOrigWndState;<br />
BoundsRect:= FOrigBounds;<br />
BorderStyle:= bsSizeable;<br />
BoundsRect:= FOrigBounds; //again<br />
end;<br />
end;<br />
</syntaxhighlight><br />
<br />
===Win32 example program===<br />
<br />
This is example for Win32 only, since it don't use native full-screen mode on Linux/MacOS, it is here from old times.<br />
<br />
To be able to switch to full screen mode you will need:<br />
* Remember previous form state as position and size and window state<br />
* Be able to determine screen size<br />
* Capture some key and perform operation<br />
<br />
Best way to capture desired key is using Actions. Simply define new action in action manager and assign key shortcut. Than shortcut will work even if main form would lost focus.<br />
<br />
<syntaxhighlight lang=pascal>unit Unit1; <br />
<br />
{$mode objfpc}{$H+}<br />
<br />
interface<br />
<br />
uses<br />
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,<br />
Menus;<br />
<br />
type<br />
TForm1 = class(TForm)<br />
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);<br />
private<br />
public<br />
OriginalBounds: TRect;<br />
OriginalWindowState: TWindowState;<br />
ScreenBounds: TRect;<br />
procedure SwitchFullScreen;<br />
end; <br />
<br />
var<br />
Form1: TForm1; <br />
<br />
implementation<br />
<br />
{$R *.lfm}<br />
<br />
{ TForm1 }<br />
<br />
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);<br />
begin<br />
if Key = VK_F11 then<br />
begin<br />
SwitchFullScreen;<br />
Key := 0;<br />
end;<br />
end;<br />
<br />
procedure TForm1.SwitchFullScreen;<br />
begin<br />
if BorderStyle <> bsNone then begin<br />
// To full screen<br />
OriginalWindowState := WindowState;<br />
OriginalBounds := BoundsRect;<br />
<br />
BorderStyle := bsNone;<br />
BoundsRect := Screen.MonitorFromWindow(Handle).BoundsRect;<br />
end else begin<br />
// From full screen<br />
BorderStyle := bsSizeable;<br />
if OriginalWindowState = wsMaximized then<br />
WindowState := wsMaximized<br />
else<br />
BoundsRect := OriginalBounds;<br />
end;<br />
end;<br />
<br />
end.</syntaxhighlight><br />
<br />
===Win32: get task bar size===<br />
<br />
If you want to have task bar visible you have to adjust size according task bar position and size. For Windows:<br />
<br />
<syntaxhighlight lang=pascal>function GetTaskBarSize: TRect;<br />
begin<br />
SystemParametersInfo(SPI_GETWORKAREA, 0, @Result, 0);<br />
end;<br />
</syntaxhighlight><br />
<br />
==GTK way to use full-screen==<br />
<br />
This is low-level code for GTK2, it is used already by LCL in "universal way" above.<br />
<br />
To switch form to full screen dimensions:<br />
<syntaxhighlight lang=pascal><br />
gdk_window_fullscreen(PGtkWidget(Handle)^.window);<br />
</syntaxhighlight><br />
<br />
To roll back to normal mode:<br />
<syntaxhighlight lang=pascal><br />
gdk_window_unfullscreen(PGtkWidget(Handle)^.window);<br />
</syntaxhighlight><br />
<br />
This is GTK2 only. You must add to uses section such modules as gtk2, gdk2, glib2. You can do it by the directive <br />
<syntaxhighlight lang=pascal><br />
{$IFDEF LCLGTK2}, gtk2, gdk2, glib2{$ENDIF}<br />
</syntaxhighlight><br />
<br />
==Changing screen resolution==<br />
<br />
There is no OS independent way to switch screen resolution now.<br />
<br />
For Windows you can find information in article for Delphi [http://delphi.about.com/od/graphics/a/change_display.htm Get and Set Screen Resolution (Display Device Modes)]<br />
<br />
==See also==<br />
<br />
* [[WinCE_Programming_Tips#Making_a_Fullscreen_Application|WinCE Programming Tips - Making a Fullscreen Application]]<br />
<br />
==External links==<br />
<br />
* [http://delphi.about.com/od/delphitips2010/qt/delphi-application-full-screen-mode-f11.htm Run Your Delphi Application in Full Screen - Implement "F11 - Full Screen"]<br />
* [http://lazplanet.blogspot.com/2014/02/make-your-form-fullscreen.html Very simple way to make your form Fullscreen & Restore (LazPlanet)]<br />
<br />
[[Category:Tutorials]]<br />
[[Category:Lazarus]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Games&diff=139935Projects using Lazarus - Games2020-09-05T18:29:20Z<p>Chronos: /* C-evo */</p>
<hr />
<div>{{Sidebar-LazProjects}}<br />
<br />
== 15-puzzle ==<br />
<br />
[[15-puzzle]] is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The object of the puzzle is to place the tiles in order by making sliding moves that use the empty space. <br />
<br />
[[image:puzzle15.png]]<br />
<br />
== 2048 ==<br />
<br />
[https://app.zdechov.net/2048 2048] is a Lazarus implementation of famous block sliding puzzle [https://en.wikipedia.org/wiki/2048_(video_game) video game].<br />
<br />
[[Image:2048.png|200px]]<br />
<br />
== BigMetro ==<br />
<br />
[http://app.zdechov.net/BigMetro BigMetro] is metro building game inspired by [https://en.wikipedia.org/wiki/Mini_Metro_(video_game) MiniMetro] game.<br />
<br />
[[File:BitMetro_small.png|border|200px]]<br />
[[File:BigMetro_main.png|border|270px]]<br />
<br />
== Bomber Kat ==<br />
<br />
Commercial game developed with FPC for iOS (both arm and arm64 platforms are supported). [[ZenGL]] based. Lazarus has been used as a primary IDE. Link: [https://itunes.apple.com/app/bomber-kat/id1109783786?ls=1&mt=8 App Store]<br />
<br />
== C-evo ==<br />
<br />
[https://app.zdechov.net/c-evo C-evo] is a turn-based empire building game inspired by Civilization II game. It was [http://c-evo.org/ originally] developed using Delphi 4 but later fully porter to Lazarus.<br />
<br />
[[File:C-evo start.png|border|270px]]<br />
[[File:C-evo game.png|border|270px]]<br />
[[File:C-evo game2.jpg|border|270px]]<br />
<br />
== Castle Game Engine ==<br />
<br />
[[Castle Game Engine]] ([http://castle-engine.sourceforge.net/ project page]) is a 3D open-source game engine. The engine was developed from the beginning using Free Pascal (we have also Lazarus components) in nice and clean ObjectPascal code. We support many 3D model formats, including [http://castle-engine.sourceforge.net/vrml_x3d.php VRML/X3D], Collada, 3DS and many others. Tools and games using the engine include: <br />
* [http://castle-engine.sourceforge.net/view3dscene.php view3dscene - 3D model viewer, VRML/X3D browser], <br />
* [http://castle-engine.sourceforge.net/castle.php The Castle - FPS game in a dark fantasy world], <br />
* [http://castle-engine.sourceforge.net/darkest_before_dawn.php Darkest Before the Dawn - small scary 3D game for standalone and Android (also on Google Play)]<br />
<br />
== Common Loon Hearts ==<br />
<br />
[https://web.ncf.ca/di874/computers/hearts/hearts.html Common Loon Hearts] is the card game Hearts. It is written in Free Pascal with the Lazarus IDE for Windows and Linux. Source code is available [https://github.com/oldgizahub/hearts here].<br />
<br />
[[Image:hearts_screen.png|320px]]<br />
<br />
== DMines ==<br />
<br />
[http://dmines.sourceforge.net/ DMines] is an edition of the classic game Minesweeper with a dynamic twist, unrevealed mines can change location every set number of seconds.<br />
<br />
[[Image: DMinesExample.jpg|400px]]<br />
<br />
== Dreams of a Geisha ==<br />
<br />
Take a journey through the magical and wonderful world of Geisha. Help Ichisumi in this incredible adventure to reopen the temples of Geisha and restore a world of beauty and passion. Dive into this engaging Match 3 game with beautiful scenery and relaxing music. Overcome obstacles, collect puzzle pieces, and be prepared to solve challenging puzzles in [http://www.dreamsofageisha.com Dreams of a Geisha]!<br />
<br />
Powered by Lazarus FPC, [http://www.zengl.org/ ZenGL], [http://www.phoenixlib.net/ PhoenixLib], [http://www.lua.org/ LUA] and [http://www.codeandweb.com/texturepacker TexturePacker]. Developed by [http://www.greensaucegames.com Green Sauce Games] and Released by [http://www.bigfishgames.com Big Fish Games].<br />
<br />
Demo available for [http://www.bigfishgames.com/download-games/12814/dreams-of-a-geisha/index.html Windows], [http://www.bigfishgames.com/download-games/13045/mac/dreams-of-a-geisha/index.html Mac], [http://itunes.apple.com/us/app/dreams-of-a-geisha/id460180656?mt=8 iPhone], [http://itunes.apple.com/us/app/dreams-of-a-geisha-hd/id459801505?mt=8 iPad].<br />
<br />
[[File:Dreams of a Geisha - Screenshot 1.jpg|border|270px]]<br />
<br />
== Eschecs ==<br />
<br />
[https://github.com/rchastain/eschecs Eschecs] is an application to play chess against different artificial opponents. ''Eschecs'' uses the [[fpGUI]] Toolkit, and the [[uos]] and [[BGRABitmap]] libraries.<br />
<br />
[[Image:eschecs500f.png|300x300px]] <br />
<br />
== fpChess ==<br />
<br />
[[fpChess]] is still under construction. It should support playing via the internet as well as against a computer AI. <br />
<br />
[[Image:Fpchess.png|240px]]<br />
<br />
== Game Maker ==<br />
<br />
[http://www.yoyogames.com/gamemaker Game Maker] allows you to make computer games using easy to learn drag-and-drop actions. You can create professional looking games within very little time. You can make games with backgrounds, animated graphics, music and sound effects, and even 3D games! And when you've become more experienced, there is a built-in programming language, which gives you the full flexibility of creating games with Game Maker. What is best, is the fact that Game Maker can be used free of charge.<br />
<br />
Originally written in Delphi, Lazarus/Free Pascal was used to port it from Win32 to macOS. Available for Windows desktop, macOS, Ubuntu, Android, iOS, tvOS, fireTV, Android TV, Microsoft UWP, HTML5, PlayStation 4, and Xbox One.<br />
<br />
== Hedge Wars ==<br />
<br />
[http://www.hedgewars.org/ Hedge Wars] is a worm-like game with very nice graphics and good AI. The game features typical worms gameplay including net play. The game itself is written in FPC while the config application is C++/Qt.<br />
<br />
[[Image: HedgeWarsPage.png|320px| HedgeWars Scene]]<br />
<br />
== JavaneseChess ==<br />
<br />
[https://bitbucket.org/leledumbo/javanese-chess JavaneseChess] is a Javanese chess game implementation. Available for Desktop platforms and Android (not feature complete yet).<br />
<br />
== Juegos Iniciales ==<br />
<br />
[http://juegosenlazaruscostarricenses.com Juegos Iniciales] are a small collection of 3D tutorial games in<br />
Lazarus, SDL and Free Pascal. In 2016, there were only four games:<br />
[http://origamisiniciales.juegosenlazaruscostarricenses.com Origamis Iniciales], <br />
[http://bloquesiniciales.juegosenlazaruscostarricenses.com Bloques Iniciales], <br />
[http://nudosiniciales.juegosenlazaruscostarricenses.com Nudos Iniciales],<br />
[http://palitos-iniciales.juegosenlazaruscostarricenses.com Palitos Iniciales].<br />
<br />
== LazGobang ==<br />
<br />
[http://files.cnblogs.com/lazarus/LazGobang.rar LazGobang] is a Gobang game, powered by Lazarus and Free Pascal. <br />
<br />
== Lazarus Mazes ==<br />
<br />
The [https://github.com/eny-fpc/lazes Lazarus Mazes] program is a demonstration of how you can use Lazarus to create a maze. The maze generation is based on a [http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search depth-first backtracking] algorithm. As a bonus, a simple maze solver is also implemented that shows a route from the start of the maze to the exit.<br />
<br />
[[Image:mazedemo1.png|400px]]<br />
<br />
== LBP Level Logger ==<br />
<br />
[http://code.google.com/p/lbplevellogger/ LBP Level Logger] is a small system tray application designed to log [http://www.littlebigplanet.com/ LittleBigPlanet] level statistics from [http://lbp.me/ lbp.me] over time for graphing/visualisation. It is written in Free Pascal/Lazarus.<br />
<br />
[[File:lbplevellogger-screenshot.png]]<br />
<br />
== Lentil Wars ==<br />
<br />
[http://lwars.sourceforge.net/ Lentil Wars] is an arcade action game for Linux and Windows that is still under development. Players combat each other in multiple nicely designed levels. Lentil Wars can be played both on a single computer as well as over a network.<br />
<br />
[[Image:LentilWars.jpg|320px| Lentil Wars Scene]]<br />
<br />
== Mundo Medieval 3D MMORPG ==<br />
<br />
Featuring a virtual world of more than 1.000.000 m2, plus caves and hell sceneries, 17 NPCs, 21 kinds of monsters, including 7 bosses, 58 different items and 100 quests, this is a really large game made with Free Pascal/Lazarus. The project is 100% free software, both code and media are licensed under GPL. The project sites are [http://www.gamemundo.com/ http://www.gamemundo.com/] and [http://sourceforge.net/projects/gamemundo/ http://sourceforge.net/projects/gamemundo/].<br />
<br />
[[File:Mundo - Screenshot 1.png|border|270px]]<br />
[[File:Mundo - Screenshot 2.png|border|270px]]<br />
[[File:Mundo - Screenshot 3.png|border|270px]]<br />
<br />
== Peg Solitaire tutorial ==<br />
<br />
[[Peg Solitaire tutorial|Peg Solitaire]] serves as a game (Peg Solitaire) tutorial that aims at introducing the user to the basics of Lazarus application development. Source available.<br />
<br />
[[Image:tutpeg_solitaire.png|340px]]<br />
<br />
== Petris ==<br />
<br />
[[Petris]] is yet another Tetris clone. [https://github.com/eny-fpc/petris Source available].<br />
<br />
[[Image:petris.png|320px]]<br />
<br />
== Retro Ski Run ==<br />
<br />
[https://sourceforge.net/projects/retroskirun/ Retro Ski Run] is a simple ski game for Windows 32/64bit and Linux 32/64-bit.<br />
<br />
[[Image:ss_rsrStartScreen.jpg|border|270px]]<br />
<br />
== Robot - The Game ==<br />
<br />
[[Robot - The Game|Robot]] is a game in which you control a character through a world consisting of 5*5 rooms, each with 20*20 fields. Every field contains a special game object; this can be a wall, a bad robot who wants to kill you (because of the robots, the game is named Robot), a door (for each door, you need a special key) and so on. [https://sourceforge.net/projects/lazarus-ccr/files/Demos and examples/Robot 1.7/ Source available].<br />
<br />
[[Image:robot1.5-shot1.png|320px]]<br />
<br />
== UltraStar Deluxe ==<br />
<br />
[http://ultrastardx.sourceforge.net/ UltraStar Deluxe] is a free and open source karaoke game inspired by the Singstar™ game available on the Playstation®. It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of the singing. It is currently available for Windows, Linux, macOS and FreeBSD.<br />
<br />
[[Image:UltraStarDeluxeMainPage.png|400px|UltraStar Deluxe Main Page]] <br />
<br />
== ValisoaChess ==<br />
<br />
[https://sourceforge.net/projects/valisoachess/?source=directory ValisoaChess] is a chess game written in Free Pascal and Lazarus. The main goal is to create a simple yet powerful chess engine.<br />
<br />
[[Image:valisoachess.jpg|320px]]<br />
<br />
== Zen GL updated ==<br />
<br />
[https://sourceforge.net/p/zengllinux/code/ci/default/tree/ Zen GL] is a 2D game engine. Now Zen GL uses Steam Game Libraries. You can migrate your Delphi X or Image Sprite old 2D Delphi games with that Zen GL upgraded Game Engine. The Zen GL Linux packages are zgl.deb or zgl.rpm.<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Historical]]<br />
[[Category:Promotion]]<br />
[[Category:Software created with Lazarus]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Games]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=Projects_using_Lazarus_-_Games&diff=139934Projects using Lazarus - Games2020-09-05T18:28:02Z<p>Chronos: </p>
<hr />
<div>{{Sidebar-LazProjects}}<br />
<br />
== 15-puzzle ==<br />
<br />
[[15-puzzle]] is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The object of the puzzle is to place the tiles in order by making sliding moves that use the empty space. <br />
<br />
[[image:puzzle15.png]]<br />
<br />
== 2048 ==<br />
<br />
[https://app.zdechov.net/2048 2048] is a Lazarus implementation of famous block sliding puzzle [https://en.wikipedia.org/wiki/2048_(video_game) video game].<br />
<br />
[[Image:2048.png|200px]]<br />
<br />
== BigMetro ==<br />
<br />
[http://app.zdechov.net/BigMetro BigMetro] is metro building game inspired by [https://en.wikipedia.org/wiki/Mini_Metro_(video_game) MiniMetro] game.<br />
<br />
[[File:BitMetro_small.png|border|200px]]<br />
[[File:BigMetro_main.png|border|270px]]<br />
<br />
== Bomber Kat ==<br />
<br />
Commercial game developed with FPC for iOS (both arm and arm64 platforms are supported). [[ZenGL]] based. Lazarus has been used as a primary IDE. Link: [https://itunes.apple.com/app/bomber-kat/id1109783786?ls=1&mt=8 App Store]<br />
<br />
== C-evo ==<br />
<br />
[https://app.zdechov.net/c-evo C-evo] is a turn-based empire building game inspired by Civilization II game. It was originally developed using Delphi 4 but later fully porter to Lazarus.<br />
<br />
[[File:C-evo start.png|border|270px]]<br />
[[File:C-evo game.png|border|270px]]<br />
[[File:C-evo game2.jpg|border|270px]]<br />
<br />
== Castle Game Engine ==<br />
<br />
[[Castle Game Engine]] ([http://castle-engine.sourceforge.net/ project page]) is a 3D open-source game engine. The engine was developed from the beginning using Free Pascal (we have also Lazarus components) in nice and clean ObjectPascal code. We support many 3D model formats, including [http://castle-engine.sourceforge.net/vrml_x3d.php VRML/X3D], Collada, 3DS and many others. Tools and games using the engine include: <br />
* [http://castle-engine.sourceforge.net/view3dscene.php view3dscene - 3D model viewer, VRML/X3D browser], <br />
* [http://castle-engine.sourceforge.net/castle.php The Castle - FPS game in a dark fantasy world], <br />
* [http://castle-engine.sourceforge.net/darkest_before_dawn.php Darkest Before the Dawn - small scary 3D game for standalone and Android (also on Google Play)]<br />
<br />
== Common Loon Hearts ==<br />
<br />
[https://web.ncf.ca/di874/computers/hearts/hearts.html Common Loon Hearts] is the card game Hearts. It is written in Free Pascal with the Lazarus IDE for Windows and Linux. Source code is available [https://github.com/oldgizahub/hearts here].<br />
<br />
[[Image:hearts_screen.png|320px]]<br />
<br />
== DMines ==<br />
<br />
[http://dmines.sourceforge.net/ DMines] is an edition of the classic game Minesweeper with a dynamic twist, unrevealed mines can change location every set number of seconds.<br />
<br />
[[Image: DMinesExample.jpg|400px]]<br />
<br />
== Dreams of a Geisha ==<br />
<br />
Take a journey through the magical and wonderful world of Geisha. Help Ichisumi in this incredible adventure to reopen the temples of Geisha and restore a world of beauty and passion. Dive into this engaging Match 3 game with beautiful scenery and relaxing music. Overcome obstacles, collect puzzle pieces, and be prepared to solve challenging puzzles in [http://www.dreamsofageisha.com Dreams of a Geisha]!<br />
<br />
Powered by Lazarus FPC, [http://www.zengl.org/ ZenGL], [http://www.phoenixlib.net/ PhoenixLib], [http://www.lua.org/ LUA] and [http://www.codeandweb.com/texturepacker TexturePacker]. Developed by [http://www.greensaucegames.com Green Sauce Games] and Released by [http://www.bigfishgames.com Big Fish Games].<br />
<br />
Demo available for [http://www.bigfishgames.com/download-games/12814/dreams-of-a-geisha/index.html Windows], [http://www.bigfishgames.com/download-games/13045/mac/dreams-of-a-geisha/index.html Mac], [http://itunes.apple.com/us/app/dreams-of-a-geisha/id460180656?mt=8 iPhone], [http://itunes.apple.com/us/app/dreams-of-a-geisha-hd/id459801505?mt=8 iPad].<br />
<br />
[[File:Dreams of a Geisha - Screenshot 1.jpg|border|270px]]<br />
<br />
== Eschecs ==<br />
<br />
[https://github.com/rchastain/eschecs Eschecs] is an application to play chess against different artificial opponents. ''Eschecs'' uses the [[fpGUI]] Toolkit, and the [[uos]] and [[BGRABitmap]] libraries.<br />
<br />
[[Image:eschecs500f.png|300x300px]] <br />
<br />
== fpChess ==<br />
<br />
[[fpChess]] is still under construction. It should support playing via the internet as well as against a computer AI. <br />
<br />
[[Image:Fpchess.png|240px]]<br />
<br />
== Game Maker ==<br />
<br />
[http://www.yoyogames.com/gamemaker Game Maker] allows you to make computer games using easy to learn drag-and-drop actions. You can create professional looking games within very little time. You can make games with backgrounds, animated graphics, music and sound effects, and even 3D games! And when you've become more experienced, there is a built-in programming language, which gives you the full flexibility of creating games with Game Maker. What is best, is the fact that Game Maker can be used free of charge.<br />
<br />
Originally written in Delphi, Lazarus/Free Pascal was used to port it from Win32 to macOS. Available for Windows desktop, macOS, Ubuntu, Android, iOS, tvOS, fireTV, Android TV, Microsoft UWP, HTML5, PlayStation 4, and Xbox One.<br />
<br />
== Hedge Wars ==<br />
<br />
[http://www.hedgewars.org/ Hedge Wars] is a worm-like game with very nice graphics and good AI. The game features typical worms gameplay including net play. The game itself is written in FPC while the config application is C++/Qt.<br />
<br />
[[Image: HedgeWarsPage.png|320px| HedgeWars Scene]]<br />
<br />
== JavaneseChess ==<br />
<br />
[https://bitbucket.org/leledumbo/javanese-chess JavaneseChess] is a Javanese chess game implementation. Available for Desktop platforms and Android (not feature complete yet).<br />
<br />
== Juegos Iniciales ==<br />
<br />
[http://juegosenlazaruscostarricenses.com Juegos Iniciales] are a small collection of 3D tutorial games in<br />
Lazarus, SDL and Free Pascal. In 2016, there were only four games:<br />
[http://origamisiniciales.juegosenlazaruscostarricenses.com Origamis Iniciales], <br />
[http://bloquesiniciales.juegosenlazaruscostarricenses.com Bloques Iniciales], <br />
[http://nudosiniciales.juegosenlazaruscostarricenses.com Nudos Iniciales],<br />
[http://palitos-iniciales.juegosenlazaruscostarricenses.com Palitos Iniciales].<br />
<br />
== LazGobang ==<br />
<br />
[http://files.cnblogs.com/lazarus/LazGobang.rar LazGobang] is a Gobang game, powered by Lazarus and Free Pascal. <br />
<br />
== Lazarus Mazes ==<br />
<br />
The [https://github.com/eny-fpc/lazes Lazarus Mazes] program is a demonstration of how you can use Lazarus to create a maze. The maze generation is based on a [http://en.wikipedia.org/wiki/Maze_generation_algorithm#Depth-first_search depth-first backtracking] algorithm. As a bonus, a simple maze solver is also implemented that shows a route from the start of the maze to the exit.<br />
<br />
[[Image:mazedemo1.png|400px]]<br />
<br />
== LBP Level Logger ==<br />
<br />
[http://code.google.com/p/lbplevellogger/ LBP Level Logger] is a small system tray application designed to log [http://www.littlebigplanet.com/ LittleBigPlanet] level statistics from [http://lbp.me/ lbp.me] over time for graphing/visualisation. It is written in Free Pascal/Lazarus.<br />
<br />
[[File:lbplevellogger-screenshot.png]]<br />
<br />
== Lentil Wars ==<br />
<br />
[http://lwars.sourceforge.net/ Lentil Wars] is an arcade action game for Linux and Windows that is still under development. Players combat each other in multiple nicely designed levels. Lentil Wars can be played both on a single computer as well as over a network.<br />
<br />
[[Image:LentilWars.jpg|320px| Lentil Wars Scene]]<br />
<br />
== Mundo Medieval 3D MMORPG ==<br />
<br />
Featuring a virtual world of more than 1.000.000 m2, plus caves and hell sceneries, 17 NPCs, 21 kinds of monsters, including 7 bosses, 58 different items and 100 quests, this is a really large game made with Free Pascal/Lazarus. The project is 100% free software, both code and media are licensed under GPL. The project sites are [http://www.gamemundo.com/ http://www.gamemundo.com/] and [http://sourceforge.net/projects/gamemundo/ http://sourceforge.net/projects/gamemundo/].<br />
<br />
[[File:Mundo - Screenshot 1.png|border|270px]]<br />
[[File:Mundo - Screenshot 2.png|border|270px]]<br />
[[File:Mundo - Screenshot 3.png|border|270px]]<br />
<br />
== Peg Solitaire tutorial ==<br />
<br />
[[Peg Solitaire tutorial|Peg Solitaire]] serves as a game (Peg Solitaire) tutorial that aims at introducing the user to the basics of Lazarus application development. Source available.<br />
<br />
[[Image:tutpeg_solitaire.png|340px]]<br />
<br />
== Petris ==<br />
<br />
[[Petris]] is yet another Tetris clone. [https://github.com/eny-fpc/petris Source available].<br />
<br />
[[Image:petris.png|320px]]<br />
<br />
== Retro Ski Run ==<br />
<br />
[https://sourceforge.net/projects/retroskirun/ Retro Ski Run] is a simple ski game for Windows 32/64bit and Linux 32/64-bit.<br />
<br />
[[Image:ss_rsrStartScreen.jpg|border|270px]]<br />
<br />
== Robot - The Game ==<br />
<br />
[[Robot - The Game|Robot]] is a game in which you control a character through a world consisting of 5*5 rooms, each with 20*20 fields. Every field contains a special game object; this can be a wall, a bad robot who wants to kill you (because of the robots, the game is named Robot), a door (for each door, you need a special key) and so on. [https://sourceforge.net/projects/lazarus-ccr/files/Demos and examples/Robot 1.7/ Source available].<br />
<br />
[[Image:robot1.5-shot1.png|320px]]<br />
<br />
== UltraStar Deluxe ==<br />
<br />
[http://ultrastardx.sourceforge.net/ UltraStar Deluxe] is a free and open source karaoke game inspired by the Singstar™ game available on the Playstation®. It allows up to six players to sing along with music using microphones in order to score points, depending on the pitch of the voice and the rhythm of the singing. It is currently available for Windows, Linux, macOS and FreeBSD.<br />
<br />
[[Image:UltraStarDeluxeMainPage.png|400px|UltraStar Deluxe Main Page]] <br />
<br />
== ValisoaChess ==<br />
<br />
[https://sourceforge.net/projects/valisoachess/?source=directory ValisoaChess] is a chess game written in Free Pascal and Lazarus. The main goal is to create a simple yet powerful chess engine.<br />
<br />
[[Image:valisoachess.jpg|320px]]<br />
<br />
== Zen GL updated ==<br />
<br />
[https://sourceforge.net/p/zengllinux/code/ci/default/tree/ Zen GL] is a 2D game engine. Now Zen GL uses Steam Game Libraries. You can migrate your Delphi X or Image Sprite old 2D Delphi games with that Zen GL upgraded Game Engine. The Zen GL Linux packages are zgl.deb or zgl.rpm.<br />
<br />
[[Category:Lazarus]]<br />
[[Category:Historical]]<br />
[[Category:Promotion]]<br />
[[Category:Software created with Lazarus]]<br />
[[Category:Software written in Free Pascal]]<br />
[[Category:Games]]</div>Chronoshttps://wiki.freepascal.org/index.php?title=File:BigMetro_main.png&diff=139933File:BigMetro main.png2020-09-05T18:22:19Z<p>Chronos: </p>
<hr />
<div></div>Chronoshttps://wiki.freepascal.org/index.php?title=File:BitMetro_small.png&diff=139932File:BitMetro small.png2020-09-05T18:21:38Z<p>Chronos: </p>
<hr />
<div></div>Chronos