description='Screensaver designed to integrate well with the Cinnamon desktop.'
makedepends=(cinnamon-desktop meson python gtk3 xdotool)

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

set=(cinnamon)

name=cinnamon-screensaver
version=5.6.3

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

build() {
mkdir build
cd build
meson --prefix=/usr \
--libexecdir=lib/cinnamon-screensaver \
--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
}
