Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lilypond: add openlilylib-fonts and lilypond-with-fonts #23548

Merged
merged 2 commits into from Mar 6, 2017

Conversation

yurrriq
Copy link
Member

@yurrriq yurrriq commented Mar 6, 2017

Motivation for this change

I want to use some custom music fonts, which LilyPond supports but needs for them to be in a particular location.

Notes

I feel like the code I've written is a bit sloppy and I'm very open to suggestions.

Example:

{
  nixpkgs.config.packageOverrides = pkgs: rec {
    my-lilypond = pkgs.lilypond-with-fonts(with pkgs.openlilylib-fonts; [
      improviso
      lilyjazz
    ]);
}

Edit:

{
    my-lilypond = pkgs.lilypond-with-fonts.override {
      fonts = with pkgs.openlilylib-fonts; [ improviso lilyjazz ];
    };
}
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

in

{
beethoven = olpFont {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assembled this mostly manually. It should probably be scripted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably ok for the moment.

install -m755 -Dt $out/bin ${lilypond}/bin/*

for p in $out/bin/*; do
substituteInPlace $p --replace "exec -a ${lilypond}" "exec -a $out"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but feels very hackish. The lilypond binary seems to look for fonts in ../share/lilypond/${lilypond.version}/fonts so simply symlinking the original, doesn't work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I currently do not see a different solution.

@yurrriq
Copy link
Member Author

yurrriq commented Mar 6, 2017

/cc @puffnfresh @Mic92

@@ -0,0 +1,28 @@
{ stdenv, lilypond, lndir }: fonts: stdenv.mkDerivation {
Copy link
Member

@Mic92 Mic92 Mar 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be the default value just use all OpenLilyPondFonts? Some people just want to get something working without having to override a package. Maybe an all attribute containing a list of all fonts.

Add a list of all fonts to openlilylib-fonts and use that as the default
fonts argument to lilypond-with-fonts.
@Mic92 Mic92 merged commit d971a9b into NixOS:master Mar 6, 2017
@Mic92
Copy link
Member

Mic92 commented Mar 6, 2017

Thanks!

@yurrriq yurrriq deleted the update/pkgs/misc/lilypond/with-fonts branch March 6, 2017 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants