# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>

pkgname=deepin-desktop-schemas
pkgver=3.13.9
pkgrel=1
pkgdesc='GSettings deepin desktop-wide schemas'
arch=('any')
url="https://github.com/linuxdeepin/deepin-desktop-schemas"
license=('GPL3')
depends=('dconf' 'deepin-gtk-theme' 'deepin-icon-theme' 'deepin-sound-theme')
makedepends=('python')
conflicts=('deepin-artwork-themes')
replaces=('deepin-artwork-themes')
groups=('deepin')
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/deepin-desktop-schemas/archive/$pkgver.tar.gz"
        https://github.com/linuxdeepin/deepin-desktop-schemas/commit/bf0c4e43f6b6d508ddd346c2d1e865dae9ae947d.patch)
sha512sums=('a9a4c254657fd960a693c07de310a726acffaa873597df6a1a3538d566a23626408e5e514eef94a5d2b1abc359ea2e27cbf7c529e98e20ede885dd8789d9b320'
            'be13e501baf0517da19618011219b53d633a4186840b20b24d134e5d667c4ab1b6b716c09c78faf802b32ecf3f6f6e5e2f84744a5919b28645f002739d07ea82')

prepare() {
  cd deepin-desktop-schemas-$pkgver
  # disable swap-sched
  patch -Rp1 -i ../bf0c4e43f6b6d508ddd346c2d1e865dae9ae947d.patch
  # fix default background url
  sed -i "s#^picture-uri.*#picture-uri='file:///usr/share/backgrounds/deepin/desktop.jpg'#" overrides/common/com.deepin.wrap.gnome.desktop.override
}

build() {
  cd deepin-desktop-schemas-$pkgver
  make ARCH=x86
}

check() {
  cd deepin-desktop-schemas-$pkgver
  make test
}

package() {
  cd deepin-desktop-schemas-$pkgver
  make DESTDIR="$pkgdir" install
}
