Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Rakefile and patches for OS X compilation

Stripped Perl solution from Homebrew project
  • Loading branch information...
commit f422722accd0b7830ebc2f7686ade7327af42baa 1 parent a1b9a89
@guns authored
View
47 Rakefile
@@ -0,0 +1,47 @@
+# -*- encoding: utf-8 -*-
+
+# Copyright (c) 2011 Sung Pae <self@sungpae.com>
+# Distributed under the MIT license.
+# http://www.opensource.org/licenses/mit-license.php
+
+task :default => :build
+task :build => [:cmake, :make]
+
+task :env do
+ ENV['CFLAGS' ] ||= ''
+ ENV['LDFLAGS'] ||= ''
+
+ if RUBY_PLATFORM =~ /darwin/i
+ # Homebrew linking help
+ if system 'command -v brew &>/dev/null'
+ %w[libgcrypt libgpg-error gettext gnutls].each do |pkg|
+ cellar = %x(brew --prefix #{pkg}).chomp
+ ENV['CFLAGS' ] += " -I#{cellar}/include "
+ ENV['LDFLAGS'] += " -L#{cellar}/lib "
+ end
+ ENV['LDFLAGS'] += ' -liconv '
+ end
+ end
+end
+
+desc 'Invoke cmake'
+task :cmake => :env do
+ mkdir_p 'build'
+ Dir.chdir 'build' do
+ sh *%W[cmake .. -DPREFIX=#{ENV['PREFIX'] || '/opt/weechat'} -DCMAKE_BUILD_TYPE=None -Wno-dev]
+ end
+end
+
+desc 'Build weechat'
+task :make => :env do
+ Dir.chdir 'build' do
+ sh *%W[make --jobs=#{ENV['JOBS'] || 2}]
+ end
+end
+
+desc 'Install weechat'
+task :install => :env do
+ Dir.chdir 'build' do
+ sh *%W[make install]
+ end
+end
View
2  src/core/wee-hook.h
@@ -20,6 +20,8 @@
#ifndef __WEECHAT_HOOK_H
#define __WEECHAT_HOOK_H 1
+#include <unistd.h> /* For pid_t */
+
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
View
2  src/plugins/scripts/perl/CMakeLists.txt
@@ -23,6 +23,8 @@ weechat-perl-api.h)
SET_TARGET_PROPERTIES(perl PROPERTIES PREFIX "")
IF(PERL_FOUND)
+ STRING(REGEX REPLACE "-arch ppc|-arch i386|-arch x86_64" "" PERL_CFLAGS "${PERL_CFLAGS}")
+ STRING(REGEX REPLACE "-arch ppc|-arch i386|-arch x86_64" "" PERL_LFLAGS "${PERL_LFLAGS}")
ADD_DEFINITIONS(${PERL_CFLAGS})
INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
# ugly hack to force linking against Dynaloader.a
Please sign in to comment.
Something went wrong with that request. Please try again.