/
Portfile
292 lines (246 loc) · 9.94 KB
/
Portfile
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup active_variants 1.1
PortGroup perl5 1.0
name lilypond
categories textproc
maintainers {snc @nerdling} openmaintainer
license GPL-3+
description An automated engraving system for typesetting sheet music.
long_description Lilypond is a unix-based automated engraving system that \
generates beautiful sheet music from input files. Lilypond \
uses its own input format, .ly, which in many ways is \
similar to LaTeX. Lilypond can export sheet music to PDF, \
EPS, SVG, and PNG formats, and can also create MIDI files.
perl5.major 5.34
subport lilypond-devel {
long_description The development version of the LilyPond music typesetter.
}
variant mactex description {Use MacTeX or non-MacPorts TeX; see\
"port notes" for more information} {}
variant docs description {Build documentation files} {}
notes-append "\
Pre-installation note for 'mactex' variant:
MacTeX or another external TeXLive distribution gets used for\
installation instead of MacPorts's texlive packages; the path to\
the TeX distribution's binary directory (for example\
'/Library/TeX/texbin') must be added to 'binpath' in\
'macports.conf' *before* installing this port.
Note that TeX is not needed after installation."
compiler.cxx_standard 2014
if {${subport} eq ${name}} {
version 2.22.2
revision 1
conflicts lilypond-devel
checksums rmd160 571de8313f90be3a41b0f7f0bd82a48f67e4f245 \
sha256 dde90854fa7de1012f4e1304a68617aea9ab322932ec0ce76984f60d26aa23be \
size 18034586
set livecheck_url "source.html"
# not needed for lilypond > 2.20.x ?
if {[string match *clang* ${configure.cxx}]} {
configure.ldflags-append -stdlib=${configure.cxx_stdlib}
}
} else {
version 2.23.11
revision 0
conflicts lilypond
checksums rmd160 3d967a3e28de0402ac7b8ce3a308995b280d07a0 \
sha256 e158dcb99bd19a93e6899e36cf293dc583e5b1237a904b014917b7d0ffab690f \
size 19271435
set livecheck_url "development.html"
}
set branch [join [lrange [split ${version} .] 0 1] .]
homepage https://lilypond.org
master_sites https://lilypond.org/download/sources/v${branch}/
livecheck.type regex
livecheck.regex ${name}-(\\d+(\\.\\d+)+)
livecheck.url ${homepage}/${livecheck_url}
platforms darwin
universal_variant no
depends_build-append \
port:autoconf \
port:bison \
port:flex \
port:fontforge \
port:gmake \
port:p${perl5.major}-encode \
port:p${perl5.major}-pod-escapes \
port:p${perl5.major}-pod-simple \
port:p${perl5.major}-podlators \
port:p${perl5.major}-scalar-list-utils \
port:pkgconfig \
port:t1utils \
port:texinfo \
port:urw-core35-fonts
if {![variant_isset mactex]} {
depends_build-append \
port:texlive-fonts-recommended \
port:texlive-metapost \
}
if {[variant_isset docs] && ![variant_isset mactex]} {
# For +docs, only bibtex and xetex are needed right now.
depends_build-append \
port:texlive-xetex
}
set py_ver 3.10
set py_ver_nodot [string map {. {}} ${py_ver}]
# Either 'pango' or 'pango-devel' will do, thus we depend on its
# pkgconfig file.
depends_lib-append path:lib/pkgconfig/pango.pc:pango \
port:extractpdfmark \
port:ghostscript \
port:python${py_ver_nodot}
if {${subport} eq ${name}} {
depends_lib-append port:guile18
} else {
depends_lib-append port:guile
}
build.type gnu
configure.cmd autoconf -f && ./configure
configure.python ${prefix}/bin/python${py_ver}
configure.perl ${perl5.bin}
if {${subport} ne ${name}} {
# These targets also build and install compiled Scheme files (with
# extension '.go'). This is essential to make LilyPond run with
# an acceptable speed while using Guile 2.2.
build.target bytecode
destroot.target install-bytecode
}
set lilypond.texgyredir \
"${prefix}/share/texmf-texlive/fonts/opentype/public/tex-gyre"
set lilypond.mactex_bin ""
set lilypond.temp ""
set lilypond.have_texgyre false
if {[variant_isset mactex]} {
# Find the binary directory of the external TeX distribution by
# searching the kpsewhich program in the path. We assume that all
# other binaries of the distribution are in this directory, too.
if {[auto_execok kpsewhich] ne ""} {
set lilypond.temp {*}[auto_execok kpsewhich]
}
set lilypond.mactex_bin \
[file dirname [file normalize ${lilypond.temp}]]
if {${lilypond.mactex_bin} eq "."} {
pre-fetch {
return -code error "Cannot find MacTeX or external TeXLive\
installation; aborting. Have you added the path to\
your TeX distribution's binary directory to 'binpath'\
in 'macports.conf'?"
}
} elseif {${lilypond.mactex_bin} eq \
[file dirname [file normalize "${prefix}/bin/kpsewhich"]]} {
pre-fetch {
return -code error "Variant 'mactex' doesn't work with\
installed MacPorts TeXLive packages. Either\
uninstall them or don't use the 'mactex' variant of\
${subport}."
}
} else {
set lilypond.have_texgyre \
[regexp -line {installed: *Yes} \
[exec ${lilypond.mactex_bin}/tlmgr info --only-installed tex-gyre]]
}
if {${lilypond.have_texgyre}} {
set lilypond.texgyredir \
[file dirname \
[exec ${lilypond.mactex_bin}/kpsewhich texgyreschola-regular.otf]]
} else {
pre-fetch {
return -code error "TeXLive package 'tex-gyre' not\
installed; aborting. Please install it, then\
try again"
}
}
}
if {[variant_isset docs]} {
if {${subport} ne ${name}} {
# Currently, +docs only builds the info files. For a complete
# documentation build a texi2html 1.82 bundle is necessary,
# which doesn't exist yet in MacPorts.
configure.args-append --disable-texi2html
}
} else {
configure.args-append --disable-documentation
}
configure.args-append --with-urwotf-dir=${prefix}/share/fonts/urw-core35-fonts
configure.args-append --with-texgyre-dir=${lilypond.texgyredir}
if {${subport} eq ${name}} {
configure.env-append GUILE=${prefix}/bin/guile18
configure.env-append GUILE_FLAVOR=guile-1.8
}
configure.env-append PYTHON=${configure.python}
build.env-append PYTHON=${configure.python}
destroot.env-append PYTHON=${configure.python}
configure.env-append LTDL_LIBRARY_PATH=${prefix}/lib
build.env-append LTDL_LIBRARY_PATH=${prefix}/lib
destroot.env-append LTDL_LIBRARY_PATH=${prefix}/lib
configure.args-append --with-flexlexer-dir=${worksrcpath}/flex
pre-patch {
file mkdir ${worksrcpath}/flex
copy ${prefix}/include/FlexLexer.h ${worksrcpath}/flex/FlexLexer.h
}
patchfiles patch-fix-missing-override.diff
if {${subport} eq ${name}} {
patchfiles-append patch-add-flex-to-include.diff
} else {
patchfiles-append patch-add-flex-to-include-devel.diff
}
post-patch {
if {${subport} eq ${name}} {
# Use guile18 header files.
reinplace -W ${worksrcpath} \
s|libguile\.h|libguile18.h|g \
configure.ac \
lily/include/lily-guile.hh
}
# Correct mf2pt1 binary location.
reinplace -W ${worksrcpath} \
s|"-mem=mf2pt1"|"-mem=../../mf2pt1"|g \
scripts/build/mf2pt1.pl
# Correct python shebang.
reinplace -W ${worksrcpath} -E \
s|/usr/bin/(env\\\ )?python3?|${configure.python}|g \
scripts/auxiliar/check_texi_refs.py \
scripts/auxiliar/check_translation.py \
scripts/auxiliar/fixcc.py \
scripts/auxiliar/makelsr.py \
scripts/auxiliar/tely-gettext.py \
scripts/auxiliar/texi-langutils.py \
scripts/auxiliar/translations-status.py \
scripts/auxiliar/update-snippets.py
# ImageMagick and xelatex (or pdflatex) are only needed for
# complete documentation builds, which +docs doesn't do currently.
# Ditto for Cyrillic stuff (i.e., testing for 'fikparm.mf').
if {[variant_isset docs]} {
reinplace -W ${worksrcpath} \
{s|\(IMAGEMAGICK.*\), $DOCUMENTATION_REQUIRED|\1, OPTIONAL|g} \
configure.ac
reinplace -W ${worksrcpath} \
{s|\(PDFLATEX.*\), $DOCUMENTATION_REQUIRED|\1, OPTIONAL|g} \
configure.ac
reinplace -W ${worksrcpath} \
{s|if test "$TEX_FIKPARM" = ""|if false|g} \
configure.ac
}
if {${subport} eq ${name}} {
# Currently, +docs only builds the info files. For a complete
# documentation build a texi2html 1.82 bundle is necessary, which
# doesn't exist yet in MacPorts.
if {[variant_isset docs]} {
reinplace -W ${worksrcpath} \
{s|\(TEXI2HTML.*\), $DOCUMENTATION_REQUIRED,|\1, OPTIONAL,|g} \
configure.ac
}
}
}
post-destroot {
move \
${destroot}${prefix}/bin/lilypond \
${destroot}${prefix}/libexec/lilypond-bin
xinstall -m 755 \
${filespath}/lilypond.in \
${destroot}${prefix}/bin/lilypond
reinplace \
"s|@@PREFIX@@|${prefix}|g" \
${destroot}${prefix}/bin/lilypond
}