forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnu0.rb
57 lines (50 loc) · 1.64 KB
/
nu0.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
class Nu0 < Formula
desc "Object-oriented, Lisp-like programming language"
homepage "http://programming.nu"
# Upstream link used previously is dead - Using MacPorts mirror instead.
url "https://distfiles.macports.org/nu/Nu-0.4.0.tgz"
sha256 "4fb346c4ce938b987faf4591f7a71b6d482ee622fa597a4572c5d573a6f022d1"
depends_on "pcre"
depends_on MaximumMacOSRequirement => :lion
def install
ENV["PREFIX"] = prefix
inreplace "Makefile" do |s|
cflags = s.get_make_var "CFLAGS"
s.change_make_var! "CFLAGS", "#{cflags} #{ENV["CPPFLAGS"]}"
end
inreplace "Nukefile" do |s|
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
s.gsub!('#{@destdir}/Library/Frameworks', '#{@prefix}/Library/Frameworks')
s.sub! /^;; source files$/, <<-EOS
;; source files
(set @framework_install_path "#{frameworks}")
EOS
end
system "make"
system "./mininush", "tools/nuke"
bin.mkdir
lib.mkdir
include.mkdir
system "./mininush", "tools/nuke", "install"
end
def caveats
if self.installed? and File.exist? frameworks+"Nu.framework"
return <<-EOS.undent
Nu.framework was installed to:
#{frameworks}/Nu.framework
You may want to symlink this Framework to a standard OS X location,
such as:
ln -s "#{frameworks}/Nu.framework" /Library/Frameworks
EOS
end
return nil
end
end