Difference between revisions of "KDE package guidelines"

From ArchWiki
Jump to navigation Jump to search
(Force Qt4)
m (Added finding KDE install path for KDE5)
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Package development]]
+
[[Category:Arch package guidelines]]
{{Package Guidelines}}
+
[[ja:KDE パッケージガイドライン]]
 +
[[pt:KDE package guidelines]]
 +
{{Package guidelines}}
  
 
The [[KDE]] packages on Arch Linux follow a certain schema.
 
The [[KDE]] packages on Arch Linux follow a certain schema.
  
 
== Build directory ==
 
== Build directory ==
 +
 
A good way of building [[Wikipedia:CMake|CMake]] packages is to make a build directory outside the root of the project and run cmake from that directory. The [[PKGBUILD]] should look this way:
 
A good way of building [[Wikipedia:CMake|CMake]] packages is to make a build directory outside the root of the project and run cmake from that directory. The [[PKGBUILD]] should look this way:
 +
 
{{bc|
 
{{bc|
 
prepare() {
 
prepare() {
Line 18: Line 22:
  
 
== Install prefix ==
 
== Install prefix ==
Every packages must set the {{Ic|CMAKE_INSTALL_PREFIX}} variable, but also we have to respect custom built versions of KDE, so please use:
+
 
 +
Every packages must set the {{ic|CMAKE_INSTALL_PREFIX}} variable, but also we have to respect custom built versions of KDE, so please use:
 +
 
 
  -DCMAKE_INSTALL_PREFIX=$(kde4-config --prefix)
 
  -DCMAKE_INSTALL_PREFIX=$(kde4-config --prefix)
 +
 +
or for KDE 5:
 +
 +
-DCMAKE_INSTALL_PREFIX=$(kf5-config --prefix)
 +
 
When a package is moved to [extra] or [community] that line must be changed to:
 
When a package is moved to [extra] or [community] that line must be changed to:
 +
 
  -DCMAKE_INSTALL_PREFIX=/usr
 
  -DCMAKE_INSTALL_PREFIX=/usr
  
 
== Build type ==
 
== Build type ==
 +
 
Please specify the build type; this makes it really simple to rebuild a package with debug symbols by just using a sed rule.
 
Please specify the build type; this makes it really simple to rebuild a package with debug symbols by just using a sed rule.
 +
 
  -DCMAKE_BUILD_TYPE=Release
 
  -DCMAKE_BUILD_TYPE=Release
  
 
== Force Qt4 ==
 
== Force Qt4 ==
  
== KDE4 ==
+
=== KDE4 ===
  
 
On systems where both {{Pkg|qt4}} and  {{Pkg|qt5-base}} are installed, `qmake` refers to the 5.x version, so force cmake to use Qt4 this way:
 
On systems where both {{Pkg|qt4}} and  {{Pkg|qt5-base}} are installed, `qmake` refers to the 5.x version, so force cmake to use Qt4 this way:
 +
 
   export QT_SELECT=4
 
   export QT_SELECT=4
 +
 
or using this option in cmake:
 
or using this option in cmake:
 +
 
  -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4
 
  -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4
  
== KF5 ==
+
=== KF5 ===
  
 
The same rules as for KDE4, but you need force cmake to use Qt5 instead of Qt4:
 
The same rules as for KDE4, but you need force cmake to use Qt5 instead of Qt4:
Line 42: Line 59:
 
   export QT_SELECT=5
 
   export QT_SELECT=5
  
== Package naming ==
+
== KDE4 package naming ==
  
 
=== KDE Config Module ===
 
=== KDE Config Module ===
KDE Config Module packages should be named {{Ic|kcm-''module''}}.
+
 
 +
KDE Config Module packages should be named {{ic|kcm-''module''}}.
 +
 
 +
=== Plasma widgets ===
 +
 
 +
Plasma widgets (formerly Plasmoids) packages should be named {{ic|kdeplasma-applets-''widgetname''}} so that they are recognizable as [[KDE]]-related packages; this also distinguishes them from the official packages.
 +
 
 +
=== Runners ===
 +
 
 +
Plasma runners packages should be named {{ic|kdeplasma-runners-''runnername''}} so that they are recognizable as [[KDE]]-related packages; this also distinguishes them from the official packages.
 +
 
 +
=== Service menus ===
 +
 
 +
Service menus packages should be named {{ic|kde-servicemenus-''servicename''}} so that they are recognizable as [[KDE]]-related packages
 +
 
 +
=== Themes ===
 +
 
 +
Plasma themes packages should be named {{ic|kdeplasma-themes-''themename''}} so that they are recognizable as [[KDE]]-related packages.
 +
 
 +
== KF5 package naming ==
  
 
=== Plasma widgets ===
 
=== Plasma widgets ===
Plasma widgets (formerly Plasmoids) packages should be named {{Ic|kdeplasma-applets-''widgetname''}} so that they are recognizable as [[KDE]]-related packages; this also distinguishes them from the official packages.
+
 
 +
Plasma widgets (formerly Plasmoids) packages should be named {{ic|plasma5-applets-''widgetname''}} so that they are recognizable as Plasma 5-related packages; this also distinguishes them from the official packages.
  
 
=== Runners ===
 
=== Runners ===
Plasma runners packages should be named {{Ic|kdeplasma-runners-''runnername''}} so that they are recognizable as [[KDE]]-related packages; this also distinguishes them from the official packages.
+
 
 +
Plasma runners packages should be named {{ic|plasma5-runners-''runnername''}} so that they are recognizable as Plasma 5-related packages; this also distinguishes them from the official packages.
  
 
=== Service menus ===
 
=== Service menus ===
Service menus packages should be named {{Ic|kde-servicemenus-''servicename''}} so that they are recognizable as [[KDE]]-related packages
+
 
 +
Service menus packages should be named {{ic|kf5-servicemenus-''servicename''}} so that they are recognizable as KF5-related packages
  
 
=== Themes ===
 
=== Themes ===
Plasma themes packages should be named {{Ic|kdeplasma-themes-''themename''}} so that they are recognizable as [[KDE]]-related packages.
 
  
== .install files ==
+
Plasma themes packages should be named {{ic|plasma5-themes-''themename''}} so that they are recognizable as Plasma 5-related packages.
For many [[KDE]] packages, all {{Ic|.install}} files look almost exactly the same.
+
 
Some packages install icons in the hicolor icon theme; use the {{Ic|xdg-icon-resource}} utility provided by the {{Pkg|xdg-utils}} package, which is a dependency of the {{Pkg|qt4}} package. So use this line:
+
== Icons and .desktop files installation ==
xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+
 
 +
Some [[KDE]] software provide icons in the hicolor icon theme and {{ic|.desktop}} files, which must be installed via [[pacman hooks]]. Refrain from using installation command for these type of files in a {{ic|.install}}, as it would result in unnecessary double execution of them.
  
Many packages install Freedesktop.org compatible {{Ic|.desktop}} files and register MimeType entries in them. Running {{Ic|update-desktop-database}} in {{Ic|post_install}} is recommended as that tool is provided by the {{Pkg|desktop-file-utils}} package which is a dependency of the {{Pkg|qt4}} package. So use this line:
+
The {{Pkg|qt4}} package already depends on {{Pkg|xdg-utils}}, {{Pkg|hicolor-icon-theme}} and {{Pkg|desktop-file-utils}}, so if your package depends {{Pkg|qt4}}, no other action should be needed (i.e. no need to add these packages to {{ic|depends}} array).
update-desktop-database -q
 

Revision as of 15:07, 24 March 2019

Package creation guidelines

32-bitCLRCrossEclipseElectronFree PascalGNOMEGoHaskellJavaKDEKernelLispMinGWNode.jsNonfreeOCamlPerlPHPPythonRRubyRustVCSWebWine

The KDE packages on Arch Linux follow a certain schema.

Build directory

A good way of building CMake packages is to make a build directory outside the root of the project and run cmake from that directory. The PKGBUILD should look this way:

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../${pkgname}-${pkgver}
}

Install prefix

Every packages must set the CMAKE_INSTALL_PREFIX variable, but also we have to respect custom built versions of KDE, so please use:

-DCMAKE_INSTALL_PREFIX=$(kde4-config --prefix)

or for KDE 5:

-DCMAKE_INSTALL_PREFIX=$(kf5-config --prefix)

When a package is moved to [extra] or [community] that line must be changed to:

-DCMAKE_INSTALL_PREFIX=/usr

Build type

Please specify the build type; this makes it really simple to rebuild a package with debug symbols by just using a sed rule.

-DCMAKE_BUILD_TYPE=Release

Force Qt4

KDE4

On systems where both qt4 and qt5-base are installed, `qmake` refers to the 5.x version, so force cmake to use Qt4 this way:

 export QT_SELECT=4

or using this option in cmake:

-DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4

KF5

The same rules as for KDE4, but you need force cmake to use Qt5 instead of Qt4:

 export QT_SELECT=5

KDE4 package naming

KDE Config Module

KDE Config Module packages should be named kcm-module.

Plasma widgets

Plasma widgets (formerly Plasmoids) packages should be named kdeplasma-applets-widgetname so that they are recognizable as KDE-related packages; this also distinguishes them from the official packages.

Runners

Plasma runners packages should be named kdeplasma-runners-runnername so that they are recognizable as KDE-related packages; this also distinguishes them from the official packages.

Service menus

Service menus packages should be named kde-servicemenus-servicename so that they are recognizable as KDE-related packages

Themes

Plasma themes packages should be named kdeplasma-themes-themename so that they are recognizable as KDE-related packages.

KF5 package naming

Plasma widgets

Plasma widgets (formerly Plasmoids) packages should be named plasma5-applets-widgetname so that they are recognizable as Plasma 5-related packages; this also distinguishes them from the official packages.

Runners

Plasma runners packages should be named plasma5-runners-runnername so that they are recognizable as Plasma 5-related packages; this also distinguishes them from the official packages.

Service menus

Service menus packages should be named kf5-servicemenus-servicename so that they are recognizable as KF5-related packages

Themes

Plasma themes packages should be named plasma5-themes-themename so that they are recognizable as Plasma 5-related packages.

Icons and .desktop files installation

Some KDE software provide icons in the hicolor icon theme and .desktop files, which must be installed via pacman hooks. Refrain from using installation command for these type of files in a .install, as it would result in unnecessary double execution of them.

The qt4 package already depends on xdg-utils, hicolor-icon-theme and desktop-file-utils, so if your package depends qt4, no other action should be needed (i.e. no need to add these packages to depends array).