aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/freetype.rb
blob: e2aa08903ff5bd20393a5af0f7f32c46e08636e7 (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
class Freetype < Formula
  homepage "http://www.freetype.org"
  url "https://downloads.sf.net/project/freetype/freetype2/2.5.5/freetype-2.5.5.tar.bz2"
  mirror "http://download.savannah.gnu.org/releases/freetype/freetype-2.5.5.tar.bz2"
  sha1 "7b7460ef51a8fdb17baae53c6658fc1ad000a1c2"

  bottle do
    cellar :any
    sha1 "f3c9868e2f0cad854d1f24c5dcc98e304ce9c59e" => :yosemite
    sha1 "c2cab6b497af1b07ce940139bb7dec65c8a2117c" => :mavericks
    sha1 "341bb165aa5c67cecace843be154ef71723d6268" => :mountain_lion
  end

  keg_only :provided_pre_mountain_lion

  option :universal
  option "without-subpixel", "Disable sub-pixel rendering (a.k.a. LCD rendering, or ClearType)"

  depends_on "libpng"

  def install
    if build.with? "subpixel"
      inreplace "include/config/ftoption.h",
          "/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */",
          "#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING"
    end

    ENV.universal_binary if build.universal?
    system "./configure", "--prefix=#{prefix}", "--without-harfbuzz"
    system "make"
    system "make", "install"
  end

  test do
    system "#{bin}/freetype-config", "--cflags", "--libs", "--ftversion",
      "--exec-prefix", "--prefix"
  end
end