2001-02-19 16:55:35 +01:00
|
|
|
# New ports collection makefile for: ruby_static
|
|
|
|
# Date created: 19 February 2001
|
|
|
|
# Whom: Akinori MUSHA aka knu <knu@idaemons.org>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= ruby_static
|
|
|
|
PORTVERSION= ${RUBY_PORTVERSION}
|
2004-02-26 20:20:09 +01:00
|
|
|
PORTREVISION?= 1
|
2001-02-19 16:55:35 +01:00
|
|
|
CATEGORIES= lang ruby ipv6
|
|
|
|
MASTER_SITES= # none
|
|
|
|
DISTFILES= # none
|
|
|
|
|
2005-11-11 02:18:01 +01:00
|
|
|
MAINTAINER= ports@FreeBSD.org
|
2003-02-18 06:42:05 +01:00
|
|
|
COMMENT= A Ruby binary with some modules compiled in (in case of emergency)
|
2001-02-19 16:55:35 +01:00
|
|
|
|
2003-03-11 09:57:33 +01:00
|
|
|
EXTRACT_DEPENDS= ${NONEXISTENT}:${.CURDIR}/../../${RUBY_PORT}:patch
|
2001-02-19 16:55:35 +01:00
|
|
|
|
|
|
|
USE_RUBY= yes
|
|
|
|
|
2003-01-24 05:39:04 +01:00
|
|
|
RUBY_VER?= 1.6
|
|
|
|
|
2002-09-11 20:22:01 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2004-09-28 01:07:22 +02:00
|
|
|
.if ${ARCH} == "amd64" && ${RUBY_VER} == 1.6
|
2004-04-04 03:35:39 +02:00
|
|
|
BROKEN= "Configure fails on amd64"
|
|
|
|
.endif
|
|
|
|
|
2001-09-17 09:45:58 +02:00
|
|
|
# Beware, because gdbm is under GPL, you must treat the whole binary
|
2002-02-20 06:52:50 +01:00
|
|
|
# as GPL says if you include gdbm in it.
|
2003-04-19 17:57:37 +02:00
|
|
|
EXT_PORTS= databases/ruby-bdb1
|
2001-02-19 16:55:35 +01:00
|
|
|
_PORTSDIR= ${.CURDIR}/../..
|
|
|
|
_RUBY_PORTDIR= ${_PORTSDIR}/${RUBY_PORT}
|
|
|
|
|
2002-09-11 20:22:01 +02:00
|
|
|
.if ${RUBY_VER} < 1.7
|
2002-09-21 09:11:58 +02:00
|
|
|
EXT_PORTS+= ${RUBY_SHIM18_PORT}
|
2002-09-11 20:22:01 +02:00
|
|
|
.else
|
|
|
|
EXT_PORTS+= converters/ruby-iconv
|
|
|
|
.endif
|
|
|
|
|
2001-02-19 16:55:35 +01:00
|
|
|
.for p in ${EXT_PORTS}
|
2003-03-18 03:49:13 +01:00
|
|
|
EXTRACT_DEPENDS+= ${NONEXISTENT}:${_PORTSDIR}/${p}:patch
|
2001-02-19 16:55:35 +01:00
|
|
|
.endfor
|
|
|
|
|
2002-09-24 22:24:40 +02:00
|
|
|
GNU_CONFIGURE= yes
|
2004-03-30 21:20:22 +02:00
|
|
|
USE_ICONV= yes
|
2002-03-30 11:10:36 +01:00
|
|
|
|
2001-02-19 16:55:35 +01:00
|
|
|
WRKSRC= ${RUBY_WRKSRC}
|
|
|
|
|
|
|
|
DESCR= ${_RUBY_PORTDIR}/pkg-descr
|
|
|
|
|
2001-09-17 09:45:58 +02:00
|
|
|
# You can build a totally statically linked binary by defining STATIC,
|
2002-11-18 13:02:29 +01:00
|
|
|
# although the resulted interpreter is not capable of loading dynamic
|
|
|
|
# modules.
|
2001-09-17 09:45:58 +02:00
|
|
|
|
2003-08-04 19:55:42 +02:00
|
|
|
CONFIGURE_ENV= LIBS="-L${LOCALBASE}/lib"
|
2001-02-19 16:55:35 +01:00
|
|
|
CONFIGURE_ARGS!= cd ${_RUBY_PORTDIR} && ${MAKE} -V CONFIGURE_ARGS
|
2001-09-17 09:45:58 +02:00
|
|
|
.if defined(STATIC)
|
2001-02-19 16:55:35 +01:00
|
|
|
CONFIGURE_ARGS:= ${CONFIGURE_ARGS:N--enable-shared:M-*} \
|
|
|
|
--with-static-linked-ext=yes \
|
|
|
|
--with-opt-dir="${LOCALBASE}"
|
2001-09-17 09:45:58 +02:00
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS:= ${CONFIGURE_ARGS:M-*} \
|
|
|
|
--with-opt-dir="${LOCALBASE}"
|
|
|
|
.endif
|
2001-02-19 16:55:35 +01:00
|
|
|
|
2002-11-18 13:02:29 +01:00
|
|
|
.if defined(DEBUG)
|
|
|
|
CFLAGS+= -g
|
|
|
|
STRIP= # none
|
|
|
|
.endif
|
|
|
|
|
2006-08-31 22:52:21 +02:00
|
|
|
#MAKE_ARGS= -j3
|
2002-02-19 21:48:40 +01:00
|
|
|
|
2001-06-04 16:54:32 +02:00
|
|
|
.if ${RUBY_VER} == ${RUBY_DEFAULT_VER}
|
|
|
|
IF_DEFAULT= ""
|
|
|
|
.else
|
|
|
|
IF_DEFAULT= "@comment "
|
|
|
|
.endif
|
|
|
|
|
|
|
|
PLIST_SUB+= IF_DEFAULT=${IF_DEFAULT}
|
|
|
|
|
2001-02-19 16:55:35 +01:00
|
|
|
do-fetch:
|
|
|
|
@${DO_NADA}
|
|
|
|
|
|
|
|
post-patch:
|
2003-08-01 00:16:01 +02:00
|
|
|
.if defined(STATIC)
|
2001-02-19 16:55:35 +01:00
|
|
|
${RUBY} -i -pe 'gsub /-rdynamic/, "-static"' ${WRKSRC}/configure.in
|
2001-09-17 09:45:58 +02:00
|
|
|
.endif
|
2003-08-01 00:16:01 +02:00
|
|
|
${RUBY} -i -pe '$$. == 1 and puts %q/require "rbconfig.rb"/' ${WRKSRC}/ext/bdb1/extconf.rb
|
2001-02-19 16:55:35 +01:00
|
|
|
|
|
|
|
do-extract:
|
|
|
|
${MKDIR} ${WRKDIR}
|
|
|
|
${LN} -sf `cd ${_RUBY_PORTDIR} && ${MAKE} -V WRKSRC` ${WRKSRC}
|
|
|
|
.for p in ${EXT_PORTS}
|
|
|
|
wrksrc=$$(cd ${_PORTSDIR}/${p} && ${MAKE} -V WRKSRC) ; \
|
2002-09-11 20:22:01 +02:00
|
|
|
${FIND} -L $$wrksrc -name extconf.rb | \
|
|
|
|
${XARGS} ${GREP} -l create_makefile | \
|
|
|
|
while read extdir; do \
|
|
|
|
extdir=$${extdir%/extconf.rb}; \
|
|
|
|
case "$p" in \
|
2002-09-23 14:15:23 +02:00
|
|
|
${RUBY_SHIM18_PORT}) \
|
2002-09-11 20:22:01 +02:00
|
|
|
m=$$(basename $$extdir); \
|
|
|
|
case $$extdir in \
|
|
|
|
*/racc/*) \
|
|
|
|
${MKDIR} ${WRKSRC}/ext/racc; \
|
|
|
|
m=racc/$${m} ;; \
|
|
|
|
*/ext/features/ruby18/*) \
|
|
|
|
${MKDIR} ${WRKSRC}/ext/features/ruby18; \
|
|
|
|
m=features/ruby18/$${m}_ruby18 ;; \
|
|
|
|
esac ;; \
|
|
|
|
*) \
|
|
|
|
m="${p:T:S,^ruby-,,}" ;; \
|
|
|
|
esac; \
|
|
|
|
${CP} -RPp $$extdir ${WRKSRC}/ext/$$m; \
|
|
|
|
${TOUCH} ${WRKSRC}/ext/$$m/MANIFEST; \
|
|
|
|
done
|
2001-02-19 16:55:35 +01:00
|
|
|
.endfor
|
2001-09-17 09:45:58 +02:00
|
|
|
.if defined(STATIC)
|
2002-01-29 10:19:45 +01:00
|
|
|
${ECHO_CMD} "option nodynamic" > ${WRKSRC}/ext/Setup
|
2001-09-17 09:45:58 +02:00
|
|
|
.else
|
2002-01-29 10:19:45 +01:00
|
|
|
${ECHO_CMD} "#option nodynamic" > ${WRKSRC}/ext/Setup
|
2001-09-17 09:45:58 +02:00
|
|
|
.endif
|
2002-09-11 20:22:01 +02:00
|
|
|
cd ${WRKSRC}/ext; ${FIND} * -name extconf.rb | \
|
|
|
|
${XARGS} ${GREP} -l create_makefile | \
|
|
|
|
while read extdir; do \
|
|
|
|
extdir=$${extdir%/extconf.rb}; \
|
|
|
|
echo $$extdir; \
|
|
|
|
done >> Setup
|
2001-02-19 16:55:35 +01:00
|
|
|
|
|
|
|
do-install:
|
2001-05-06 18:46:05 +02:00
|
|
|
${INSTALL_PROGRAM} ${WRKSRC}/${RUBY_NAME} ${RUBY_WITH_SUFFIX}_s
|
2001-06-04 16:54:32 +02:00
|
|
|
.if ${RUBY_VER} == ${RUBY_DEFAULT_VER}
|
2004-02-26 20:20:09 +01:00
|
|
|
${LN} -fs ${RUBY_NAME}_s ${RUBY_WITHOUT_SUFFIX}_s
|
2001-06-04 16:54:32 +02:00
|
|
|
.endif
|
2001-02-19 16:55:35 +01:00
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|