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-unstable: update patch #66

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 19 additions & 45 deletions Formula/lilypond-unstable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LilypondUnstable < Formula
"AGPL-3.0-only",
"LPPL-1.3c",
]
revision 1
revision 2

bottle do
root_url "https://github.com/nwhetsell/homebrew-lilypond/releases/download/lilypond-unstable-2.25.12_1"
Expand Down Expand Up @@ -53,6 +53,12 @@ class LilypondUnstable < Formula
sha256 "e0d9b7f11885fdfdc4987f06b2aa0565ad2a4af52b22e5ebf79e1a98abd0ae2f"
end

# Fix running `lilypond -dshow-available-fonts`, remove at LilyPond 2.25.13
patch do
url "https://gitlab.com/lilypond/lilypond/-/commit/7415196b238fe8c9d72fadece91e92bc41923976.diff"
sha256 "2b00e4c54bb732befc23a686be3d187bf9cf325c9c42610fed00557a5b68ef36"
end

def install
system "./autogen.sh", "--noconfigure" if build.head?

Expand Down Expand Up @@ -86,55 +92,23 @@ def install
end

test do
(testpath/"test.ly").write <<~EOS
\\relative { c' d e f g a b c }

#(define-markup-command (pretty-print layout properties markup) (markup?)
(let ((stencil (interpret-markup layout properties markup)))
(pretty-print (ly:stencil-expr stencil))
stencil))

test-markup = \\markup {
\\pretty-print "test"
\\pretty-print \\bold "test"
\\pretty-print \\italic "test"
\\pretty-print \\bold \\italic "test"

\\pretty-print \\sans "test"
\\pretty-print \\sans \\bold "test"
\\pretty-print \\sans \\italic "test"
\\pretty-print \\sans \\bold \\italic "test"

\\pretty-print \\typewriter "test"
\\pretty-print \\typewriter \\bold "test"
\\pretty-print \\typewriter \\italic "test"
\\pretty-print \\typewriter \\bold \\italic "test"
}

\\test-markup

\\markup \\override #'(fonts . ((serif . "TeX Gyre Schola")
(sans . "TeX Gyre Heros")
(typewriter . "TeX Gyre Cursor"))) {
\\test-markup
}
EOS

output = shell_output("#{bin}/lilypond --loglevel=ERROR test.ly")

(testpath/"test.ly").write "\\relative { c' d e f g a b c }"
system bin/"lilypond", "--loglevel=ERROR", "test.ly"
assert_predicate testpath/"test.pdf", :exist?

common_styles = %w[Regular Bold Italic BoldItalic]
output = shell_output("#{bin}/lilypond --define-default=show-available-fonts")
.encode("UTF-8", invalid: :replace, replace: "\ufffd")
common_styles = ["Regular", "Bold", "Italic", "Bold Italic"]
{
"C059" => ["Roman", *common_styles[1..2], "BdIta"],
"NimbusMonoPS" => common_styles,
"NimbusSans" => common_styles,
"TeXGyreCursor" => common_styles,
"TeXGyreHeros" => common_styles,
"TeXGyreSchola" => common_styles,
"C059" => ["Roman", *common_styles[1..]],
"Nimbus Mono PS" => common_styles,
"Nimbus Sans" => common_styles,
"TeX Gyre Cursor" => common_styles,
"TeX Gyre Heros" => common_styles,
"TeX Gyre Schola" => common_styles,
}.each do |family, styles|
styles.each do |style|
assert_match(/^\s*"#{family}-#{style}"$/, output)
assert_match(/^\s*#{family}:style=#{style}$/, output)
end
end
end
Expand Down