# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: David Runge <dvzrv@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Evgeniy Alekseev <arcanis at archlinux dot org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Geoffroy Carrier <geoffroy@archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Robert Emil Berge <filoktetes@linuxophic.org>
# Contributor: Jonas Hahnfeld <hahnjo@hahnjo.de>

pkgname=lilypond
pkgver=2.24.3
pkgrel=3
pkgdesc="Music engraving program, devoted to producing the highest-quality sheet music possible"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://lilypond.org"
license=(FDL1.3 GPL3 OFL)
groups=(pro-audio)
depends=(fontconfig libfontconfig.so
         freetype2 libfreetype.so
         gcc-libs
         ghostscript
         glib2 libgobject-2.0.so
         glibc libglib-2.0.so
         gsfonts
         guile2.2 libguile-2.2.so
         harfbuzz libharfbuzz.so
         pango libpango-1.0.so libpangoft2-1.0.so
         )
makedepends=(dblatex
             fontforge
             imagemagick
             python
             rsync
             t1utils
             texinfo
             texlive-basic
             texlive-bin
             texlive-binextra
             texlive-fontutils
             texlive-langcyrillic
             texlive-metapost
             texlive-xetex
             zip)
optdepends=('python: for lilypond-book and other scripts'
            'tex-gyre-fonts: for extra fonts'
            'ttf-dejavu: for extra fonts')
source=("https://lilypond.org/downloads/sources/v${pkgver%.*}/$pkgname-$pkgver.tar.gz")
sha512sums=('5153f6cbe5e68e4b3dfcc03a8299ef6b82fbfb487eb3e4f9d631b9dc5a07a972168c3f141d6d50eac936f5c7aeeacd19837c0c9ab70f11dfd5c7efe085d5b56e')
b2sums=('6be6ca1f090869a8d545befe3d1f54122514e7dcf9aff1bcc2d78819820da8cef908c5033039eb231b48ae914c1ebd6d766566862a40721580747f017f1445ad')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr \
              --disable-texi2html
  make all bytecode
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" vimdir="/usr/share/vim/vimfiles" install install-bytecode
  install -vDm 644 LICENSE.OFL -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -vDm 644 {AUTHORS,NEWS}.txt README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}
