homebrew-core/Formula/weechat.rb

87 lines
3 KiB
Ruby
Raw Normal View History

require 'formula'
2009-09-17 18:41:05 +00:00
2011-03-10 05:11:03 +00:00
class Weechat < Formula
homepage 'http://www.weechat.org'
url 'http://www.weechat.org/files/src/weechat-0.3.7.tar.bz2'
md5 '62bb5002b2ba9e5816dfeededc3fa276'
depends_on 'cmake' => :build
weechat: switch from cmake to configure * Switch to using `configure` * Remove `head` because it requires gtk. * Add a build time dep on gettext, otherwise link errors. * Add `--disable-perl` to stop segfault on program exit. * Add `--disable-aspell` which is still being reviewed. * Add `--disable-static` to stop building duplicate plugins. * Add `--disable-python` unless Python is a framework. * Note that the one `inreplace` is fixed in HEAD. * Delete the plugin symlinks to stop runtime warnings. Weechat-0.3.7 can be built using cmake or configure, but their cmake build scripts are prone to errors when building the ruby bindings. By switching to `configure` the formula is greatly simplified, and all the plugins it creates get neatly installed into lib+'weechat/plugins' automatically. Weechat `head` builds require `gtk` even if the `gtk` gui is not enabled, which it isn't because it's b0rked. So remove head. Weechat comes with an internal gettext and libintl that cause errors when linking. So add a dep on Homebrew's gettext. As reported by another user and confirmed through gdb, the perl plugin causes a segfault on exit. So disable building that. Aspell is still under construction in Homebrew, and weechat will compile that plug by default. So disable aspell for now. Disable the static plugins and delete the plugin symlinks. That leaves only one `.so` for each plugin and stops a dozen warnings when running weechat about _can't load duplicate plugins._ Disable building the Python plugin unless Python is a framework because it will build but fail to load the plugin with an error that it can't dlopen a module expected in flat namespace. Even if we add a dep on Homebrew/dupes/ncurses to get the wide variety of it, that formula doesn't actually create `-lnursesw`. So that is not added, because it can't be found. The gtk interface to weechat is not added as a user option because it runs but doesn't make a useable gui. It's blank & unresponsive. Weechat compiles, runs, and connects to freenode without error using clang and llvm on Lion, tested against system Ruby, system Python, and Homebrew Python frameworks. Fixes Homebrew/homebrew#11289. Fixes Homebrew/homebrew#11835. Fixes Homebrew/homebrew#12066. Closes Homebrew/homebrew#12193. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-10 19:38:26 +00:00
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
2009-09-17 18:41:05 +00:00
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
weechat: switch from cmake to configure * Switch to using `configure` * Remove `head` because it requires gtk. * Add a build time dep on gettext, otherwise link errors. * Add `--disable-perl` to stop segfault on program exit. * Add `--disable-aspell` which is still being reviewed. * Add `--disable-static` to stop building duplicate plugins. * Add `--disable-python` unless Python is a framework. * Note that the one `inreplace` is fixed in HEAD. * Delete the plugin symlinks to stop runtime warnings. Weechat-0.3.7 can be built using cmake or configure, but their cmake build scripts are prone to errors when building the ruby bindings. By switching to `configure` the formula is greatly simplified, and all the plugins it creates get neatly installed into lib+'weechat/plugins' automatically. Weechat `head` builds require `gtk` even if the `gtk` gui is not enabled, which it isn't because it's b0rked. So remove head. Weechat comes with an internal gettext and libintl that cause errors when linking. So add a dep on Homebrew's gettext. As reported by another user and confirmed through gdb, the perl plugin causes a segfault on exit. So disable building that. Aspell is still under construction in Homebrew, and weechat will compile that plug by default. So disable aspell for now. Disable the static plugins and delete the plugin symlinks. That leaves only one `.so` for each plugin and stops a dozen warnings when running weechat about _can't load duplicate plugins._ Disable building the Python plugin unless Python is a framework because it will build but fail to load the plugin with an error that it can't dlopen a module expected in flat namespace. Even if we add a dep on Homebrew/dupes/ncurses to get the wide variety of it, that formula doesn't actually create `-lnursesw`. So that is not added, because it can't be found. The gtk interface to weechat is not added as a user option because it runs but doesn't make a useable gui. It's blank & unresponsive. Weechat compiles, runs, and connects to freenode without error using clang and llvm on Lion, tested against system Ruby, system Python, and Homebrew Python frameworks. Fixes Homebrew/homebrew#11289. Fixes Homebrew/homebrew#11835. Fixes Homebrew/homebrew#12066. Closes Homebrew/homebrew#12193. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-10 19:38:26 +00:00
# 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}")}
weechat: switch from cmake to configure * Switch to using `configure` * Remove `head` because it requires gtk. * Add a build time dep on gettext, otherwise link errors. * Add `--disable-perl` to stop segfault on program exit. * Add `--disable-aspell` which is still being reviewed. * Add `--disable-static` to stop building duplicate plugins. * Add `--disable-python` unless Python is a framework. * Note that the one `inreplace` is fixed in HEAD. * Delete the plugin symlinks to stop runtime warnings. Weechat-0.3.7 can be built using cmake or configure, but their cmake build scripts are prone to errors when building the ruby bindings. By switching to `configure` the formula is greatly simplified, and all the plugins it creates get neatly installed into lib+'weechat/plugins' automatically. Weechat `head` builds require `gtk` even if the `gtk` gui is not enabled, which it isn't because it's b0rked. So remove head. Weechat comes with an internal gettext and libintl that cause errors when linking. So add a dep on Homebrew's gettext. As reported by another user and confirmed through gdb, the perl plugin causes a segfault on exit. So disable building that. Aspell is still under construction in Homebrew, and weechat will compile that plug by default. So disable aspell for now. Disable the static plugins and delete the plugin symlinks. That leaves only one `.so` for each plugin and stops a dozen warnings when running weechat about _can't load duplicate plugins._ Disable building the Python plugin unless Python is a framework because it will build but fail to load the plugin with an error that it can't dlopen a module expected in flat namespace. Even if we add a dep on Homebrew/dupes/ncurses to get the wide variety of it, that formula doesn't actually create `-lnursesw`. So that is not added, because it can't be found. The gtk interface to weechat is not added as a user option because it runs but doesn't make a useable gui. It's blank & unresponsive. Weechat compiles, runs, and connects to freenode without error using clang and llvm on Lion, tested against system Ruby, system Python, and Homebrew Python frameworks. Fixes Homebrew/homebrew#11289. Fixes Homebrew/homebrew#11835. Fixes Homebrew/homebrew#12066. Closes Homebrew/homebrew#12193. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-10 19:38:26 +00:00
args = %W[
--prefix=#{prefix}
--disable-dependency-tracking
--disable-aspell
--disable-static
--with-debug=0
]
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'
weechat: switch from cmake to configure * Switch to using `configure` * Remove `head` because it requires gtk. * Add a build time dep on gettext, otherwise link errors. * Add `--disable-perl` to stop segfault on program exit. * Add `--disable-aspell` which is still being reviewed. * Add `--disable-static` to stop building duplicate plugins. * Add `--disable-python` unless Python is a framework. * Note that the one `inreplace` is fixed in HEAD. * Delete the plugin symlinks to stop runtime warnings. Weechat-0.3.7 can be built using cmake or configure, but their cmake build scripts are prone to errors when building the ruby bindings. By switching to `configure` the formula is greatly simplified, and all the plugins it creates get neatly installed into lib+'weechat/plugins' automatically. Weechat `head` builds require `gtk` even if the `gtk` gui is not enabled, which it isn't because it's b0rked. So remove head. Weechat comes with an internal gettext and libintl that cause errors when linking. So add a dep on Homebrew's gettext. As reported by another user and confirmed through gdb, the perl plugin causes a segfault on exit. So disable building that. Aspell is still under construction in Homebrew, and weechat will compile that plug by default. So disable aspell for now. Disable the static plugins and delete the plugin symlinks. That leaves only one `.so` for each plugin and stops a dozen warnings when running weechat about _can't load duplicate plugins._ Disable building the Python plugin unless Python is a framework because it will build but fail to load the plugin with an error that it can't dlopen a module expected in flat namespace. Even if we add a dep on Homebrew/dupes/ncurses to get the wide variety of it, that formula doesn't actually create `-lnursesw`. So that is not added, because it can't be found. The gtk interface to weechat is not added as a user option because it runs but doesn't make a useable gui. It's blank & unresponsive. Weechat compiles, runs, and connects to freenode without error using clang and llvm on Lion, tested against system Ruby, system Python, and Homebrew Python frameworks. Fixes Homebrew/homebrew#11289. Fixes Homebrew/homebrew#11835. Fixes Homebrew/homebrew#12066. Closes Homebrew/homebrew#12193. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-10 19:38:26 +00:00
system './configure', *args
system 'make install'
weechat: switch from cmake to configure * Switch to using `configure` * Remove `head` because it requires gtk. * Add a build time dep on gettext, otherwise link errors. * Add `--disable-perl` to stop segfault on program exit. * Add `--disable-aspell` which is still being reviewed. * Add `--disable-static` to stop building duplicate plugins. * Add `--disable-python` unless Python is a framework. * Note that the one `inreplace` is fixed in HEAD. * Delete the plugin symlinks to stop runtime warnings. Weechat-0.3.7 can be built using cmake or configure, but their cmake build scripts are prone to errors when building the ruby bindings. By switching to `configure` the formula is greatly simplified, and all the plugins it creates get neatly installed into lib+'weechat/plugins' automatically. Weechat `head` builds require `gtk` even if the `gtk` gui is not enabled, which it isn't because it's b0rked. So remove head. Weechat comes with an internal gettext and libintl that cause errors when linking. So add a dep on Homebrew's gettext. As reported by another user and confirmed through gdb, the perl plugin causes a segfault on exit. So disable building that. Aspell is still under construction in Homebrew, and weechat will compile that plug by default. So disable aspell for now. Disable the static plugins and delete the plugin symlinks. That leaves only one `.so` for each plugin and stops a dozen warnings when running weechat about _can't load duplicate plugins._ Disable building the Python plugin unless Python is a framework because it will build but fail to load the plugin with an error that it can't dlopen a module expected in flat namespace. Even if we add a dep on Homebrew/dupes/ncurses to get the wide variety of it, that formula doesn't actually create `-lnursesw`. So that is not added, because it can't be found. The gtk interface to weechat is not added as a user option because it runs but doesn't make a useable gui. It's blank & unresponsive. Weechat compiles, runs, and connects to freenode without error using clang and llvm on Lion, tested against system Ruby, system Python, and Homebrew Python frameworks. Fixes Homebrew/homebrew#11289. Fixes Homebrew/homebrew#11835. Fixes Homebrew/homebrew#12066. Closes Homebrew/homebrew#12193. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-10 19:38:26 +00:00
# Remove the duplicates to stop error messages when running weechat.
Dir["#{lib}/weechat/plugins/*"].each do |f|
rm f if File.symlink? f
end
weechat: switch from cmake to configure * Switch to using `configure` * Remove `head` because it requires gtk. * Add a build time dep on gettext, otherwise link errors. * Add `--disable-perl` to stop segfault on program exit. * Add `--disable-aspell` which is still being reviewed. * Add `--disable-static` to stop building duplicate plugins. * Add `--disable-python` unless Python is a framework. * Note that the one `inreplace` is fixed in HEAD. * Delete the plugin symlinks to stop runtime warnings. Weechat-0.3.7 can be built using cmake or configure, but their cmake build scripts are prone to errors when building the ruby bindings. By switching to `configure` the formula is greatly simplified, and all the plugins it creates get neatly installed into lib+'weechat/plugins' automatically. Weechat `head` builds require `gtk` even if the `gtk` gui is not enabled, which it isn't because it's b0rked. So remove head. Weechat comes with an internal gettext and libintl that cause errors when linking. So add a dep on Homebrew's gettext. As reported by another user and confirmed through gdb, the perl plugin causes a segfault on exit. So disable building that. Aspell is still under construction in Homebrew, and weechat will compile that plug by default. So disable aspell for now. Disable the static plugins and delete the plugin symlinks. That leaves only one `.so` for each plugin and stops a dozen warnings when running weechat about _can't load duplicate plugins._ Disable building the Python plugin unless Python is a framework because it will build but fail to load the plugin with an error that it can't dlopen a module expected in flat namespace. Even if we add a dep on Homebrew/dupes/ncurses to get the wide variety of it, that formula doesn't actually create `-lnursesw`. So that is not added, because it can't be found. The gtk interface to weechat is not added as a user option because it runs but doesn't make a useable gui. It's blank & unresponsive. Weechat compiles, runs, and connects to freenode without error using clang and llvm on Lion, tested against system Ruby, system Python, and Homebrew Python frameworks. Fixes Homebrew/homebrew#11289. Fixes Homebrew/homebrew#11835. Fixes Homebrew/homebrew#12066. Closes Homebrew/homebrew#12193. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-10 19:38:26 +00:00
end
weechat: switch from cmake to configure * Switch to using `configure` * Remove `head` because it requires gtk. * Add a build time dep on gettext, otherwise link errors. * Add `--disable-perl` to stop segfault on program exit. * Add `--disable-aspell` which is still being reviewed. * Add `--disable-static` to stop building duplicate plugins. * Add `--disable-python` unless Python is a framework. * Note that the one `inreplace` is fixed in HEAD. * Delete the plugin symlinks to stop runtime warnings. Weechat-0.3.7 can be built using cmake or configure, but their cmake build scripts are prone to errors when building the ruby bindings. By switching to `configure` the formula is greatly simplified, and all the plugins it creates get neatly installed into lib+'weechat/plugins' automatically. Weechat `head` builds require `gtk` even if the `gtk` gui is not enabled, which it isn't because it's b0rked. So remove head. Weechat comes with an internal gettext and libintl that cause errors when linking. So add a dep on Homebrew's gettext. As reported by another user and confirmed through gdb, the perl plugin causes a segfault on exit. So disable building that. Aspell is still under construction in Homebrew, and weechat will compile that plug by default. So disable aspell for now. Disable the static plugins and delete the plugin symlinks. That leaves only one `.so` for each plugin and stops a dozen warnings when running weechat about _can't load duplicate plugins._ Disable building the Python plugin unless Python is a framework because it will build but fail to load the plugin with an error that it can't dlopen a module expected in flat namespace. Even if we add a dep on Homebrew/dupes/ncurses to get the wide variety of it, that formula doesn't actually create `-lnursesw`. So that is not added, because it can't be found. The gtk interface to weechat is not added as a user option because it runs but doesn't make a useable gui. It's blank & unresponsive. Weechat compiles, runs, and connects to freenode without error using clang and llvm on Lion, tested against system Ruby, system Python, and Homebrew Python frameworks. Fixes Homebrew/homebrew#11289. Fixes Homebrew/homebrew#11835. Fixes Homebrew/homebrew#12066. Closes Homebrew/homebrew#12193. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-10 19:38:26 +00:00
def python_framework?
# True if Python was compiled as a framework.
python_prefix = `python-config --prefix`.strip
File.exist? "#{python_prefix}/Python"
end
weechat: switch from cmake to configure * Switch to using `configure` * Remove `head` because it requires gtk. * Add a build time dep on gettext, otherwise link errors. * Add `--disable-perl` to stop segfault on program exit. * Add `--disable-aspell` which is still being reviewed. * Add `--disable-static` to stop building duplicate plugins. * Add `--disable-python` unless Python is a framework. * Note that the one `inreplace` is fixed in HEAD. * Delete the plugin symlinks to stop runtime warnings. Weechat-0.3.7 can be built using cmake or configure, but their cmake build scripts are prone to errors when building the ruby bindings. By switching to `configure` the formula is greatly simplified, and all the plugins it creates get neatly installed into lib+'weechat/plugins' automatically. Weechat `head` builds require `gtk` even if the `gtk` gui is not enabled, which it isn't because it's b0rked. So remove head. Weechat comes with an internal gettext and libintl that cause errors when linking. So add a dep on Homebrew's gettext. As reported by another user and confirmed through gdb, the perl plugin causes a segfault on exit. So disable building that. Aspell is still under construction in Homebrew, and weechat will compile that plug by default. So disable aspell for now. Disable the static plugins and delete the plugin symlinks. That leaves only one `.so` for each plugin and stops a dozen warnings when running weechat about _can't load duplicate plugins._ Disable building the Python plugin unless Python is a framework because it will build but fail to load the plugin with an error that it can't dlopen a module expected in flat namespace. Even if we add a dep on Homebrew/dupes/ncurses to get the wide variety of it, that formula doesn't actually create `-lnursesw`. So that is not added, because it can't be found. The gtk interface to weechat is not added as a user option because it runs but doesn't make a useable gui. It's blank & unresponsive. Weechat compiles, runs, and connects to freenode without error using clang and llvm on Lion, tested against system Ruby, system Python, and Homebrew Python frameworks. Fixes Homebrew/homebrew#11289. Fixes Homebrew/homebrew#11835. Fixes Homebrew/homebrew#12066. Closes Homebrew/homebrew#12193. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-10 19:38:26 +00:00
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
2009-09-17 18:41:05 +00:00
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?)