# Maintainer: Gavin Luo <lunt.luo#gmail.com>

# Free distribution for non-commercial use, see
# https://github.com/icons8/lunacy-docs/issues/84#issuecomment-2302582626

pkgname=lunacy
pkgver=14.1
pkgrel=1
pkgdesc="Free design software that keeps your flow with AI tools and built-in graphics"
arch=('x86_64')
url="https://icons8.com/lunacy"
license=("LicenseRef-${pkgname}")
depends=('glibc' 'hicolor-icon-theme' 'fontconfig')
makedepends=('dpkg')
options=(!debug)
conflicts=("${pkgname}-bin")

source=("mime.xml"
       "LICENSE::https://lunacy.docs.icons8.com/lunacy%20license/")
source_x86_64=("lunacy_x86_64_${pkgver}.deb::https://lcdn.icons8.com/setup/Lunacy_${pkgver}.deb")

sha256sums=('be1683401bdd1d39df283e8bdceb01704566a753fef3e4da7717827e8ebe2c55'
            '3b5cc79cb27f77f77ab95de27a6a42135369ba43697c4c8d07a5b383aecd5eac')
sha256sums_x86_64=('ae23a5bdddd9c5d0b0e697b9bf44748ea54ca4e14e8957eac66821f18aa73ddd')

package() {
  dpkg -x lunacy_x86_64_${pkgver}.deb "${pkgdir}/"

  install -d "${pkgdir}/usr/bin"
  ln -svf /opt/icons8/${pkgname}/Lunacy "${pkgdir}"/usr/bin/lunacy

  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 mime.xml    "${pkgdir}/usr/share/mime/packages/${pkgname}.xml"
}
