diff options
| -rw-r--r-- | Library/Formula/weechat.rb | 60 |
1 files changed, 27 insertions, 33 deletions
diff --git a/Library/Formula/weechat.rb b/Library/Formula/weechat.rb index 7cb070b79..109e5a438 100644 --- a/Library/Formula/weechat.rb +++ b/Library/Formula/weechat.rb @@ -5,56 +5,50 @@ class Weechat < Formula url 'http://www.weechat.org/files/src/weechat-0.3.7.tar.bz2' md5 '62bb5002b2ba9e5816dfeededc3fa276' - head 'git://git.sv.gnu.org/weechat.git' - depends_on 'cmake' => :build + depends_on 'gettext' depends_on 'gnutls' - def options - [ - ["--enable-ruby", "Enable Ruby module"], - ["--enable-perl", "Enable Perl module"], - ["--enable-python", "Enable Python module"], - ] - end - def install # Remove all arch flags from the PERL_*FLAGS as we specify them ourselves. # This messes up because the system perl is a fat binary with 32, 64 and PPC - # compiles, but our deps don't have that. + # compiles, but our deps don't have that. Remove at v0.3.8, fixed in HEAD. archs = ['-arch ppc', '-arch i386', '-arch x86_64'].join('|') - inreplace "src/plugins/scripts/perl/CMakeLists.txt", 'IF(PERL_FOUND)', 'IF(PERL_FOUND)' + %Q{\n STRING(REGEX REPLACE "#{archs}" "" PERL_CFLAGS "${PERL_CFLAGS}")} + %Q{\n STRING(REGEX REPLACE "#{archs}" "" PERL_LFLAGS "${PERL_LFLAGS}")} - args = [] + args = %W[ + --prefix=#{prefix} + --disable-dependency-tracking + --disable-aspell + --disable-perl + --disable-static + --with-debug=0 + ] + args << '--disable-python' unless python_framework? + args << '--disable-guile' unless Formula.factory('guile').linked_keg.exist? - if ARGV.include? "--enable-ruby" - args << "-DENABLE_RUBY=ON" - else - args << "-DENABLE_RUBY=OFF" - end + system './configure', *args + system 'make install' - if ARGV.include? "--enable-perl" - args << "-DENABLE_PERL=ON" - else - args << "-DENABLE_PERL=OFF" + # Remove the duplicates to stop error messages when running weechat. + Dir["#{lib}/weechat/plugins/*"].each do |f| + rm f if File.symlink? f end + end - if ARGV.include? "--enable-python" - args << "-DENABLE_PYTHON=ON" - else - args << "-DENABLE_PYTHON=OFF" - end + def python_framework? + # True if Python was compiled as a framework. + python_prefix = `python-config --prefix`.strip + File.exist? "#{python_prefix}/Python" + end - # -DPREFIX has to be specified because weechat devs enjoy being non-standard - system "cmake", "-DPREFIX=#{prefix}", - args.join(" "), - std_cmake_parameters, - "." - system "make install" + def caveats; <<-EOS.undent + Weechat will only build the Python plugin if Python is compiled as + a framework (system Python or 'brew install --framework python'). + EOS end end |
