From 3256496116d00f35f442dbc0c69d692f511d8acc Mon Sep 17 00:00:00 2001 From: Nate Whetsell Date: Sun, 14 Jan 2024 13:09:44 -0500 Subject: [PATCH 1/2] Revert "lilypond-unstable: remove patch" This reverts commit d9d19fda215129429b9abb05bdbd12133400a7cd. --- Formula/lilypond-unstable.rb | 74 ++++++++++++++---------------------- 1 file changed, 29 insertions(+), 45 deletions(-) diff --git a/Formula/lilypond-unstable.rb b/Formula/lilypond-unstable.rb index 539a73a..7db7ab4 100644 --- a/Formula/lilypond-unstable.rb +++ b/Formula/lilypond-unstable.rb @@ -13,7 +13,6 @@ class LilypondUnstable < Formula "AGPL-3.0-only", "LPPL-1.3c", ] - revision 1 bottle do root_url "https://github.com/nwhetsell/homebrew-lilypond/releases/download/lilypond-unstable-2.25.12_1" @@ -53,6 +52,9 @@ class LilypondUnstable < Formula sha256 "e0d9b7f11885fdfdc4987f06b2aa0565ad2a4af52b22e5ebf79e1a98abd0ae2f" end + # See https://lists.gnu.org/archive/html/bug-lilypond/2024-01/msg00005.html + patch :DATA + def install system "./autogen.sh", "--noconfigure" if build.head? @@ -86,56 +88,38 @@ 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") + 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 end + +__END__ +diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc +index cdf16e4..54b29b2 100644 +--- a/lily/all-font-metrics.cc ++++ b/lily/all-font-metrics.cc +@@ -273,7 +273,7 @@ All_font_metrics::display_fonts (SCM port) + { + std::string str = display_list (font_config_.get ()); + str += display_config (font_config_.get ()); +- scm_write_line (ly_string2scm (str), port); ++ scm_write_line (scm_from_stringn (str.c_str (), str.length (), "ISO-8859-1", SCM_FAILED_CONVERSION_QUESTION_MARK), port); + } + + std::string From 8e1293da04e45eb3ae68afb153b40ef1c7f83713 Mon Sep 17 00:00:00 2001 From: Nate Whetsell Date: Sun, 14 Jan 2024 13:15:38 -0500 Subject: [PATCH 2/2] lilypond-unstable: update patch --- Formula/lilypond-unstable.rb | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/Formula/lilypond-unstable.rb b/Formula/lilypond-unstable.rb index 7db7ab4..3e7a3a7 100644 --- a/Formula/lilypond-unstable.rb +++ b/Formula/lilypond-unstable.rb @@ -13,6 +13,7 @@ class LilypondUnstable < Formula "AGPL-3.0-only", "LPPL-1.3c", ] + revision 2 bottle do root_url "https://github.com/nwhetsell/homebrew-lilypond/releases/download/lilypond-unstable-2.25.12_1" @@ -52,8 +53,11 @@ class LilypondUnstable < Formula sha256 "e0d9b7f11885fdfdc4987f06b2aa0565ad2a4af52b22e5ebf79e1a98abd0ae2f" end - # See https://lists.gnu.org/archive/html/bug-lilypond/2024-01/msg00005.html - patch :DATA + # 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? @@ -93,6 +97,7 @@ def install assert_predicate testpath/"test.pdf", :exist? 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..]], @@ -108,18 +113,3 @@ def install end end end - -__END__ -diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc -index cdf16e4..54b29b2 100644 ---- a/lily/all-font-metrics.cc -+++ b/lily/all-font-metrics.cc -@@ -273,7 +273,7 @@ All_font_metrics::display_fonts (SCM port) - { - std::string str = display_list (font_config_.get ()); - str += display_config (font_config_.get ()); -- scm_write_line (ly_string2scm (str), port); -+ scm_write_line (scm_from_stringn (str.c_str (), str.length (), "ISO-8859-1", SCM_FAILED_CONVERSION_QUESTION_MARK), port); - } - - std::string