Files
haikuports/media-sound/lilypond/lilypond-2.22.2.recipe
2022-11-08 06:22:46 +01:00

191 lines
4.6 KiB
Bash

SUMMARY="A typesetting system for music notation"
DESCRIPTION="LilyPond is a music engraving program, devoted to producing the highest-quality \
sheet music possible. It brings the aesthetics of traditionally engraved music to computer \
printouts. LilyPond is free software and part of the GNU Project."
HOMEPAGE="https://lilypond.org/"
COPYRIGHT="1993-2020 The LilyPond development team"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://lilypond.org/download/source/v${portVersion%.*}/lilypond-$portVersion.tar.gz"
CHECKSUM_SHA256="dde90854fa7de1012f4e1304a68617aea9ab322932ec0ce76984f60d26aa23be"
PATCHES="lilypond-$portVersion.patchset"
ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
lilypond$secondaryArchSuffix = $portVersion
cmd:abc2ly
cmd:convert_ly
cmd:etf2ly
cmd:lilymidi
cmd:lilypond
cmd:lilypond_book
cmd:lilypond_invoke_editor
cmd:lilysong
cmd:midi2ly
cmd:musicxml2ly
"
REQUIRES="
haiku$secondaryArchSuffix
cmd:fc_list$secondaryArchSuffix
cmd:guile < 2
cmd:python3
lib:libfreetype$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libgmp$secondaryArchSuffix
lib:libgobject_2.0$secondaryArchSuffix
lib:libguile$secondaryArchSuffix
lib:libgs$secondaryArchSuffix # TODO: replace with cmd:gs?
lib:libharfbuzz$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libltdl$secondaryArchSuffix
lib:libpangoft2_1.0$secondaryArchSuffix
"
SUMMARY_doc="${SUMMARY} (English and generic documentation)"
PROVIDES_doc="
lilypond${secondaryArchSuffix}_doc = $portVersion
"
REQUIRES_doc="
lilypond$secondaryArchSuffix == $portVersion base
"
ARCHITECTURES_doc="?any"
languages=(ca cs de es fr hu it ja nl pt zh)
languageNames=(Catalan Czech German Spanish French Hungarian Italian Japanese Dutch Portuguese Chinese)
for i in "${!languages[@]}"; do
lang=${languages[i]}
eval "PROVIDES_doc_${lang}=\"\
lilypond${secondaryArchSuffix}_doc_${lang} = $portVersion\
\"; \
REQUIRES_doc_${lang}=\"\
lilypond${secondaryArchSuffix}_doc == $portVersion base\
\"; \
SUMMARY_doc_${lang}=\"${SUMMARY} (${languageNames[$i]} documentation)\"\
ARCHITECTURES_doc_${lang}=\"?any\""
done
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
tex_gyre
urw_base35_fonts
cmd:guile < 2
devel:libfreetype$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libgmp$secondaryArchSuffix
devel:libgobject_2.0$secondaryArchSuffix
devel:libguile$secondaryArchSuffix
devel:libgs$secondaryArchSuffix
devel:libharfbuzz$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libltdl$secondaryArchSuffix
devel:libpangoft2_1.0$secondaryArchSuffix
tex:epsf
tex:lh
tex:metapost
# The following TeX packages are needed for creating tex formats:
# (because of texlive packaging, all hyphenation patterns are needed,
# the list contains one package from each collection)
tex:dehyph_exptl
tex:hyphen_afrikaans
tex:hyphen_ancientgreek
tex:hyphen_basque
tex:hyphen_catalan
tex:hyphen_chinese
tex:hyphen_croatian
tex:hyphen_czech
tex:hyphen_english
tex:hyphen_italian
tex:hyphen_polish
tex:hyphen_portuguese
"
BUILD_PREREQUIRES="
# cmd:awk
cmd:bison
cmd:convert$secondaryArchSuffix
cmd:dblatex
cmd:extractpdfmark
cmd:fc_list$secondaryArchSuffix
cmd:find
cmd:flex
cmd:fontforge
cmd:gcc$secondaryArchSuffix
cmd:kpsewhich
cmd:make
cmd:mawk # required by texindex
cmd:mf
cmd:mpost
cmd:perl
cmd:pkg_config$secondaryArchSuffix
cmd:rsync
cmd:t1asm
cmd:tar
cmd:texi2html
cmd:texindex
cmd:tidy
cmd:xelatex
cmd:zip
"
TEST_REQUIRES="
dejavu
cmd:fc_cache$secondaryArchSuffix
cmd:git
cmd:xsltproc
tex:realscripts
"
defineDebugInfoPackage lilypond$secondaryArchSuffix \
$prefix/bin/lilypond
PATCH()
{
./autogen.sh --noconfigure
}
BUILD()
{
mkdir -p build
cd build
# the build system already installs documentation in a subdirectory of docdir
runConfigure --omit-dirs "binDir docDir" $sourceDir/configure \
--bindir=$prefix/bin \
--docdir=$documentationDir/packages \
--with-localedir=$dataDir/locale \
--enable-gs-api # needed because of broken ghostscript (gs)
make $jobArgs
# CPU_COUNT=$jobs is not used because it causes hangs
# strip the current directory (.) from PATH, it disallows find -execdir
PATH=${PATH:2} make $jobArgs doc
}
INSTALL()
{
cd build
make install
PATH=${PATH:2} make install-doc
# language specific doc packages
for lang in "${languages[@]}"; do
packageEntries doc_${lang} \
$(find $docDir -name "*.${lang}.*")
done
# generic and english doc package
packageEntries doc \
$docDir $infoDir
}
TEST()
{
# update the fontconfig cache to make sure it knows of all installed fonts (needed by xetex)
fc-cache -f
cd build
make $jobArgs test
}