# Maintainer: justforlxz <justforlxz@gmail.com>
pkgname=deepin-file-manager-git
pkgver=5.5.1.r178.g9977208b0
pkgrel=1
pkgdesc='Deepin File Manager'
arch=('x86_64' 'aarch64')
url="https://github.com/linuxdeepin/dde-file-manager"
license=('GPL3')
depends=('deepin-qt5integration-git' 'deepin-anything-git' 'disomaster-git' 'docparser-git' 'file' 'gio-qt'
         'libmediainfo' 'lucene++' 'avfs' 'polkit-qt5' 'poppler' 'ffmpegthumbnailer' 'jemalloc'
         'kcodecs' 'startdde-git' 'taglib' 'htmlcxx' 'libgsf' 'mimetic' 'boost-libs')
makedepends=('boost' 'qt5-tools' 'deepin-dock-git' 'deepin-movie-git' 'deepin-gettext-tools-git' 'pcre')
optdepends=('deepin-manual: for help menual'
            'deepin-shortcut-viewer: for shortcut display'
            'deepin-screensaver: for screensaver chooser'
            'deepin-movie: for video preview'
            'deepin-terminal: for opening in terminal'
            'deepin-compressor: for compress/decompress')
groups=('deepin-git')
provides=('deepin-file-manager')
conflicts=('deepin-file-manager')
source=('source.tar.gz'
        fix-crash-426.patch)
sha512sums=('SKIP'
            'aaa093d4ee601902cd4e391e51053812297e8730fbbebfb9cb7c6a7746bd2ce7bffc83753863d58f4a4eaf0e514c45a26ff1635ababd6653ff38cb4ae1aab21b')

prepare() {
  cd $deepin_source_name
  patch -p1 -i ../fix-crash-426.patch
  sed -e 's|systembusconf.path = /etc/dbus-1/system.d|systembusconf.path = /usr/share/dbus-1/system.d|' \
      -e 's|systemd_service.path = /lib/systemd/system|systemd_service.path = /usr/lib/systemd/system|' \
      -i src/dde-file-manager-daemon/dde-file-manager-daemon.pro
}

build() {
  cd $deepin_source_name

  qmake-qt5 PREFIX=/usr filemanager.pro
  make
}

package() {
  cd $deepin_source_name

  make INSTALL_ROOT="$pkgdir" install
}
