aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sqlcipher.rb
blob: 9936e5277fe5d49002e4dc01064dc3da14c69014 (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
require "formula"

class Sqlcipher < Formula
  homepage "http://sqlcipher.net"
  url "https://github.com/sqlcipher/sqlcipher/archive/v3.1.0.tar.gz"
  sha1 "350a7cbc01690825cb6beca3b9bf6943f71a52de"

  head "https://github.com/sqlcipher/sqlcipher.git"

  option "with-fts", "Build with full-text search enabled"

  depends_on "openssl"

  def install

    args = %W[
      --prefix=#{prefix}
      --enable-tempstore=yes
      --with-crypto-lib=#{Formula["openssl"].opt_prefix}
      --disable-tcl
    ]

    if build.with?("fts")
      args << "CFLAGS=-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3"
    else
      args << "CFLAGS=-DSQLITE_HAS_CODEC"
    end

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