diff options
| author | nibbles 2bits | 2012-06-11 23:23:07 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2012-06-12 07:07:42 -0700 |
| commit | c997507315b87b42eb93fc18dc2dd555b8b11625 (patch) | |
| tree | e3e8a953a898b4e98442f5d3ffcb9d23b71dd917 | |
| parent | cf39e55eb025bbdad7d226f1476f7212f1dffde6 (diff) | |
| download | homebrew-c997507315b87b42eb93fc18dc2dd555b8b11625.tar.bz2 | |
weechat: switch back to cmake, support aspell
The weechat devs have informed us that configure is deprecated.
Switch back to cmake.
Add a user option to enable the aspell module.
Add a user option to enable the lua module.
Add an inreplace to fix the bad path in HB framework Python's
LINKFORSHARED variable and an explanation for it.
Add deps for lua and apsell if the user options those.
Add a caveat suggesting the user install aspell manually before
installing weechat, otherwise they won't have any dictionaries.
Remove the code that deleted the extra module symlinks.
The Aspell dep could be made into a requirement, but it would be
nice if Aspell installed at least the en dictionary by default.
All bindings work except the Ruby bindings when built against
rbenv and ruby-1.9. This has been reported upstream and is the
main reason for switching back to cmake, so we can get support.
Tested on Lion using clang and llvm from XCode-4.3.3 against
system Python, HB framework and non-framework python, the current
Aspell, Lua, and Guile, system Ruby, and system Perl.
Fixes #12377
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
| -rw-r--r-- | Library/Formula/weechat.rb | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/Library/Formula/weechat.rb b/Library/Formula/weechat.rb index af45aabca..3da156ab2 100644 --- a/Library/Formula/weechat.rb +++ b/Library/Formula/weechat.rb @@ -9,13 +9,17 @@ class Weechat < Formula depends_on 'gettext' depends_on 'gnutls' depends_on 'guile' if ARGV.include? '--guile' + depends_on 'aspell' if ARGV.include? '--aspell' + depends_on 'lua' if ARGV.include? '--lua' def options [ + ['--lua', 'Build the lua module.'], ['--perl', 'Build the perl module.'], ['--ruby', 'Build the ruby module.'], ['--guile', 'Build the guile module.'], - ['--python', 'Build the python module (requires framework Python).'] + ['--python', 'Build the python module (requires framework Python).'], + ['--aspell', 'Build the aspell module that checks your spelling.'] ] end @@ -30,37 +34,38 @@ class Weechat < Formula %Q{\n STRING(REGEX REPLACE "#{archs}" "" PERL_CFLAGS "${PERL_CFLAGS}")} + %Q{\n STRING(REGEX REPLACE "#{archs}" "" PERL_LFLAGS "${PERL_LFLAGS}")} - args = %W[ - --prefix=#{prefix} - --disable-dependency-tracking - --disable-aspell - --disable-static - --with-debug=0 + # FindPython.cmake queries the Python variable LINKFORSHARED which contains + # a path that only exists during Python install when using HB framework + # Python. So remove that and use what's common in every install of Python, + # namely -u _PyMac_Error. Without the invalid path, it links okay. + # Because Macports and Apple change LINKFORSHARED but HB does not, this + # will have to persist, and it's not reported upstream. Fixes the error + # no such file or directory: 'Python.framework/Versions/2.7/Python' + inreplace 'src/plugins/scripts/python/CMakeLists.txt', + '${PYTHON_LFLAGS}', '-u _PyMac_Error' + + args = std_cmake_args + %W[ + -DPREFIX=#{prefix} + -DENABLE_GTK=OFF ] - 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' + args << '-DENABLE_LUA=OFF' unless ARGV.include? '--lua' + args << '-DENABLE_PERL=OFF' unless ARGV.include? '--perl' + args << '-DENABLE_RUBY=OFF' unless ARGV.include? '--ruby' + args << '-DENABLE_PYTHON=OFF' unless ARGV.include? '--python' + args << '-DENABLE_ASPELL=OFF' unless ARGV.include? '--aspell' + args << '-DENABLE_GUILE=OFF' unless ARGV.include? '--guile' and \ + Formula.factory('guile').linked_keg.exist? + args << '.' - system './configure', *args + system 'cmake', *args system 'make install' - - # 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 - - def python_framework? - # True if Python was compiled as a framework. - python_prefix = `python-config --prefix`.strip - File.exist? "#{python_prefix}/Python" end 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'). + Weechat can depend on Aspell if you choose the --aspell option, but + Aspell should be installed manually before installing Weechat so that + you can choose the dictionaries you want. If Aspell was installed + automatically as part of weechat, there won't be any dictionaries. EOS end end |
