openlilylib-fonts: rework

- Install to lilypond fonts dir
- Use lilypond-unstable by default
This commit is contained in:
Eric Bailey 2019-06-10 12:21:05 -05:00
parent d013602d78
commit 900be27403
3 changed files with 28 additions and 39 deletions

View File

@ -1,45 +1,43 @@
{ stdenv, fetchFromGitHub, lilypond }:
with stdenv.lib;
let
olpFont = a@{
fontName,
rev,
sha256,
version ? rev,
...
}:
stdenv.mkDerivation (a // rec {
olpFont = { fontName, rev, sha256, version ? rev, ... }:
stdenv.mkDerivation {
inherit version;
name = "openlilypond-font-${fontName}-${version}";
pname = "openlilypond-font-${fontName}";
src = fetchFromGitHub {
inherit rev sha256;
owner = "OpenLilyPondFonts";
repo = a.fontName;
repo = fontName;
};
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
for f in {otf,supplementary-fonts}/**.{o,t}tf; do
install -Dt $out/otf -m755 $f
local fontsdir="$out/share/lilypond/${lilypond.version}/fonts"
install -m755 -d "$fontsdir/otf"
for font in {otf,supplementary-fonts}/**.{o,t}tf; do
install -Dt "$fontsdir/otf" -m755 "$font"
done
for f in svg/**.{svg,woff}; do
install -Dt $out/svg -m755 $f
install -m755 -d "$fontsdir/svg"
for font in svg/**.{svg,woff}; do
install -Dt "$fontsdir/svg" -m755 "$font"
done
'';
meta = {
meta = with stdenv.lib; {
inherit (src.meta) homepage;
inherit (lilypond.meta) platforms;
description = "${fontName} font for LilyPond";
license = a.license or licenses.ofl;
platforms = lilypond.meta.platforms;
maintainers = (a.meta.maintainers or []) ++ [ maintainers.yurrriq ];
license = licenses.ofl;
maintainers = with maintainers; [ yurrriq ];
};
});
};
in

View File

@ -4,28 +4,15 @@
}:
stdenv.lib.appendToName "with-fonts" (symlinkJoin {
inherit (lilypond) name version;
inherit (lilypond) meta 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
for p in $out/bin/*; do
wrapProgram "$p" --set LILYPOND_DATADIR "$datadir"
done
'';
inherit (lilypond) meta;
})

View File

@ -23320,12 +23320,16 @@ in
lguf-brightness = callPackage ../misc/lguf-brightness { };
lilypond = callPackage ../misc/lilypond { guile = guile_1_8; };
lilypond-unstable = callPackage ../misc/lilypond/unstable.nix { };
lilypond-with-fonts = callPackage ../misc/lilypond/with-fonts.nix {
lilypond = lilypond-unstable;
};
openlilylib-fonts = callPackage ../misc/lilypond/fonts.nix { };
openlilylib-fonts = callPackage ../misc/lilypond/fonts.nix {
lilypond = lilypond-unstable;
};
loop = callPackage ../tools/misc/loop { };