-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlilypond-unstable.rb
123 lines (104 loc) · 3.89 KB
/
lilypond-unstable.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class LilypondUnstable < Formula
desc "Music engraving system"
homepage "https://lilypond.org"
url "https://lilypond.org/download/source/v2.25/lilypond-2.25.24.tar.gz"
sha256 "d67ea62416d971f418b26ae35b1706fc4b48c85f6e1cd4554fb7d7dfece85dce"
license all_of: [
"GPL-3.0-or-later",
"GPL-3.0-only",
"OFL-1.1-RFN",
"GFDL-1.3-no-invariants-or-later",
:public_domain,
"MIT",
"AGPL-3.0-only",
"LPPL-1.3c",
]
bottle do
root_url "https://github.com/nwhetsell/homebrew-lilypond/releases/download/lilypond-unstable-2.25.24"
sha256 arm64_sequoia: "66e7cb90cf242b162d200a6091cb831c1ba3b4aa9dd6ba6a258b951d327c3501"
sha256 arm64_sonoma: "2d11e25d1aa9295b0a8a5b921373bded0e8c0bfab05489a6fabdae780bfd543f"
sha256 ventura: "6b319196aa4f566a436eb243025e7cbf9645b910909d0c148f51e1923889352e"
sha256 x86_64_linux: "5916c62380ea52ff70ae93d9fe7feafa570cc3b751a4b470a447afae0d35f95f"
end
head do
url "https://gitlab.com/lilypond/lilypond.git", branch: "master"
mirror "https://github.com/lilypond/lilypond.git"
mirror "https://git.savannah.gnu.org/git/lilypond.git"
depends_on "autoconf" => :build
end
keg_only :versioned_formula
depends_on "bison" => :build # bison >= 2.4.1 is required
depends_on "fontforge" => :build
depends_on "make" => :build # make >= 4.2 is required
depends_on "pkg-config" => :build
depends_on "t1utils" => :build
depends_on "texinfo" => :build # makeinfo >= 6.1 is required
depends_on "texlive" => :build
depends_on "bdw-gc"
depends_on "cairo"
depends_on "fontconfig"
depends_on "freetype"
depends_on "ghostscript"
depends_on "glib"
depends_on "guile"
depends_on "libpng"
depends_on "pango"
depends_on "python@3.13"
uses_from_macos "flex" => :build
uses_from_macos "perl" => :build
uses_from_macos "zlib"
on_macos do
depends_on "gettext"
depends_on "harfbuzz"
end
on_linux do
depends_on "gettext" => :build
end
resource "font-urw-base35" do
url "https://github.com/ArtifexSoftware/urw-base35-fonts/archive/refs/tags/20200910.tar.gz"
sha256 "e0d9b7f11885fdfdc4987f06b2aa0565ad2a4af52b22e5ebf79e1a98abd0ae2f"
end
def install
system "./autogen.sh", "--noconfigure" if build.head?
system "./configure", "--datadir=#{share}",
"--disable-documentation",
*("--with-flexlexer-dir=#{Formula["flex"].include}" if OS.linux?),
*std_configure_args
system "make"
system "make", "install"
system "make", "bytecode"
system "make", "install-bytecode"
elisp.install share.glob("emacs/site-lisp/*.el")
fonts = share/"lilypond"/(build.head? ? File.read("out/VERSION").chomp : version)/"fonts/otf"
resource("font-urw-base35").stage do
["C059", "NimbusMonoPS", "NimbusSans"].each do |name|
Dir["fonts/#{name}-*.otf"].each do |font|
fonts.install font
end
end
end
["cursor", "heros", "schola"].each do |name|
cp Dir[Formula["texlive"].share/"texmf-dist/fonts/opentype/public/tex-gyre/texgyre#{name}-*.otf"], fonts
end
end
test do
(testpath/"test.ly").write "\\relative { c' d e f g a b c }"
system bin/"lilypond", "--loglevel=ERROR", "test.ly"
assert_path_exists testpath/"test.pdf"
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..]],
"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=#{style}$/, output)
end
end
end
end