# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Alexandre Filgueira <alexfilgueira@cinnarch.com>
# Based on gnome-control-center:
# Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Jan de Groot <jgc@archlinux.org>

pkgname=cinnamon-control-center
pkgver=6.4.2
pkgrel=1
pkgdesc="The Control Center for Cinnamon"
arch=(x86_64)
url="https://github.com/linuxmint/${pkgname}"
license=(GPL)
depends=(cinnamon-settings-daemon cinnamon-menus colord
         libgnomekbd libmm-glib nm-connection-editor)
optdepends=('cinnamon-translations: i18n'
            'gnome-color-manager: for color management tasks'
            'gnome-online-accounts: for the online accounts module')
makedepends=(meson samurai gnome-online-accounts glib2-devel)
options=(!emptydirs)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('2dfeb547d22c5ce3663120830dd96cccd3673c208f62c498b12346a485a57c1e')
b2sums=('893f649c853bd1fd74cd46d8d75de395f6f13490c42443edb3e1bcde7556a8701a1d112f0f0e78b5e1fb57843abbcc8e0f440d65be67aa77d28542365fb6438f')

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

package() {
  DESTDIR="${pkgdir}" samu -C build install
  # https://github.com/linuxmint/Cinnamon/pull/7382#issuecomment-374894901
  # /usr/bin/cinnamon-control-center is not meant for users, it is a development troubleshooting tool.
  # Just install the shell libs/headers.
  rm "${pkgdir}"/usr/bin/cinnamon-control-center
  rm "${pkgdir}"/usr/share/cinnamon-control-center/ui/shell.ui
}
