Difference between revisions of "KDE package guidelines"

From ArchWiki
Jump to: navigation, search
m (Force Qt4)
m (Force Qt4)
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
  
 
== Build dir ==
 
== Build dir ==
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 dir. So, the build function in the [[PKGBUILD]] should start with the following lines:
+
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 dir. The [[PKGBUILD]] should look this way:
  mkdir build
+
  prepare() {
  cd build
+
  mkdir build
cmake ../${pkgname}-${pkgver}
+
  }
 +
build() {
 +
  cd build
 +
  cmake ../${pkgname}-${pkgver}
 +
}
  
 
== 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)
 
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
Line 22: Line 26:
 
== Force Qt4 ==
 
== Force Qt4 ==
 
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:
  -DQT_QMAKE_EXECUTABLE=qmake4
+
  export QT_SELECT=4
  
 
== Package naming ==
 
== Package naming ==

Revision as of 08:31, 5 May 2013

Template:Package Guidelines

The KDE packages on Arch Linux follow a certain schema.

Build dir

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

prepare() {
 mkdir 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)

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

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

Package naming

KDE Config Module

KDE Config Module packages should be named kcm-module.

Plasmoids

Plasmoids packages should be named kdeplasma-applets-plasmoidname 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.

.install files

For many KDE packages, all .install files look almost exactly the same. Some packages install icons in the hicolor icon theme; use the xdg-icon-resource utility provided by the xdg-utils package, which is a dependency of the qt4 package. So use this line:

xdg-icon-resource forceupdate --theme hicolor &> /dev/null

Many packages install Freedesktop.org compatible .desktop files and register MimeType entries in them. Running update-desktop-database in post_install is recommended as that tool is provided by the desktop-file-utils package which is a dependency of the qt4 package. So use this line:

update-desktop-database -q