nixpkgs-suyu/pkgs/misc/lilypond/with-fonts.nix
Matthew Bauer a0f4d19925 treewide: use appendToName where appropriate
Using appendToName preserves the version at the end of the name.
2018-05-25 15:48:31 -05:00

35 lines
912 B
Nix

{ stdenv
, lndir
, lilypond
, openlilylib-fonts
, fonts ? openlilylib-fonts.all
}:
stdenv.lib.appendToName "with-fonts" (stdenv.mkDerivation {
inherit (lilypond) name;
phases = "installPhase";
buildInputs = fonts;
nativeBuildInputs = [ lndir ];
installPhase = ''
local fontsdir=$out/share/lilypond/${lilypond.version}/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}
install -m755 -d $out/lib
lndir -silent ${lilypond}/lib $out/lib
install -m755 -d $out/share
lndir -silent ${lilypond}/share $out/share
install -m755 -Dt $out/bin ${lilypond}/bin/*
for p in $out/bin/*; do
substituteInPlace $p --replace "exec -a \"${lilypond}" "exec -a \"$out"
done
'';
})