blob: e525808442b4d58ee1386acc28acaea78bdb3711 (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  | 
require 'formula'
class EmacsRequirement < Requirement
  fatal true
  satisfy { which('emacs') }
  def message
    "Emacs support requires Emacs to be installed."
  end
end
class Gettext < Formula
  homepage 'http://www.gnu.org/software/gettext/'
  url 'http://ftpmirror.gnu.org/gettext/gettext-0.18.2.tar.gz'
  mirror 'http://ftp.gnu.org/gnu/gettext/gettext-0.18.2.tar.gz'
  sha256 '516a6370b3b3f46e2fc5a5e222ff5ecd76f3089bc956a7587a6e4f89de17714c'
  keg_only "OS X provides the BSD gettext library and some software gets confused if both are in the library path."
  bottle do
   sha1 'f5347eea2def6a8649075fe2ca306ce5fa2a5338' => :mountain_lion
   sha1 '003ba77411550fd471b599c2694bba36d343e98f' => :lion
   sha1 '976ec00f7046b639b8a687b3316a575031859114' => :snow_leopard
  end
  option :universal
  option 'with-emacs', 'Build with emacs support'
  option 'with-examples', 'Keep example files'
  depends_on EmacsRequirement if build.include? "with-emacs"
  def patches
    unless build.include? 'with-examples'
      # Use a MacPorts patch to disable building examples at all,
      # rather than build them and remove them afterwards.
      {:p0 => ['https://trac.macports.org/export/102008/trunk/dports/devel/gettext/files/patch-gettext-tools-Makefile.in']}
    end
  end
  def install
    ENV.libxml2
    ENV.universal_binary if build.universal?
    args = ["--disable-dependency-tracking",
            "--disable-debug",
            "--prefix=#{prefix}",
            "--with-included-gettext",
            "--with-included-glib",
            "--with-included-libcroco",
            "--with-included-libunistring",
            # Don't use VCS systems to create these archives
            "--without-git",
            "--without-cvs"]
    if build.include? "with-emacs"
      args << "--with-emacs"
    else
      args << "--without-emacs"
    end
    system "./configure", *args
    system "make"
    ENV.deparallelize # install doesn't support multiple make jobs
    system "make install"
  end
end
  |