Difference between revisions of "Developing"

From Gestinux Wiki
Jump to navigation Jump to search
 
(62 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
Gestinux is an open source software and anyone can help to its development.
 
Gestinux is an open source software and anyone can help to its development.
  
Some guidelines for project maintenance follow, which can be discussed in the [http://gestinux.net/forum/viewforum.php?f=10 development forum].
+
Some guidelines for project maintenance follow, which can be discussed in the [https://mrit.com/gestinux/forum/viewforum.php?f=10 development forum].
  
 
== Tests ==
 
== Tests ==
  
 
Gestinux must work in various combinations of environments, databases, and languages. It would be useful to have referent testers in each of these different possible combinations, particularly during release-candidates publishing.
 
Gestinux must work in various combinations of environments, databases, and languages. It would be useful to have referent testers in each of these different possible combinations, particularly during release-candidates publishing.
 +
 +
 +
To test safely, especially non stable versions, it is better to [[copyfortest|make a copy]] of a production database.
  
 
== Translation ==
 
== Translation ==
Line 15: Line 18:
 
== Documentation ==
 
== Documentation ==
  
To help improving documentation, that is to create or edit pages in this wiki, you must before subscribe in the [http://gestinux.net/forum/viewforum.php?f=10 forum].
+
The documentation, this Wiki, is made with MediaWiki and you can improve it. Read [[Help:Contents|this page]] for more information.
  
Then, in this [http://gestinux.net/forum/viewforum.php?f=10 forum], ask for the right to edit this wiki, introducing yourself briefly.  
+
For any question or remark, it is necessary to use only the [http://forum.gestinux.net/viewforum.php?f=10 forum] and not the wiki.
  
You will have to learn how to use WikiMedia (used by Wikipedia), and follow some [[Help:Contents|editing rules]]. The account and password are the same as in forum.
+
== Programmation ==
 
 
For any question or remark, it is necessary to use only the [http://gestinux.net/forum/viewforum.php?f=10 forum] and not the wiki.
 
  
== Programmation ==
+
=== Lazarus versions and sources ===
  
Gestinux 1.2 was developed using Lazarus 1.2.6 and FreePascal 2.6.4.
+
The last stable version of Gestinux 1.5 (stable-3) is built using Lazarus 2.0.12 and FreePascal 3.2.0
  
There is no 1.3 version (to have the same version for Gestinux and Gestinux_util).
+
To develop the version 1.6 we use the last stable versions : Lazarus 3.4 and FPC '''3.2.2'''
  
For the 1.4 or trunk version currently in beta test, we use '''Lazarus 1.6.0''' and FreePascal 3.0.0.  
+
They should always be downloaded from SourceForge. The fpc packages available on Ubuntu are outdated.
  
=== Obtaining the sources ===
+
=== Obtaining Gestinux sources ===
  
 
Gestinux source code is managed using SVN.
 
Gestinux source code is managed using SVN.
Line 39: Line 40:
 
You must also have a SourceForge account and will need to enter your SourceForge password, or set up a SSL secured connection to SourceForge.
 
You must also have a SourceForge account and will need to enter your SourceForge password, or set up a SSL secured connection to SourceForge.
  
To configure your client program, the svn command line is :  
+
The svn command line is :  
  
 
   svn checkout --username=your_sourceforge_account svn+ssh://your_sourceforge_account@svn.code.sf.net/p/gestinux/code <your_local_source_directory>
 
   svn checkout --username=your_sourceforge_account svn+ssh://your_sourceforge_account@svn.code.sf.net/p/gestinux/code <your_local_source_directory>
Line 45: Line 46:
 
Read [https://sourceforge.net/p/forge/documentation/SSH%20Keys/ this documentation] to avoid entering your password every time.
 
Read [https://sourceforge.net/p/forge/documentation/SSH%20Keys/ this documentation] to avoid entering your password every time.
  
* You should improve or create new sources with new functionalities in the '''trunk''' branch only, after having obtained a developer profile in the sourceforge project (ask in the developement forum).
+
* You should improve or create new sources and/or new functionalities in a '''trunk''' branch only, after having obtained a developer profile in the sourceforge project (ask in the development forum).
 
 
* In the trunk or 1.4 branch, only fix important and well identified bugs, using only Lazarus 1.6.0
 
  
* In the 1.2 stable branch, you should only add languages.
+
* In the last stable branch, only fix important and well identified bugs.
  
 
* Do not change anything in older branches which are available for history only.
 
* Do not change anything in older branches which are available for history only.
  
  
You should lock the files before changing anything. For this and to commit, ask in the [http://gestinux.net/forum/viewforum.php?f=7 forum] to be granted a "developer" privilege for Gestinux SourceForge project.
+
You should lock the files before changing anything. For this and to commit, ask in the [http://forum.gestinux.net/viewforum.php?f=7 forum] to be granted a "developer" privilege for Gestinux SourceForge project.
  
 
=== Packages which are required ===
 
=== Packages which are required ===
  
 
Releases 1.x or trunk should compile with the following packages.
 
Releases 1.x or trunk should compile with the following packages.
You can use more recent versions of the packages, but at your own risk !
 
  
Let us know if using a newer version of any of these packages works sucessfully.
+
Due to compatibility breaks, you will not install the same packages for developing Gestinux 1.6 or fixing Gestinux 1.5
 +
 
 +
==== To build Gestinux 1.5 ====
 +
 
 +
Install only the versions below, otherwise it could raise new bugs, and this is not fine for a ''stable'' version.
  
Rebuilding EDI at each step should not be required. But sometimes it helps !
+
Remember you must have Lazarus 2.0.12 and FreePascal 3.2.0 installed 
  
*  Zeos DBO 7.1.4-stable
+
*  Zeos DBO 7.2.6
** [http://sourceforge.net/projects/zeoslib/files/Zeos%20Database%20Objects/zeosdbo-7.1.4-stable/ZEOSDBO-7.1.4-stable.zip/download Download] the package and unzip to any directory.
+
** [https://sourceforge.net/projects/zeoslib/files/Zeos%20Database%20Objects/zeosdbo-7.2.6-stable/zeosdbo-7.2.6-stable.zip/download Download sources] and unzip in any folder
** Replace src/plain/ZPlainMySqlDriver.pas by the file /trunk/util/ZEOSDBO-7.1.4-stable-src-plain-ZPlainMySqlDriver.pas in gestinux svn repository
 
 
** Open packages/lazarus/zcomponent.lpk
 
** Open packages/lazarus/zcomponent.lpk
 
** Install  (click Use, Install)
 
** Install  (click Use, Install)
** It is not required to rebuild the EDI at this time
+
** It is not required to rebuild the EDI before all packages are installed
* Power PDF 0.9.10
+
* : Power PDF 0.9.15
** [http://sourceforge.net/projects/lazarus-ccr/files/PowerPDF/powerpdf_0.9.10_20121115.tar.gz/download Download] the package and unzip to any directory.
+
** [https://sourceforge.net/projects/lazarus-ccr/files/PowerPDF/powerpdf_0.9.15_20170215.tar.gz/download Download] the package and unzip to any directory.
 
** Open pack_powerpdf.lpk
 
** Open pack_powerpdf.lpk
 
** Install.
 
** Install.
** It is not required to rebuild the EDI at this time
+
* LazReport 0.9.9 and LazReportPDFExport 0.9
* LazReport 0.9.9 and LazReportPDFExport 0.8
 
 
** Click Menu ''Packages'' > ''Install/Uninstall packages''
 
** Click Menu ''Packages'' > ''Install/Uninstall packages''
** Select these packages (lazreport and lazreportpdfexport) in the right pane, and move it to the left one.
+
** Select the packages (LazReport and LazReportPDFExport) in the right pane, and move them to the left one.
** Click the button ''Save and rebuild EDI''.
+
** Click ''Save and Exit Dialog''
* [[Gestinux_util]] : a package containing the components Gestinux uses
+
* [[Gestinux_util|Gestinux_util 1.5]] : package containing the components Gestinux uses, located in the util subdirectory of 1.5 branch.
** You need either :
+
** Open the package gestinux_util.lpk
*** Gestinux_util 1.2 for Gestinux 1.2 stable version (subdirectory of branch 1.2)
+
** Install
*** '''Or''' The last version of the package (currently a subdirectory of the trunk branch
+
** Click the button ''Save and rebuild EDI''
** Open gestinux_util.dpk
+
 
** Install.
+
==== To build Gestinux 1.6 ====
** Rebuild EDI
+
 
 +
You should use the most recent stable versions or at least Lazarus 3.4 and FPC 3.2.2  
 +
 
 +
You can try more recent versions of fpc, lazarus and the packages listed below, but at your own risk !
 +
 
 +
Let us know if using a newer version works successfully.
 +
 
 +
*  Zeos DBO 8.0.0
 +
** It is possible to use the Online Package Manager, to install ZeosDBO
 +
** Or you can :
 +
*** [https://sourceforge.net/projects/zeoslib/files/Zeos%20Database%20Objects/zeosdbo-8.0.0-stable/zeosdbo-8.0.0-stable.zip/download/download Download sources] and unzip in any folder
 +
*** Open the file lazarus/zcomponentdesign.lpk
 +
*** Install  (click Use, Install)
 +
*** It is not required to rebuild the EDI
 +
* PowerPDF
 +
** It is available in the Online Package Manager, but you must install the 0.9.17 :
 +
** [https://sourceforge.net/projects/lazarus-ccr/files/PowerPDF/powerpdf_0.9.17_20240624_new.tar.gz/download  Download sources] and unzip in any folder
 +
** Install  (click Use, Install)
 +
** It is not required to rebuild the EDI
 +
* LazReport 1.0 and lr_pdfexport 0.9
 +
** They are not available in the Online Package Manager, so you must :
 +
** Select the packages in the right pane, and move them to the left one.
 +
** Click ''Save and Exit Dialog''
 +
* [[Gestinux_util|Gestinux_util 1.6]] : package containing the components Gestinux uses, located in the util subdirectory of the trunk branch.
 +
** They are not available in the Online Package Manager, so you must :
 +
** Open the package gestinux_util.lpk
 +
** Install
 +
** Click the button ''Save and rebuild EDI''
  
 
=== Gestinux development Rules ===
 
=== Gestinux development Rules ===
Line 101: Line 128:
 
From gurus, we do need better components.
 
From gurus, we do need better components.
  
Before starting anything, you are advised to discuss your proposal a bit in the [http://gestinux.net/forum/viewforum.php?f=10 development  forum].
+
Before starting anything, you are advised to discuss your proposal a bit in the [http://forum.gestinux.net/viewforum.php?f=10 development  forum].
 +
 
 +
== Packaging and OS specific informations ==
 +
 
 +
=== Linux ===
 +
 
 +
You can build a Debian package using scripts located in trunk/install/debian
 +
 
 +
Source are exported from the repository and recompiled before building the package, to ensure everything is in the repository. The SVN revision will be included automatically in the binary to be visible in the "About" form.
 +
 
 +
If you want to build and install a package run (e.g with trunk and Lazarus 64 bits). Replace ''<svn local repository>'' and ''<your sourceforge account>'' by your specific values.
 +
 
 +
  <svn local repository>/gestinux/<version>/install/debian/build_pkg.sh SYSTEM="Debian" TARGET="x86_64" SVNUSER="<your sourceforge user>" BRANCH="trunk"
 +
 
 +
This should build a lintian valid Debian package, reading some translations for man and desktop in available translation files.
 +
 
 +
You are welcome if you can make the same for other Linux distributions !
 +
 
 +
=== Windows ===
 +
 
 +
You can build an installer for Windows 32 bits with InnoSetup 5 and the command file trunk/install/windows/build_i386_win32.bat.  Windows PowerShell is used to extract and include the SVN revision in the binary.
 +
 
 +
It can be installed and works on Windows 64 bits. It is also possible to use build_x86_win64.bat, with Lazarus 64 bits, to make a 64 bits installer. Since this is not very useful and not used currently, check if the script is up to date against the 32 bits one.
 +
 
 +
We include MySql 5.0 client drivers, installed only on the target system if no more recent MySql driver is present .
 +
 
 +
=== Mac OS/X ===
 +
 
 +
Currently gestinux.app can be built for Intel 32 bits with the script trunk/install/osx/build_osx_i386_32.sh.The SVN revision must be included manually. There is a gestinux.pmdoc to make manually a gestinux.pkg which can be installed and works on 32 or 64 bits Macs.
 +
 
 +
Since I have only an old Macintosh with OS/X 10.6, I can't use up-to-date tools to build installers and add certificates.
 +
 
 +
You are welcome if you can help in this area.
 +
 
 +
== Database ==
  
=== Database ===
+
=== Supported DBMS ===
  
==== Supported DBMS ====
+
MySql 5.7, MariaDb 10.3, and PostgreSQL 9 are supported.
  
MySql 5.6, MariaDb 5, and PostgreSQL 9 are supported.
+
* MySql because administration is quite simple.
MySql because administration is quite simple.
+
* PostgreSql because it is completely free software.
PostgreSql because it is completely free software.
+
* MariaDb for both reasons. It is the recommended DBMS to use.
MariaDb for both reasons.
 
  
 
In the future, we may try other DBMS, but that would require a bigger development team.
 
In the future, we may try other DBMS, but that would require a bigger development team.
Line 117: Line 177:
 
When there is no alternative, compatibility procedures should be made. They are all centralized in one unit (util/gconnection.pas).
 
When there is no alternative, compatibility procedures should be made. They are all centralized in one unit (util/gconnection.pas).
  
==== Table and fields definitions and properties ====
+
=== Table and fields definitions and properties ===
  
 
In [[Gestinux_util]] there is a [[TGTable]] component used to store all the metadata of tables used in Gestinux. With this component, there is no need to store table definitions elsewhere, and no SQL script is required to initialize or upgrade the database.  
 
In [[Gestinux_util]] there is a [[TGTable]] component used to store all the metadata of tables used in Gestinux. With this component, there is no need to store table definitions elsewhere, and no SQL script is required to initialize or upgrade the database.  
  
 
The database and table structures are created by the main executable, as specified in unitdatamodule.pas, in [[TGTable]] properties. See the component [[TGTable]] for more details.
 
The database and table structures are created by the main executable, as specified in unitdatamodule.pas, in [[TGTable]] properties. See the component [[TGTable]] for more details.

Latest revision as of 14:21, 18 November 2024

 Français

Developing Gestinux

Gestinux is an open source software and anyone can help to its development.

Some guidelines for project maintenance follow, which can be discussed in the development forum.

Tests

Gestinux must work in various combinations of environments, databases, and languages. It would be useful to have referent testers in each of these different possible combinations, particularly during release-candidates publishing.


To test safely, especially non stable versions, it is better to make a copy of a production database.

Translation

You can easily translate gestinux into your mother language, and existing translations can definitely be improved.

Documentation

The documentation, this Wiki, is made with MediaWiki and you can improve it. Read this page for more information.

For any question or remark, it is necessary to use only the forum and not the wiki.

Programmation

Lazarus versions and sources

The last stable version of Gestinux 1.5 (stable-3) is built using Lazarus 2.0.12 and FreePascal 3.2.0

To develop the version 1.6 we use the last stable versions : Lazarus 3.4 and FPC 3.2.2

They should always be downloaded from SourceForge. The fpc packages available on Ubuntu are outdated.

Obtaining Gestinux sources

Gestinux source code is managed using SVN.

It is easier if you install some GUI SVN Client program : RapidSvn for Linux and TortoiseSVN for Windows are working fine.

You must also have a SourceForge account and will need to enter your SourceForge password, or set up a SSL secured connection to SourceForge.

The svn command line is :

 svn checkout --username=your_sourceforge_account svn+ssh://your_sourceforge_account@svn.code.sf.net/p/gestinux/code <your_local_source_directory>

Read this documentation to avoid entering your password every time.

  • You should improve or create new sources and/or new functionalities in a trunk branch only, after having obtained a developer profile in the sourceforge project (ask in the development forum).
  • In the last stable branch, only fix important and well identified bugs.
  • Do not change anything in older branches which are available for history only.


You should lock the files before changing anything. For this and to commit, ask in the forum to be granted a "developer" privilege for Gestinux SourceForge project.

Packages which are required

Releases 1.x or trunk should compile with the following packages.

Due to compatibility breaks, you will not install the same packages for developing Gestinux 1.6 or fixing Gestinux 1.5

To build Gestinux 1.5

Install only the versions below, otherwise it could raise new bugs, and this is not fine for a stable version.

Remember you must have Lazarus 2.0.12 and FreePascal 3.2.0 installed

  • Zeos DBO 7.2.6
    • Download sources and unzip in any folder
    • Open packages/lazarus/zcomponent.lpk
    • Install (click Use, Install)
    • It is not required to rebuild the EDI before all packages are installed
  • : Power PDF 0.9.15
    • Download the package and unzip to any directory.
    • Open pack_powerpdf.lpk
    • Install.
  • LazReport 0.9.9 and LazReportPDFExport 0.9
    • Click Menu Packages > Install/Uninstall packages
    • Select the packages (LazReport and LazReportPDFExport) in the right pane, and move them to the left one.
    • Click Save and Exit Dialog
  • Gestinux_util 1.5 : package containing the components Gestinux uses, located in the util subdirectory of 1.5 branch.
    • Open the package gestinux_util.lpk
    • Install
    • Click the button Save and rebuild EDI

To build Gestinux 1.6

You should use the most recent stable versions or at least Lazarus 3.4 and FPC 3.2.2

You can try more recent versions of fpc, lazarus and the packages listed below, but at your own risk !

Let us know if using a newer version works successfully.

  • Zeos DBO 8.0.0
    • It is possible to use the Online Package Manager, to install ZeosDBO
    • Or you can :
      • Download sources and unzip in any folder
      • Open the file lazarus/zcomponentdesign.lpk
      • Install (click Use, Install)
      • It is not required to rebuild the EDI
  • PowerPDF
    • It is available in the Online Package Manager, but you must install the 0.9.17 :
    • Download sources and unzip in any folder
    • Install (click Use, Install)
    • It is not required to rebuild the EDI
  • LazReport 1.0 and lr_pdfexport 0.9
    • They are not available in the Online Package Manager, so you must :
    • Select the packages in the right pane, and move them to the left one.
    • Click Save and Exit Dialog
  • Gestinux_util 1.6 : package containing the components Gestinux uses, located in the util subdirectory of the trunk branch.
    • They are not available in the Online Package Manager, so you must :
    • Open the package gestinux_util.lpk
    • Install
    • Click the button Save and rebuild EDI

Gestinux development Rules

  • Use the right Lazarus version (see above)
  • Only use English for identifiers and comments.
  • Use the Code Formatter (CTRL+D) to indent modified sources, with default options.
  • Read the gestinux_util documentation, and do not use a Txxxx component when there is a TGxxxx component in this package

What to do

Everyone can help ! If you are a beginner, there are some simple things you can do, and this would save time. From gurus, we do need better components.

Before starting anything, you are advised to discuss your proposal a bit in the development forum.

Packaging and OS specific informations

Linux

You can build a Debian package using scripts located in trunk/install/debian

Source are exported from the repository and recompiled before building the package, to ensure everything is in the repository. The SVN revision will be included automatically in the binary to be visible in the "About" form.

If you want to build and install a package run (e.g with trunk and Lazarus 64 bits). Replace <svn local repository> and <your sourceforge account> by your specific values.

 <svn local repository>/gestinux/<version>/install/debian/build_pkg.sh SYSTEM="Debian" TARGET="x86_64" SVNUSER="<your sourceforge user>" BRANCH="trunk"

This should build a lintian valid Debian package, reading some translations for man and desktop in available translation files.

You are welcome if you can make the same for other Linux distributions !

Windows

You can build an installer for Windows 32 bits with InnoSetup 5 and the command file trunk/install/windows/build_i386_win32.bat. Windows PowerShell is used to extract and include the SVN revision in the binary.

It can be installed and works on Windows 64 bits. It is also possible to use build_x86_win64.bat, with Lazarus 64 bits, to make a 64 bits installer. Since this is not very useful and not used currently, check if the script is up to date against the 32 bits one.

We include MySql 5.0 client drivers, installed only on the target system if no more recent MySql driver is present .

Mac OS/X

Currently gestinux.app can be built for Intel 32 bits with the script trunk/install/osx/build_osx_i386_32.sh.The SVN revision must be included manually. There is a gestinux.pmdoc to make manually a gestinux.pkg which can be installed and works on 32 or 64 bits Macs.

Since I have only an old Macintosh with OS/X 10.6, I can't use up-to-date tools to build installers and add certificates.

You are welcome if you can help in this area.

Database

Supported DBMS

MySql 5.7, MariaDb 10.3, and PostgreSQL 9 are supported.

  • MySql because administration is quite simple.
  • PostgreSql because it is completely free software.
  • MariaDb for both reasons. It is the recommended DBMS to use.

In the future, we may try other DBMS, but that would require a bigger development team.

In the main sources, avoid SQL statements specific to some DBMS. When there is no alternative, compatibility procedures should be made. They are all centralized in one unit (util/gconnection.pas).

Table and fields definitions and properties

In Gestinux_util there is a TGTable component used to store all the metadata of tables used in Gestinux. With this component, there is no need to store table definitions elsewhere, and no SQL script is required to initialize or upgrade the database.

The database and table structures are created by the main executable, as specified in unitdatamodule.pas, in TGTable properties. See the component TGTable for more details.