aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/kyoto-tycoon.rb
blob: d5914531bd401a7de42b945f351f9ece536c1cc2 (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
require 'formula'

class KyotoTycoon < Formula
  homepage 'http://fallabs.com/kyototycoon/'
  url 'http://fallabs.com/kyototycoon/pkg/kyototycoon-0.9.56.tar.gz'
  sha1 'e5433833e681f8755ff6b9f7209029ec23914ce6'

  option "no-lua", "Disable Lua support"

  depends_on 'lua' unless build.include? "no-lua"
  depends_on 'kyoto-cabinet'

  patch :DATA if MacOS.version >= :mavericks

  def install
    # Locate kyoto-cabinet for non-/usr/local builds
    cabinet = Formula["kyoto-cabinet"].opt_prefix
    args = ["--prefix=#{prefix}", "--with-kc=#{cabinet}"]
    args << "--enable-lua" unless build.include? "no-lua"

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


__END__
--- a/ktdbext.h  2013-11-08 09:34:53.000000000 -0500
+++ b/ktdbext.h  2013-11-08 09:35:00.000000000 -0500
@@ -271,7 +271,7 @@
       if (!logf("prepare", "started to open temporary databases under %s", tmppath.c_str()))
         err = true;
       stime = kc::time();
-      uint32_t pid = getpid() & kc::UINT16MAX;
+      uint32_t pid = kc::getpid() & kc::UINT16MAX;
       uint32_t tid = kc::Thread::hash() & kc::UINT16MAX;
       uint32_t ts = kc::time() * 1000;
       for (size_t i = 0; i < dbnum_; i++) {