This page describes the steps you need to follow when packaging Gamma for a distro. These are distribution-independent instructions and you are also suggested to follow any guidelines laid down by the distro maintainers.
Gamma is written in python, and all that is required to run it is to clone the repository and execute ./bin/gamma
. A setup.sh
file is included to let users easily copy icons/desktop files onto their system locations so that they can launch Gamma from their preferred application launcher or desktop environment.
Many users prefer installing applications from their distro repositories as it makes updating/removing application easier.
Refer to setup.sh
to see the files that need to be copied on to the user's system. Apart from the steps in setup.sh
, the following steps need to be followed while packaging. Make sure you follow any other instruction/guideline set by your distro maintainers.
(All the example commands here are executed in the Gamma source code directory. You will probably need to modify the paths depending on your working directory.)
- Set the
package_date
variable ingamma.py
andhome_dir_init.sh
to the Unix timestamp while packaging. One way of doing this via the shell is shown below:
package_date=$(date +%s)
sed -i "0,/package_date=0000000000/s//package_date=${package_date}/" home_dir_init.sh
sed -i "0,/package_date = 0000000000/s//package_date = ${package_date}/" gamma.py
(Note that in the second sed
command, there are spaces around the equal sign)
- Create the
.desktop
file. Assuming that you will install Gamma to/opt/gamma-text-editor
, the following commands will do the work.
cp "./bin/io.gitlab.hamadmarri.gamma.desktop.bak" "./bin/io.gitlab.hamadmarri.gamma.desktop"
sed -i -e "s,\[gamma path placeholder\],/opt/gamma-text-editor/bin/gamma," "./bin/io.gitlab.hamadmarri.gamma.desktop"
- Set
packaged
ingamma.py
toTrue
.
sed -i "0,/packaged = False/s//packaged = True/" "./gamma.py"
- Create a new folder named
home_dir_data
in project root and moveconfig.py
,signal_handler.py
,plugins
,style
,ui
tohome_dir_data
.
mkdir home_dir_data
mv {config.py,plugins,style,ui,signal_handler.py} ./home_dir_data/
Now go on to create any other required files specified by your distro.
The PKGBUILD at Arch User Repository can be referred to understand the steps. PKGBUILD for gamma-text-editor