2010-01-22 05:13:42 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-03-01 04:36:21 +00:00
|
|
|
class TexInstalled < Requirement
|
|
|
|
def message; <<-EOS.undent
|
|
|
|
A TeX/LaTeX installation is required to install.
|
|
|
|
You can obtain the TeX distribution for Mac OS X from:
|
|
|
|
http://www.tug.org/mactex/
|
2012-08-27 17:26:08 +00:00
|
|
|
After you install it, put its bin in your PATH and open a new Terminal tab.
|
|
|
|
You should also do this because MacTex installs with root ownership:
|
|
|
|
sudo chown -R $USER `brew --prefix`
|
|
|
|
That will change all the files and directories back to being owned by you.
|
2012-03-01 04:36:21 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
def satisfied?
|
|
|
|
which 'mpost'
|
|
|
|
end
|
|
|
|
def fatal?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Lilypond < Formula
|
2010-01-22 05:13:42 +00:00
|
|
|
homepage 'http://lilypond.org/'
|
2012-11-10 16:18:35 +00:00
|
|
|
url 'http://download.linuxaudio.org/lilypond/sources/v2.16/lilypond-2.16.1.tar.gz'
|
|
|
|
sha1 'ce923f27091ec5501df7bcd0596f1ffd7ab9b8b9'
|
2010-01-22 05:13:42 +00:00
|
|
|
|
2012-09-14 16:07:47 +00:00
|
|
|
env :userpaths
|
|
|
|
|
2012-09-16 19:27:59 +00:00
|
|
|
option 'with-doc', "Build documentation in addition to binaries (may require several hours)."
|
|
|
|
|
2012-03-01 04:36:21 +00:00
|
|
|
depends_on TexInstalled.new
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-01-22 05:13:42 +00:00
|
|
|
depends_on 'gettext'
|
|
|
|
depends_on 'pango'
|
2011-03-06 00:20:53 +00:00
|
|
|
depends_on 'guile'
|
|
|
|
depends_on 'ghostscript'
|
2010-01-22 05:13:42 +00:00
|
|
|
depends_on 'mftrace'
|
|
|
|
depends_on 'fontforge'
|
|
|
|
depends_on 'texinfo'
|
2012-08-27 17:26:08 +00:00
|
|
|
depends_on :x11
|
2010-01-22 05:13:42 +00:00
|
|
|
|
2012-09-16 19:27:59 +00:00
|
|
|
# Assert documentation dependencies if requested.
|
|
|
|
if build.include? 'with-doc'
|
|
|
|
depends_on 'netpbm'
|
|
|
|
depends_on 'imagemagick'
|
|
|
|
depends_on 'docbook'
|
2012-11-04 19:11:39 +00:00
|
|
|
depends_on LanguageModuleDependency.new :python, 'dblatex', 'dbtexmf.dblatex'
|
2012-09-16 19:27:59 +00:00
|
|
|
depends_on 'texi2html'
|
|
|
|
end
|
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
skip_clean :all
|
2010-01-22 05:13:42 +00:00
|
|
|
|
2012-08-27 17:26:08 +00:00
|
|
|
fails_with :clang do
|
2012-09-05 17:32:58 +00:00
|
|
|
build 421
|
2012-08-27 17:26:08 +00:00
|
|
|
cause 'Strict C99 compliance error in a pointer conversion.'
|
|
|
|
end
|
|
|
|
|
2010-01-22 05:13:42 +00:00
|
|
|
def install
|
2011-03-06 00:20:53 +00:00
|
|
|
gs = Formula.factory('ghostscript')
|
2012-08-27 17:26:08 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--enable-rpath",
|
2011-03-06 00:20:53 +00:00
|
|
|
"--with-ncsb-dir=#{gs.share}/ghostscript/fonts/"
|
2010-01-22 05:13:42 +00:00
|
|
|
|
|
|
|
# Separate steps to ensure that lilypond's custom fonts are created.
|
2012-08-27 17:26:08 +00:00
|
|
|
system 'make all'
|
2010-01-22 05:13:42 +00:00
|
|
|
system "make install"
|
2012-09-16 19:27:59 +00:00
|
|
|
|
|
|
|
# Build documentation if requested.
|
|
|
|
if build.include? 'with-doc'
|
|
|
|
system "make doc"
|
|
|
|
system "make install-doc"
|
|
|
|
end
|
2010-01-22 05:13:42 +00:00
|
|
|
end
|
2012-08-27 17:26:08 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
mktemp do
|
|
|
|
(Pathname.pwd+'test.ly').write <<-EOS.undent
|
|
|
|
\\version "2.16.0"
|
|
|
|
\\header { title = "Do-Re-Mi" }
|
|
|
|
{ c' d' e' }
|
|
|
|
EOS
|
|
|
|
lilykeg = Formula.factory('lilypond').linked_keg
|
2012-09-02 07:52:38 +00:00
|
|
|
system "#{lilykeg}/bin/lilypond test.ly"
|
2012-08-27 17:26:08 +00:00
|
|
|
end
|
|
|
|
end
|
2010-01-22 05:13:42 +00:00
|
|
|
end
|