aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libmemcached.rb
blob: 4533f6554fc1db3c3840e6d5e44317703e4535d3 (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
require 'formula'

class Libmemcached < Formula
  homepage 'http://libmemcached.org'
  url 'https://launchpad.net/libmemcached/1.0/1.0.17/+download/libmemcached-1.0.17.tar.gz'
  sha1 '1023bc8c738b1f5b8ea2cd16d709ec6b47c3efa8'

  option "with-sasl", "Build with sasl support"

  if build.with? "sasl"
    depends_on "memcached" => "enable-sasl"
  else
    depends_on "memcached"
  end

  def install
    ENV.append_to_cflags "-undefined dynamic_lookup" if MacOS.version <= :leopard

    args = ["--prefix=#{prefix}"]

    if build.with? "sasl"
      args << "--with-memcached-sasl=#{Formula.factory("memcached").bin}/memcached"
    end

    system "./configure", *args
    system "make install"
  end

  def patches
    if MacOS.version >= :mavericks and ENV.compiler == :clang
      # build fix for tr1 -> std
      DATA
    end
  end

end

__END__
diff --git a/libmemcached-1.0/memcached.h b/libmemcached-1.0/memcached.h
index 3c11f61..dcee395 100644
--- a/libmemcached-1.0/memcached.h
+++ b/libmemcached-1.0/memcached.h
@@ -43,7 +43,11 @@
 #endif

 #ifdef __cplusplus
+#ifdef _LIBCPP_VERSION
+#  include <cinttypes>
+#else
 #  include <tr1/cinttypes>
+#endif
 #  include <cstddef>
 #  include <cstdlib>
 #else