aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornibbles 2bits2012-05-23 11:25:43 -0700
committerJack Nagel2012-05-24 20:28:41 -0500
commit6a0630ba933dade543cf9ab9ce561c4a2dd7c787 (patch)
treedc6928681d19280cb35e52cf71bd0c6940708330
parent51f85ee8100d9d65200138e91abfe8de89987198 (diff)
downloadhomebrew-6a0630ba933dade543cf9ab9ce561c4a2dd7c787.tar.bz2
weechat: make bindings optional, patch to fix perl
The weechat saga continues... This commit makes all the language modules optional rather than the default. It adds a dep on guile if the user options for that module. It adds a patch from HEAD to fix the perl segfault on exit and a removal comment for 0.3.8. This commit does not patch the ruby-1.9.3+rvm issue other than not building that module by default. Still waiting on the upstream patch. cf. #12377 Closes #12392. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-rw-r--r--Library/Formula/weechat.rb38
1 files changed, 35 insertions, 3 deletions
diff --git a/Library/Formula/weechat.rb b/Library/Formula/weechat.rb
index 109e5a438..faca1b650 100644
--- a/Library/Formula/weechat.rb
+++ b/Library/Formula/weechat.rb
@@ -8,6 +8,23 @@ class Weechat < Formula
depends_on 'cmake' => :build
depends_on 'gettext'
depends_on 'gnutls'
+ depends_on 'guile' if ARGV.include? '--guile'
+
+ # Patch fixes the perl bindings to not segfault on exit. Remove at 0.3.8.
+ # Adapted from the weechat patch which would not apply cleanly.
+ # http://git.savannah.gnu.org/gitweb/?p=weechat.git;a=patch;h=2b26348965941c961f1ad73cfc7c6605be5abf3e
+ def patches
+ DATA
+ end
+
+ def options
+ [
+ ['--perl', 'Build the perl module.'],
+ ['--ruby', 'Build the ruby module.'],
+ ['--guile', 'Build the guile module.'],
+ ['--python', 'Build the python module (requires framework Python).']
+ ]
+ end
def install
# Remove all arch flags from the PERL_*FLAGS as we specify them ourselves.
@@ -24,12 +41,14 @@ class Weechat < Formula
--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?
+ args << '--disable-perl' unless ARGV.include? '--perl'
+ args << '--disable-ruby' unless ARGV.include? '--ruby'
+ args << '--disable-python' unless python_framework? and ARGV.include? '--python'
+ args << '--disable-guile' unless Formula.factory('guile').linked_keg.exist? \
+ and ARGV.include? '--guile'
system './configure', *args
system 'make install'
@@ -52,3 +71,16 @@ class Weechat < Formula
EOS
end
end
+
+__END__
+--- a/src/plugins/scripts/perl/weechat-perl.c 2012-02-20 05:07:35.000000000 -0800
++++ b/src/plugins/scripts/perl/weechat-perl.c 2012-05-23 11:00:10.000000000 -0700
+@@ -1016,7 +1016,7 @@
+ }
+ #endif
+
+-#if defined(PERL_SYS_TERM) && !defined(__FreeBSD__) && !defined(WIN32) && !defined(__CYGWIN__)
++#if defined(PERL_SYS_TERM) && !defined(__FreeBSD__) && !defined(WIN32) && !defined(__CYGWIN__) && !(defined(__APPLE__) && defined(__MACH__))
+ /*
+ * we call this function on all OS, but NOT on FreeBSD or Cygwin,
+ * because it crashes with no reason (bug in Perl?)