2010-08-06 22:24:20 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Nu < Formula
|
2010-08-06 22:24:20 +00:00
|
|
|
homepage 'http://programming.nu'
|
2012-01-11 17:38:23 +00:00
|
|
|
url 'http://programming.nu/releases/Nu-2.0.1.tgz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 'c0735f8f3daec9471b849f8e96827b5eef0ec44e'
|
2010-08-06 22:24:20 +00:00
|
|
|
|
2013-06-18 15:09:22 +00:00
|
|
|
depends_on :macos => :lion
|
2010-08-06 22:24:20 +00:00
|
|
|
depends_on 'pcre'
|
|
|
|
|
2013-02-03 18:51:20 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2336
|
|
|
|
cause 'nu only builds with clang'
|
|
|
|
end
|
|
|
|
|
|
|
|
fails_with :gcc do
|
|
|
|
build 5666
|
|
|
|
cause 'nu only builds with clang'
|
|
|
|
end
|
|
|
|
|
2010-08-06 22:24:20 +00:00
|
|
|
def install
|
2012-01-11 17:38:23 +00:00
|
|
|
|
2010-09-07 21:34:39 +00:00
|
|
|
ENV['PREFIX'] = prefix
|
|
|
|
|
2010-08-06 22:24:20 +00:00
|
|
|
inreplace "Makefile" do |s|
|
|
|
|
cflags = s.get_make_var "CFLAGS"
|
2013-06-24 03:50:03 +00:00
|
|
|
s.change_make_var! "CFLAGS", "#{cflags} #{ENV.cppflags}"
|
2013-02-03 18:51:20 +00:00
|
|
|
# nu hardcodes its compiler paths to a location which no longer works
|
|
|
|
# This should work for both Xcode-only and CLT-only systems
|
|
|
|
s.gsub! "$(DEVROOT)/usr/bin/clang", ENV.cc
|
2010-08-06 22:24:20 +00:00
|
|
|
end
|
2010-09-07 21:34:39 +00:00
|
|
|
|
2010-08-06 22:24:20 +00:00
|
|
|
inreplace "Nukefile" do |s|
|
2013-02-03 18:51:20 +00:00
|
|
|
s.gsub!'"#{DEVROOT}/usr/bin/clang"', "\"#{ENV.cc}\""
|
2010-08-06 22:24:20 +00:00
|
|
|
case Hardware.cpu_type
|
|
|
|
when :intel
|
|
|
|
arch = :i386
|
|
|
|
when :ppc
|
|
|
|
arch = :ppc
|
|
|
|
end
|
|
|
|
arch = :x86_64 if arch == :i386 && Hardware.is_64_bit?
|
|
|
|
s.sub!(/^;;\(set @arch '\("i386"\)\)$/, "(set @arch '(\"#{arch}\"))") unless arch.nil?
|
|
|
|
s.gsub!('(SH "sudo ', '(SH "') # don't use sudo to install
|
2013-05-03 18:43:13 +00:00
|
|
|
s.gsub!('#{@destdir}/Library/Frameworks', '#{@prefix}/Library/Frameworks')
|
2010-08-06 22:24:20 +00:00
|
|
|
s.sub! /^;; source files$/, <<-EOS
|
|
|
|
;; source files
|
2013-05-03 16:28:45 +00:00
|
|
|
(set @framework_install_path "#{frameworks}")
|
2010-08-06 22:24:20 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
system "make"
|
|
|
|
system "./mininush", "tools/nuke"
|
|
|
|
bin.mkdir
|
|
|
|
lib.mkdir
|
|
|
|
include.mkdir
|
|
|
|
system "./mininush", "tools/nuke", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
2013-05-03 16:28:45 +00:00
|
|
|
if self.installed? and File.exists? frameworks+"Nu.framework"
|
2010-08-06 22:24:20 +00:00
|
|
|
return <<-EOS.undent
|
|
|
|
Nu.framework was installed to:
|
2013-05-03 16:28:45 +00:00
|
|
|
#{frameworks}/Nu.framework
|
2010-08-06 22:24:20 +00:00
|
|
|
|
|
|
|
You may want to symlink this Framework to a standard OS X location,
|
|
|
|
such as:
|
2013-05-03 16:28:45 +00:00
|
|
|
ln -s "#{frameworks}/Nu.framework" /Library/Frameworks
|
2010-08-06 22:24:20 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
return nil
|
|
|
|
end
|
|
|
|
end
|