aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2012-03-16 23:52:38 +0800
committerdinoex <dinoex@FreeBSD.org>2012-03-16 23:52:38 +0800
commit40aab47e3a213ffd4ab1f2df9aa8b342747dee94 (patch)
treec578f25218a7819571d38036d2bf7257e49ad9f9
parent07d9fb6cc9b103057c98decce2ba068709419e66 (diff)
downloadfreebsd-ports-gnome-40aab47e3a213ffd4ab1f2df9aa8b342747dee94.tar.gz
freebsd-ports-gnome-40aab47e3a213ffd4ab1f2df9aa8b342747dee94.tar.zst
freebsd-ports-gnome-40aab47e3a213ffd4ab1f2df9aa8b342747dee94.zip
- fix build with ruby19
Feature safe: yes
-rw-r--r--irc/xchat-ruby/Makefile14
-rw-r--r--irc/xchat-ruby/files/patch-Makefile4
-rw-r--r--irc/xchat-ruby/files/rubypath.rb12
3 files changed, 23 insertions, 7 deletions
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 <bsd.port.pre.mk>
-.if ${RUBY_VER} == 1.9
-BROKEN= does not build with ruby 1.9
-.endif
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
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