2019-06-10 02:48:52 -07:00
|
|
|
{ stdenv, lndir, symlinkJoin, makeWrapper
|
|
|
|
, lilypond, openlilylib-fonts
|
2017-03-06 02:33:31 -08:00
|
|
|
, fonts ? openlilylib-fonts.all
|
|
|
|
}:
|
|
|
|
|
2019-06-10 02:48:52 -07:00
|
|
|
stdenv.lib.appendToName "with-fonts" (symlinkJoin {
|
|
|
|
inherit (lilypond) name version;
|
2017-03-05 23:31:53 -08:00
|
|
|
|
2019-06-10 02:48:52 -07:00
|
|
|
paths = [ lilypond ];
|
2017-03-05 23:31:53 -08:00
|
|
|
|
2019-06-10 02:48:52 -07:00
|
|
|
buildInputs = [ makeWrapper lndir ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
local datadir="$out/share/lilypond/${lilypond.version}"
|
|
|
|
local fontsdir="$datadir/fonts"
|
2017-03-05 23:31:53 -08:00
|
|
|
|
2019-06-10 02:48:52 -07:00
|
|
|
install -m755 -d "$fontsdir/otf"
|
|
|
|
install -m755 -d "$fontsdir/svg"
|
2017-03-05 23:31:53 -08:00
|
|
|
|
2019-06-10 02:48:52 -07:00
|
|
|
${stdenv.lib.concatMapStrings (font: ''
|
|
|
|
lndir -silent "${font}/otf" "$fontsdir/otf"
|
|
|
|
lndir -silent "${font}/svg" "$fontsdir/svg"
|
|
|
|
'') fonts}
|
2017-03-05 23:31:53 -08:00
|
|
|
|
|
|
|
for p in $out/bin/*; do
|
2019-06-10 02:48:52 -07:00
|
|
|
wrapProgram "$p" --set LILYPOND_DATADIR "$datadir"
|
2017-03-05 23:31:53 -08:00
|
|
|
done
|
|
|
|
'';
|
2019-06-10 02:48:52 -07:00
|
|
|
|
|
|
|
inherit (lilypond) meta;
|
2018-05-25 02:21:47 -07:00
|
|
|
})
|