AgentSkillsCN

archlinux-pkgbuild/desktop-integration

适用于打包 GNOME 应用程序、KDE Plasma 小部件/主题、Eclipse IDE 插件,或需要桌面环境集成的字体包时使用。

SKILL.md
--- frontmatter
name: archlinux-pkgbuild/desktop-integration
description: Use when packaging GNOME applications, KDE Plasma widgets/themes, Eclipse IDE plugins, or font packages requiring desktop environment integration

Desktop Integration Packages

For core PKGBUILD workflow, use archlinux-pkgbuild

This sub-skill covers desktop-specific packaging requirements for GNOME, KDE, Eclipse, and Font packages.

Quick Reference

TypeKey ToolInstall LocationHook Handling
GNOMEmeson/arch-meson/usr/bin, /usr/shareGSettings/icons auto
KDEcmake + extra-cmake-modules/usr/lib/qt/pluginsAuto-discovery
EclipseN/A (Java)/usr/lib/eclipse/dropinsAuto-discovery
FontsN/A/usr/share/fonts/$pkgnamefc-cache auto

Font Packages

Font packages install TrueType, OpenType, or Variable fonts system-wide.

Font Key Rules

RuleDescription
Package namingttf-fontname (TrueType) or otf-fontname (OpenType)
Variable fonts suffixAdd -variable suffix for variable fonts
ArchitectureAlways any
DependenciesNone (fontconfig handled by hooks)
Installation path/usr/share/fonts/$pkgname/
License installation/usr/share/licenses/$pkgname/ (especially OFL)
ProvidesAdd provides=('ttf-font') if meets criteria

Font Template

bash
pkgname=ttf-example
pkgver=1.0.0
pkgrel=1
pkgdesc="Example TrueType font family"
arch=('any')
url="https://example.com"
license=('OFL-1.1-RFN')
provides=('ttf-font')
source=("https://example.com/$pkgname-$pkgver.tar.gz")
sha256sums=('...')

package() {
    cd "$pkgname-$pkgver"
    
    # Install fonts
    install -Dm644 -t "$pkgdir/usr/share/fonts/$pkgname" fonts/*.ttf
    
    # Install license (required for OFL)
    install -Dm644 OFL.txt "$pkgdir/usr/share/licenses/$pkgname/OFL.txt"
}

Font Common Issues

IssueCauseFix
Missing licenseOFL not installedInstall to /usr/share/licenses/$pkgname/
Wrong directoryFont in wrong locationUse /usr/share/fonts/$pkgname/
Uppercase in namePackage naming violationUse all lowercase
Font cache not updatedOld packages used .installRemove .install (hooks handle this)

GNOME Packages

GNOME applications follow GNOME's build conventions and use common GNOME infrastructure.

GNOME Key Rules

RuleDescription
Build systemMost use Meson, some older use GNU Autotools
Source URLdownload.gnome.org for releases, gitlab.gnome.org for Git
GSettingsNo manual intervention (pacman hooks handle updates)
Icons/desktopNo .install files (pacman hooks handle caching)
Metainfo validationAdd appstream-glib to checkdepends

GNOME Template (Meson)

bash
pkgname=example-gnome-app
pkgver=45.0
pkgrel=1
pkgdesc="Example GNOME application"
arch=('x86_64')
url="https://gitlab.gnome.org/GNOME/$pkgname"
license=('GPL-2.0-or-later')
depends=('gtk4' 'libadwaita' 'glib2')
makedepends=('meson' 'git' 'appstream-glib')
checkdepends=('appstream-glib')
source=("https://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz")
sha256sums=('...')

build() {
    arch-meson "$pkgname-$pkgver" build
    meson compile -C build
}

check() {
    meson test -C build --print-errorlogs
}

package() {
    meson install -C build --destdir "$pkgdir"
}

GNOME Common Issues

IssueCauseFix
Manual schema compileOld habit from pre-hook eraRemove from .install
Icon cache in .installUnnecessary with hooksRemove from .install
Desktop database in .installUnnecessary with hooksRemove from .install
Wrong source URLOld git.gnome.orgUse gitlab.gnome.org

KDE Packages

KDE packages use CMake with specific conventions for Plasma widgets, themes, and applications.

KDE Key Rules

RuleDescription
Build directoryOut-of-source build required (mkdir -p build)
Install prefixAlways -DCMAKE_INSTALL_PREFIX=/usr
Build typeGenerally omit (honors CFLAGS/CPPFLAGS)
Plasma widgetsName: plasma6-applets-widgetname
Plasma runnersName: plasma6-runners-runnername
Service menusName: kf6-servicemenus-servicename
ThemesName: plasma6-themes-themename

KDE Template

bash
pkgname=plasma6-applets-example
pkgver=1.0.0
pkgrel=1
pkgdesc="Example Plasma 6 widget"
arch=('x86_64')
url="https://example.com"
license=('GPL')
depends=('plasma-workspace')
makedepends=('extra-cmake-modules' 'plasma-framework')
source=("https://example.com/$pkgname-$pkgver.tar.gz")
sha256sums=('...')

prepare() {
    mkdir -p build
}

build() {
    cd build
    cmake ../$pkgname-$pkgver \
        -DCMAKE_INSTALL_PREFIX=/usr
    make
}

package() {
    cd build
    make DESTDIR="$pkgdir" install
}

KDE Common Issues

IssueCauseFix
Wrong naming conventionInconsistent with Arch standardsUse plasma6-, kf6- prefixes
In-source buildBuild artifacts in sourceUse out-of-source build directory
Wrong CMake prefixFiles in wrong locationSet CMAKE_INSTALL_PREFIX=/usr
Missing extra-cmake-modulesKDE macros not availableAdd to makedepends

Eclipse Packages

Eclipse packages provide plugins and features for the Eclipse IDE.

Eclipse Key Rules

RuleDescription
Package namingeclipse-pluginname (use plugin's common name, not internal ID)
ArchitectureUsually any (pure Java), x86_64 if contains native libraries
DependenciesMust depend on eclipse or specific Eclipse base
Install location/usr/lib/eclipse/dropins/pluginname/
No manual registrationEclipse auto-discovers plugins in dropins/
Feature-basedInstall complete features, not individual JARs

Eclipse Template

bash
pkgname=eclipse-example
_pkgname=com.example.eclipse.plugin
pkgver=1.0.0
pkgrel=1
pkgdesc="Example plugin for Eclipse IDE"
arch=('any')
url="https://example.com"
license=('EPL')
depends=('eclipse')
source=("https://example.com/eclipse-plugin-$pkgver.zip")
sha256sums=('...')

package() {
    cd "$srcdir"
    
    # Install to dropins directory
    install -dm755 "$pkgdir/usr/lib/eclipse/dropins/$pkgname"
    
    # Copy features and plugins
    if [ -d features ]; then
        cp -r features "$pkgdir/usr/lib/eclipse/dropins/$pkgname/"
    fi
    
    if [ -d plugins ]; then
        cp -r plugins "$pkgdir/usr/lib/eclipse/dropins/$pkgname/"
    fi
    
    # Install license
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Eclipse Common Issues

IssueCauseFix
Plugin not detectedWrong install locationUse /usr/lib/eclipse/dropins/
Manual registration attemptedOld Eclipse versionsRemove registration (auto-discovery works)
Missing features/ directoryOnly plugins/ installedInstall complete feature structure
Internal ID usedPackage naming errorUse common name, not com.example.id