Skip to content

Instantly share code, notes, and snippets.

@geoffgarside
Created December 1, 2016 13:25
Show Gist options
  • Save geoffgarside/993cc9581d3b91322a779e381fa74c22 to your computer and use it in GitHub Desktop.
Save geoffgarside/993cc9581d3b91322a779e381fa74c22 to your computer and use it in GitHub Desktop.
Sphinx v2.0.6 legacy brew formula
class SphinxAT206 < Formula
homepage 'http://www.sphinxsearch.com'
url 'http://sphinxsearch.com/files/sphinx-2.0.6-release.tar.gz'
sha256 'de943c397efda706661b3a12e12e9f8cc8a03bf6c02c5a6ba967a06384feede2'
head 'http://sphinxsearch.googlecode.com/svn/trunk/'
option 'mysql', 'Force compiling against MySQL'
option 'pgsql', 'Force compiling against PostgreSQL'
option 'id64', 'Force compiling with 64-bit ID support'
depends_on :mysql if build.include? 'mysql'
depends_on :postgresql if build.include? 'pgsql'
fails_with :llvm do
build 2334
cause "ld: rel32 out of range in _GetPrivateProfileString from /usr/lib/libodbc.a(SQLGetPrivateProfileString.o)"
end
fails_with :clang do
build 421
cause <<-EOS.undent
sphinxexpr.cpp:1802:11: error: use of undeclared identifier 'ExprEval'
EOS
end
keg_only <<-EOM
This is a legacy build of Sphinx which is no longer up to date with the current
version of this software. This version is available in order to enable testing
with the currently deployed version of the Sphinx searchd software.
To use it with your config/sphinx.yml add
bin_path: /usr/local/Cellar/sphinx@2.0.6/2.0.6/bin
EOM
resource 'stemmer' do
url 'https://github.com/snowballstem/snowball.git',
:revision => '4bc4455194b22c67645a3ae8e8bddec5f9f5f12c'
end
def install
resource('stemmer').stage do
system 'make', 'dist_libstemmer_c'
system 'tar', 'xzf', 'dist/libstemmer_c.tgz', "-C", buildpath
end
args = %W[--prefix=#{prefix}
--disable-dependency-tracking
--localstatedir=#{var}
--with-libstemmer]
args << "--enable-id64" if build.include? 'id64'
%w{mysql pgsql}.each do |db|
if build.include? db
args << "--with-#{db}"
else
args << "--without-#{db}"
end
end
system "./configure", *args
system "make install"
end
def caveats; <<-EOS.undent
Sphinx has been compiled with libstemmer support.
Sphinx depends on either MySQL or PostreSQL as a datasource.
You can install these with Homebrew with:
brew install mysql
For MySQL server.
brew install mysql-connector-c
For MySQL client libraries only.
brew install postgresql
For PostgreSQL server.
We don't install these for you when you install this formula, as
we don't know which datasource you intend to use.
EOS
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment