about summary refs log tree commit diff
path: root/pkgs/misc/lilypond/with-fonts.nix
diff options
context:
space:
mode:
authorEric Bailey <eric@ericb.me>2017-03-06 01:31:53 -0600
committerEric Bailey <eric@ericb.me>2017-03-06 02:16:42 -0600
commitbdc9589df102bc35ecb8f1c3c00bd47bdc784bec (patch)
tree428f9bb8e2e89a0ff613735279b453f2564a18c3 /pkgs/misc/lilypond/with-fonts.nix
parentc31c11ecef2d10fff8421a54739af26a7f3a04a4 (diff)
downloadnixlib-bdc9589df102bc35ecb8f1c3c00bd47bdc784bec.tar
nixlib-bdc9589df102bc35ecb8f1c3c00bd47bdc784bec.tar.gz
nixlib-bdc9589df102bc35ecb8f1c3c00bd47bdc784bec.tar.bz2
nixlib-bdc9589df102bc35ecb8f1c3c00bd47bdc784bec.tar.lz
nixlib-bdc9589df102bc35ecb8f1c3c00bd47bdc784bec.tar.xz
nixlib-bdc9589df102bc35ecb8f1c3c00bd47bdc784bec.tar.zst
nixlib-bdc9589df102bc35ecb8f1c3c00bd47bdc784bec.zip
lilypond: add openlilylib-fonts and lilypond-with-fonts
Diffstat (limited to 'pkgs/misc/lilypond/with-fonts.nix')
-rw-r--r--pkgs/misc/lilypond/with-fonts.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/misc/lilypond/with-fonts.nix b/pkgs/misc/lilypond/with-fonts.nix
new file mode 100644
index 000000000000..9165fb1ed30d
--- /dev/null
+++ b/pkgs/misc/lilypond/with-fonts.nix
@@ -0,0 +1,28 @@
+{ stdenv, lilypond, lndir }: fonts: stdenv.mkDerivation {
+  name = "${lilypond.name}-with-fonts";
+  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
+  '';
+}