2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-17 18:41:05 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Weechat < Formula
|
2010-02-08 12:18:02 +00:00
|
|
|
homepage 'http://www.weechat.org'
|
2012-03-12 20:48:41 +00:00
|
|
|
url 'http://www.weechat.org/files/src/weechat-0.3.7.tar.bz2'
|
|
|
|
md5 '62bb5002b2ba9e5816dfeededc3fa276'
|
2012-01-22 22:43:32 +00:00
|
|
|
|
|
|
|
head 'git://git.sv.gnu.org/weechat.git'
|
2009-09-17 18:41:05 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'cmake' => :build
|
2009-09-18 13:38:43 +00:00
|
|
|
depends_on 'gnutls'
|
2009-09-17 18:41:05 +00:00
|
|
|
|
2012-02-29 01:58:59 +00:00
|
|
|
def options
|
|
|
|
[
|
|
|
|
["--enable-ruby", "Enable Ruby module"],
|
|
|
|
["--enable-perl", "Enable Perl module"],
|
|
|
|
["--enable-python", "Enable Python module"],
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2009-09-17 18:41:05 +00:00
|
|
|
def install
|
2010-08-08 20:51:00 +00:00
|
|
|
# Remove all arch flags from the PERL_*FLAGS as we specify them ourselves.
|
2012-01-22 22:43:32 +00:00
|
|
|
# This messes up because the system perl is a fat binary with 32, 64 and PPC
|
2010-08-08 20:51:00 +00:00
|
|
|
# compiles, but our deps don't have that.
|
2012-01-22 22:43:32 +00:00
|
|
|
archs = ['-arch ppc', '-arch i386', '-arch x86_64'].join('|')
|
|
|
|
|
2010-08-08 20:51:00 +00:00
|
|
|
inreplace "src/plugins/scripts/perl/CMakeLists.txt",
|
|
|
|
'IF(PERL_FOUND)',
|
|
|
|
'IF(PERL_FOUND)' +
|
2012-01-22 22:43:32 +00:00
|
|
|
%Q{\n STRING(REGEX REPLACE "#{archs}" "" PERL_CFLAGS "${PERL_CFLAGS}")} +
|
|
|
|
%Q{\n STRING(REGEX REPLACE "#{archs}" "" PERL_LFLAGS "${PERL_LFLAGS}")}
|
2010-08-08 20:51:00 +00:00
|
|
|
|
2012-02-29 01:58:59 +00:00
|
|
|
args = []
|
|
|
|
|
|
|
|
if ARGV.include? "--enable-ruby"
|
|
|
|
args << "-DENABLE_RUBY=ON"
|
|
|
|
else
|
|
|
|
args << "-DENABLE_RUBY=OFF"
|
|
|
|
end
|
|
|
|
|
|
|
|
if ARGV.include? "--enable-perl"
|
|
|
|
args << "-DENABLE_PERL=ON"
|
|
|
|
else
|
|
|
|
args << "-DENABLE_PERL=OFF"
|
|
|
|
end
|
|
|
|
|
|
|
|
if ARGV.include? "--enable-python"
|
|
|
|
args << "-DENABLE_PYTHON=ON"
|
|
|
|
else
|
|
|
|
args << "-DENABLE_PYTHON=OFF"
|
|
|
|
end
|
|
|
|
|
2012-01-22 22:43:32 +00:00
|
|
|
# -DPREFIX has to be specified because weechat devs enjoy being non-standard
|
2010-04-07 05:58:35 +00:00
|
|
|
system "cmake", "-DPREFIX=#{prefix}",
|
2012-02-29 01:58:59 +00:00
|
|
|
args.join(" "),
|
2012-02-22 05:12:27 +00:00
|
|
|
std_cmake_parameters,
|
|
|
|
"."
|
2009-09-17 18:41:05 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|