aboutsummaryrefslogtreecommitdiffstats
path: root/lang/ruby16
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2001-05-06 07:08:50 +0800
committerknu <knu@FreeBSD.org>2001-05-06 07:08:50 +0800
commita702d27218b654307723bc011fabcab79ecce7e6 (patch)
treeb067bb5acfccf34efaa299c35c4ee515f89c8ae7 /lang/ruby16
parent110920c3be4fa9eec30ec0d766a4723e2fdd27a7 (diff)
downloadfreebsd-ports-gnome-a702d27218b654307723bc011fabcab79ecce7e6.tar.gz
freebsd-ports-gnome-a702d27218b654307723bc011fabcab79ecce7e6.tar.zst
freebsd-ports-gnome-a702d27218b654307723bc011fabcab79ecce7e6.zip
Install "irb" as "irb16" and make "irb" a symlink to it.
Diffstat (limited to 'lang/ruby16')
-rw-r--r--lang/ruby16/Makefile19
-rw-r--r--lang/ruby16/pkg-plist1
2 files changed, 17 insertions, 3 deletions
diff --git a/lang/ruby16/Makefile b/lang/ruby16/Makefile
index ecab583f3506..14207cde815c 100644
--- a/lang/ruby16/Makefile
+++ b/lang/ruby16/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ruby
PORTVERSION= ${RUBY_PORTVERSION}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= lang ruby ipv6
MASTER_SITES= ${MASTER_SITE_RUBY}
MASTER_SITE_SUBDIR= ${RUBY_VER}
@@ -41,6 +41,8 @@ CONFIGURE_ARGS+= --program-suffix="${RUBY_SUFFIX}"
CONFIGURE_ARGS+= --enable-ipv6
.endif
+IRB= ${LOCALBASE}/bin/irb
+
post-patch:
find ${WRKSRC} -name '*.orig' -delete
.for d in Win32API
@@ -55,12 +57,23 @@ post-install:
strip ${RUBY}
.endif
.if empty(RUBY_SUFFIX)
- ${MV} -f ${RUBY} ${RUBY}${_RUBY_SUFFIX}
- ${LN} -fs ${RUBY}${_RUBY_SUFFIX} ${RUBY}
+ ${MV} -f ${RUBY} ${RUBY_WITH_SUFFIX}
+ ${LN} -fs ${RUBY_WITH_SUFFIX} ${RUBY}
${MV} ${PREFIX}/man/man1/ruby.1 ${PREFIX}/man/man1/ruby${_RUBY_SUFFIX}.1
.else
${LN} -fs ${RUBY} ${PREFIX}/bin/ruby
.endif
+ ${RUBY} ${RUBY_FLAGS} -i -p \
+ -e 'if $$. == 1; ' \
+ -e ' if /^#!/; ' \
+ -e ' sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY_WITH_SUFFIX}";' \
+ -e ' else;' \
+ -e ' $$_ = "#!${RUBY_WITH_SUFFIX}\n" + $$_;' \
+ -e ' end;' \
+ -e 'end' \
+ ${IRB}
+ ${MV} -f ${IRB} ${IRB}${_RUBY_SUFFIX}
+ ${LN} -fs ${IRB}${_RUBY_SUFFIX} ${IRB}
.if !defined(NOPORTDOCS)
${MKDIR} ${RUBY_EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/sample/* ${RUBY_EXAMPLESDIR}
diff --git a/lang/ruby16/pkg-plist b/lang/ruby16/pkg-plist
index 79801fe1946c..0912019d6a9f 100644
--- a/lang/ruby16/pkg-plist
+++ b/lang/ruby16/pkg-plist
@@ -1,4 +1,5 @@
bin/irb
+bin/irb%%_RUBY_SUFFIX%%
bin/ruby
bin/ruby%%_RUBY_SUFFIX%%
lib/lib%%RUBY_NAME%%.so