description='The Cinnamon Session Handler.'
url='https://github.com/linuxmint/cinnamon-session'

packager="spiky <spiky@nutyx.org>"
contributors="Fanch,Tnut"

set=(cinnamon)

makedepends=(meson cinnamon-desktop dbus-glib libcanberra
             xorg-libsm xapp)
run=(xorg-xtrans)

name=cinnamon-session
version=5.6.0

PKGMK_KEEP_SOURCES="no"
source=(https://github.com/linuxmint/cinnamon-session/archive/$version.tar.gz)

build() {
mkdir build
cd build

meson --prefix=/usr \
--libexecdir=lib/$name \
--buildtype=plain \
../$name-$version

ninja
DESTDIR=${PKG} ninja install
}
package() {
wget https://download.tuxfamily.org/nutyx/files/cinnamon-translations-5.2.2.tar.gz
bsdtar xf cinnamon-translations-5.2.2.tar.gz
cd cinnamon-translations-5.2.2
for file in po-export/$name/*.po
do
    LANG=${file/*-/}
    install -d $PKG/usr/share/locale/${LANG%.*}/LC_MESSAGES
    msgfmt -o $PKG/usr/share/locale/${LANG%.*}/LC_MESSAGES/$name.mo \
    $file
done
}
