nixpkgs/pkgs/misc/lilypond/with-fonts.nix
Eric Bailey 859db73260 lilypond-with-fonts: rework
- Use symlinkJoin
- Cleanup quoting
- Inherit meta and version from lilypond
2019-06-10 12:30:35 -05:00

31 lines
759 B
Nix

{ stdenv, lndir, symlinkJoin, makeWrapper
, lilypond, openlilylib-fonts
, fonts ? openlilylib-fonts.all
}:
stdenv.lib.appendToName "with-fonts" (symlinkJoin {
inherit (lilypond) name version;
paths = [ lilypond ];
buildInputs = [ makeWrapper lndir ];
postBuild = ''
local datadir="$out/share/lilypond/${lilypond.version}"
local fontsdir="$datadir/fonts"
install -m755 -d "$fontsdir/otf"
install -m755 -d "$fontsdir/svg"
${stdenv.lib.concatMapStrings (font: ''
lndir -silent "${font}/otf" "$fontsdir/otf"
lndir -silent "${font}/svg" "$fontsdir/svg"
'') fonts}
for p in $out/bin/*; do
wrapProgram "$p" --set LILYPOND_DATADIR "$datadir"
done
'';
inherit (lilypond) meta;
})