From 40aab47e3a213ffd4ab1f2df9aa8b342747dee94 Mon Sep 17 00:00:00 2001 From: dinoex Date: Fri, 16 Mar 2012 15:52:38 +0000 Subject: - fix build with ruby19 Feature safe: yes --- irc/xchat-ruby/Makefile | 14 +++++++++----- irc/xchat-ruby/files/patch-Makefile | 4 ++-- irc/xchat-ruby/files/rubypath.rb | 12 ++++++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 irc/xchat-ruby/files/rubypath.rb (limited to 'irc/xchat-ruby') diff --git a/irc/xchat-ruby/Makefile b/irc/xchat-ruby/Makefile index ac5bf9466c95..d9f5cafeb0a5 100644 --- a/irc/xchat-ruby/Makefile +++ b/irc/xchat-ruby/Makefile @@ -20,6 +20,7 @@ RUN_DEPENDS= xchat:${PORTSDIR}/irc/xchat LICENSE= GPLv2 USE_RUBY= yes +USE_LIBRUBY= yes WRKSRC= ${WRKDIR}/${DISTNAME}/src DOCSRC= ${WRKDIR}/${DISTNAME} DOCSDIR= ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME} @@ -28,6 +29,13 @@ PLIST_FILES= lib/xchat/plugins/xchat-ruby.so PORTDOCS= README ChangeLog PORTEXAMPLES= embedify.rb TimerSample.rb JFilter.rb JBanner.rb +post-patch: + ${REINPLACE_CMD} \ + -e 's|^RUBY=.*|RUBY=${RUBY}|' \ + -e 's|-lruby$$|-l${RUBY_NAME}|' \ + -e 's|^ARCHDIR=.*|ARCHDIR=`$$(RUBY) ${FILESDIR}/rubypath.rb`|' \ + ${WRKSRC}/Makefile + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/xchat-ruby.so \ ${PREFIX}/lib/xchat/plugins/ @@ -46,8 +54,4 @@ do-install: .endfor .endif -.include -.if ${RUBY_VER} == 1.9 -BROKEN= does not build with ruby 1.9 -.endif -.include +.include diff --git a/irc/xchat-ruby/files/patch-Makefile b/irc/xchat-ruby/files/patch-Makefile index 62eb06497f0f..da7319bd6e34 100644 --- a/irc/xchat-ruby/files/patch-Makefile +++ b/irc/xchat-ruby/files/patch-Makefile @@ -1,11 +1,11 @@ --- Makefile.orig 2007-04-26 13:16:32.000000000 +0200 -+++ Makefile 2008-06-21 23:35:33.000000000 +0200 ++++ Makefile 2012-03-16 12:31:27.000000000 +0100 @@ -21,7 +21,7 @@ all: $(SO_FILE) $(SO_FILE): xchat-ruby.o xchat-ruby-plugin.h - $(CC) -L$(ARCHDIR) $(CFLAGS) -shared -o $(SO_FILE) xchat-ruby.o -lruby -+ $(CC) -L$(PREFIX)/lib $(CFLAGS) -shared -o $(SO_FILE) xchat-ruby.o -lruby18 ++ $(CC) -L$(PREFIX)/lib $(CFLAGS) -shared -o $(SO_FILE) xchat-ruby.o -lruby install: $(SO_FILE) mkdir -p $(XCHAT_DIR) diff --git a/irc/xchat-ruby/files/rubypath.rb b/irc/xchat-ruby/files/rubypath.rb new file mode 100644 index 000000000000..783d1d4a382a --- /dev/null +++ b/irc/xchat-ruby/files/rubypath.rb @@ -0,0 +1,12 @@ +#!/usr/local/bin/ruby +require "rbconfig" +if RbConfig::CONFIG[ 'rubyhdrdir' ].nil? + puts RbConfig::CONFIG['archdir'] +else + print RbConfig::CONFIG['rubyhdrdir'] + print " -I" + print RbConfig::CONFIG['rubyhdrdir'] + print "/" + puts RbConfig::CONFIG['sitearch'] +end +# eof -- cgit