Difference between revisions of "GNOME package guidelines"

From ArchWiki
Jump to: navigation, search
(Undo revision 209427 by Jstjohn (talk) if you don't move also the linked page, do not change the link :))
(simplification and beautification of wikilinks (interactive))
(Tag: wiki-scripts)
 
(14 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
[[Category:Package development]]
 
[[Category:Package development]]
[[it:Gnome Package Guidelines]]
+
[[it:GNOME package guidelines]]
{{Package Guidelines}}
+
[[ja:GNOME パッケージガイドライン]]
 +
{{Package guidelines}}
  
 
The [[GNOME]] packages on Arch Linux follow a certain schema.
 
The [[GNOME]] packages on Arch Linux follow a certain schema.
  
== GNOME profile initialization ==
+
== GConf schemas ==
There is no GNOME profile initialization anymore. The old line below should be stripped from any [[PKGBUILD]]:
+
Some GNOME packages install [[wikipedia:GConf#Schemas|GConf schemas]], even though many others already migrated to GSettings. Those packages should depend on {{Pkg|gconf}}.
{{Bc|[ -z "$GNOMEDIR" ] && . /etc/profile.d/gnome.sh}}
 
  
== GConf schemas ==
+
Gconf schemas get installed in the system GConf database, which has to be avoided.
Many GNOME packages install GConf schemas. These schemas get installed in the system GConf database, which has to be avoided.
+
Some packages provide a {{Ic|--disable-schemas-install}} switch for '''./configure''', which hardly ever works. However, gconftool-2 has a variable called {{Ic|GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL}} which you can set to tell gconftool-2 to not update any databases.
Some packages provide a {{Ic|--disable-schemas-install}} switch for '''./configure''', which hardly ever works. Therefore, gconftool-2 has a variable called {{Ic|GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL}}, whenever this is set, gconftool-2 will not update any databases.
 
  
When creating packages that install schema files, use
+
When creating packages that install GConf schema files, use
  
 
{{Bc|1=make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${pkgdir} install}}
 
{{Bc|1=make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${pkgdir} install}}
Line 19: Line 18:
 
for the package installation step in the PKGBUILD.
 
for the package installation step in the PKGBUILD.
  
GConf schemas need to be installed and removed in the {{Ic|.install}} file using {{Ic|pre_remove}}, {{Ic|pre_upgrade}} and {{Ic|post_upgrade}} and {{Ic|post_install}}. Use '''gconf-merge-schemas''' to merge several schemas into one package specific file, install or uninstall them with {{Ic|usr/sbin/gconfpkg --''(un)''install $pkgname}}
+
Do not call {{Ic|gconfpkg}} in the .install file, as GConf schemas are automatically installed/removed (while installing/removing the GNOME package) via [[pacman hooks]] since {{Pkg|gconf}}=3.2.6-4
The usage of '''gconfpkg''' requres a dependency on {{Pkg|gconf}}>=2.18.0.1-4 (or {{Pkg|gconfmm}}>=2.20.0).
 
  
 
== GSettings schemas ==
 
== GSettings schemas ==
The GConf schemas will be replaced by GSettings schemas in the near future, but some applications (e.g. Empathy) already using it. GSettings uses dconf as backend, so all packages that contain GSettings schemas require dconf as dependency. When a new GSettings schema installed on the system, the GSettings database should be recompiled, but not when packaging.
+
The GConf schemas were migrated to GSettings schemas, so many GNOME applications can be found using this new schema file. GSettings uses dconf as backend, so all packages that contain GSettings schemas require {{Pkg|dconf}} as dependency. When a new GSettings schema installed on the system, the GSettings database has to be recompiled, but not when packaging.
To avoid recompiling GSettings database on packaging, use the {{Ic|--disable-schemas-compile}} switch for '''./configure'''. To recompile it on install, add the following line to the .install file using post_install, post_upgrade and post_remove:
+
 
glib-compile-schemas usr/share/glib-2.0/schemas
+
To avoid recompiling GSettings database on packaging, use the {{Ic|--disable-schemas-compile}} switch for '''./configure'''.
 +
 
 +
Do not call {{Ic|glib-compile-schemas}} in the .install file, as GSettings schema databases are automatically recompiled via [[pacman hooks]] since {{Pkg|glib2}}=2.48.0-2.
  
 
== Scrollkeeper documentation ==
 
== Scrollkeeper documentation ==
Starting from GNOME 2.20 there is no need to handle scrollkeeper anymore, as rarian reads OMF files directly. Scrollkeeper-update is a dummy these days. The only required thing now is to makedepend on {{Pkg|gnome-doc-utils}}>=0.11.2.
+
Starting from GNOME 2.20 there is no need to handle scrollkeeper anymore, as {{Pkg|rarian}} reads its OMF files directly. Scrollkeeper-update is a dummy these days. The only required thing now is to makedepend on {{Pkg|gnome-doc-utils}}>=0.11.2.
 +
 
 +
It can be disabled using {{Ic|--disable-scrollkeeper}} switch from '''./configure'''.
 +
 
 +
== GTK icon cache ==
 +
 
 +
Quite some packages install icons in the hicolor icon theme. These packages should depend on {{Pkg|gtk-update-icon-cache}}.
 +
 
 +
Do not call {{Ic|gtk-update-icon-cache}} in the .install file, as the icon cache is updated via [[pacman hooks]] since {{Pkg|gtk-update-icon-cache}}=3.20.3-2.
  
 
== .desktop files ==
 
== .desktop files ==
Many packages install Freedesktop.org compatible {{Ic|.desktop}} files and register MimeType entries in them. Running {{Ic|update-desktop-database -q}} in {{Ic|post_install}} and {{Ic|post_remove}} is recommended (package should depend on {{Pkg|desktop-file-utils}} in this case).
 
  
== GTK Icon cache ==
+
Many packages install Freedesktop.org compatible {{Ic|.desktop}} files and register MimeType entries in them. They should depend on {{Pkg|desktop-file-utils}}
Quite some packages install icons in the hicolor icon theme. These packages should depend on {{Pkg|hicolor-icon-theme}} and should have {{Ic|gtk-update-icon-cache -q -t -f usr/share/icons/hicolor}} (WITHOUT leading slash) in the {{Ic|post_install}}, {{Ic|post_upgrade}} and {{Ic|post_remove}} function.
+
 
 +
Do not call {{Ic|update-desktop-database}} in the .install file, as the database is automatically updated via [[pacman hooks]] since {{Pkg|desktop-file-utils}}=0.22-2.
  
 
== .install files ==
 
== .install files ==
For many GNOME packages, all .install files look almost exactly the same. The {{Pkg|gedit}} package contains a very generic install file:
 
https://projects.archlinux.org/svntogit/packages.git/tree/gedit/repos/extra-x86_64/gedit.install
 
  
Basically, the only thing that has to be changed is the {{Ic|pkgname}} variable on top of the {{Ic|.install}} file. As long as pacman does not supply us with the {{Ic|pkgname}} variable, we need to supply it in the {{Ic|.install}} file.
+
Previously, most of the GNOME packages had a .install file calling commands like {{Ic|glib-compile-schemas}}, {{Ic|gtk-update-icon-cache}}, and {{Ic|update-desktop-database}} in order to install/update local cache or databases.  This is deprecated since pacman 5.0 implemented [[Pacman#Hooks|hooks]] which call those commands automatically when installing the package.
When packages do not have gconf schemas, hicolor icon files, or {{Ic|.desktop}} files, remove the parts that handle those subjects.
 
  
== Example ==
+
To avoid being called twice, the above mentioned commands should be removed from .install file.
For an example of above rules, take a look at the gedit PKGBUILD and the {{Ic|.install}} file supplied above:
 
https://projects.archlinux.org/svntogit/packages.git/tree/gedit/repos/extra-x86_64/
 

Latest revision as of 13:49, 30 March 2017

Package creation guidelines

CLRCrossEclipseFree PascalGNOMEGoHaskellJavaKDEKernelLispMinGWNode.jsNonfreeOCamlPerlPHPPythonRubyVCSWebWine

The GNOME packages on Arch Linux follow a certain schema.

GConf schemas

Some GNOME packages install GConf schemas, even though many others already migrated to GSettings. Those packages should depend on gconf.

Gconf schemas get installed in the system GConf database, which has to be avoided. Some packages provide a --disable-schemas-install switch for ./configure, which hardly ever works. However, gconftool-2 has a variable called GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL which you can set to tell gconftool-2 to not update any databases.

When creating packages that install GConf schema files, use

make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${pkgdir} install

for the package installation step in the PKGBUILD.

Do not call gconfpkg in the .install file, as GConf schemas are automatically installed/removed (while installing/removing the GNOME package) via pacman hooks since gconf=3.2.6-4

GSettings schemas

The GConf schemas were migrated to GSettings schemas, so many GNOME applications can be found using this new schema file. GSettings uses dconf as backend, so all packages that contain GSettings schemas require dconf as dependency. When a new GSettings schema installed on the system, the GSettings database has to be recompiled, but not when packaging.

To avoid recompiling GSettings database on packaging, use the --disable-schemas-compile switch for ./configure.

Do not call glib-compile-schemas in the .install file, as GSettings schema databases are automatically recompiled via pacman hooks since glib2=2.48.0-2.

Scrollkeeper documentation

Starting from GNOME 2.20 there is no need to handle scrollkeeper anymore, as rarian reads its OMF files directly. Scrollkeeper-update is a dummy these days. The only required thing now is to makedepend on gnome-doc-utils>=0.11.2.

It can be disabled using --disable-scrollkeeper switch from ./configure.

GTK icon cache

Quite some packages install icons in the hicolor icon theme. These packages should depend on gtk-update-icon-cache.

Do not call gtk-update-icon-cache in the .install file, as the icon cache is updated via pacman hooks since gtk-update-icon-cache=3.20.3-2.

.desktop files

Many packages install Freedesktop.org compatible .desktop files and register MimeType entries in them. They should depend on desktop-file-utils

Do not call update-desktop-database in the .install file, as the database is automatically updated via pacman hooks since desktop-file-utils=0.22-2.

.install files

Previously, most of the GNOME packages had a .install file calling commands like glib-compile-schemas, gtk-update-icon-cache, and update-desktop-database in order to install/update local cache or databases. This is deprecated since pacman 5.0 implemented hooks which call those commands automatically when installing the package.

To avoid being called twice, the above mentioned commands should be removed from .install file.