Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
weechat: options to enable script language plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information
kyanny authored and adamv committed Mar 14, 2012
1 parent b933aab commit 266e230
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions Library/Formula/weechat.rb
Expand Up @@ -10,6 +10,14 @@ class Weechat < Formula
depends_on 'cmake' => :build
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
Expand All @@ -22,12 +30,29 @@ def install
%Q{\n STRING(REGEX REPLACE "#{archs}" "" PERL_CFLAGS "${PERL_CFLAGS}")} +
%Q{\n STRING(REGEX REPLACE "#{archs}" "" PERL_LFLAGS "${PERL_LFLAGS}")}

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

# -DPREFIX has to be specified because weechat devs enjoy being non-standard
# Compiling langauge module doesn't work. Feel free to add options to enable these.
system "cmake", "-DPREFIX=#{prefix}",
"-DENABLE_RUBY=OFF",
"-DENABLE_PERL=OFF",
"-DENABLE_PYTHON=OFF",
args.join(" "),
std_cmake_parameters,
"."
system "make install"
Expand Down

1 comment on commit 266e230

@Sembei
Copy link

@Sembei Sembei commented on 266e230 Apr 7, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl compilation problem is fixed on 0.3.8-dev
http://git.savannah.gnu.org/gitweb/?p=weechat.git;a=commitdiff;h=7682a1a

Please sign in to comment.