2017-03-06 10:33:31 +00:00
|
|
|
{ stdenv
|
|
|
|
, lndir
|
|
|
|
, lilypond
|
|
|
|
, openlilylib-fonts
|
|
|
|
, fonts ? openlilylib-fonts.all
|
|
|
|
}:
|
|
|
|
|
2018-05-25 10:21:47 +01:00
|
|
|
stdenv.lib.appendToName "with-fonts" (stdenv.mkDerivation {
|
|
|
|
inherit (lilypond) name;
|
2017-03-06 07:31:53 +00:00
|
|
|
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
|
2017-05-26 10:52:11 +01:00
|
|
|
substituteInPlace $p --replace "exec -a \"${lilypond}" "exec -a \"$out"
|
2017-03-06 07:31:53 +00:00
|
|
|
done
|
|
|
|
'';
|
2018-05-25 10:21:47 +01:00
|
|
|
})
|