aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/jstalk.rb
blob: 7b9fce72b5b1e4f8711374f0ee06b452652df086 (plain)
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
require 'formula'

class NeedsSnowLeopard < Requirement
  satisfy MacOS.version >= :snow_leopard

  def message
    "jstalk requires Mac OS X 10.6 or newer"
  end
end

class Jstalk < Formula
  homepage 'http://jstalk.org/'
  url 'https://github.com/ccgus/jstalk.git', :tag => "v1.0.1"
  version '1.0.1'

  depends_on NeedsSnowLeopard.new
  depends_on :xcode # For working xcodebuild.

  def install
    ["JSTalk Framework", "jstalk command line", "JSTalk Editor"].each do |t|
      system "xcodebuild", "-target", t, "-configuration", "Release", "ONLY_ACTIVE_ARCH=YES", "SYMROOT=build"
    end

    cd 'build/Release' do
      bin.install 'jstalk'
      prefix.install "JSTalk Editor.app"
      (prefix+'Frameworks').install 'JSTalk.framework'
    end
  end

  def caveats; <<-EOS.undent
     Framework JSTalk was installed to:
       #{prefix}/Frameworks/JSTalk.framework

     You may want to symlink this Framework to a standard OS X location,
     such as:
       mkdir ~/Frameworks
       ln -s "#{prefix}/Frameworks/JSTalk.framework" ~/Frameworks

    JSTalk Editor.app was installed in:
      #{prefix}

    To symlink into ~/Applications, you can do:
      brew linkapps
    EOS
  end
end