Lines 57-67
Link Here
|
57 |
# documents from. If this is defined and not empty, |
57 |
# documents from. If this is defined and not empty, |
58 |
# USE_RUBY_RDTOOL is implied and RUBY_RD_HTML_FILES is |
58 |
# USE_RUBY_RDTOOL is implied and RUBY_RD_HTML_FILES is |
59 |
# defined. |
59 |
# defined. |
60 |
# USE_RUBYGEMS - Says that the port uses rubygems packaging system. |
60 |
# USE_RUBYGEMS - Do not use this -- instead USES=gem |
61 |
# RUBYGEM_AUTOPLIST - Generate packing list for rubygems based port |
|
|
62 |
# automatically. |
63 |
# |
61 |
# |
64 |
# |
|
|
65 |
# [variables that each port should not (re)define] |
62 |
# [variables that each port should not (re)define] |
66 |
# |
63 |
# |
67 |
# RUBY_PKGNAMEPREFIX - Common PKGNAMEPREFIX for ruby ports |
64 |
# RUBY_PKGNAMEPREFIX - Common PKGNAMEPREFIX for ruby ports |
Lines 264-287
Link Here
|
264 |
|
261 |
|
265 |
.if !defined(_INVALID_RUBY_VER) |
262 |
.if !defined(_INVALID_RUBY_VER) |
266 |
|
263 |
|
267 |
.if defined(LANG) && !empty(LANG) |
|
|
268 |
GEM_ENV+= LANG=${LANG} |
269 |
.else |
270 |
GEM_ENV+= LANG=en_US.UTF-8 |
271 |
.endif |
272 |
|
273 |
.if defined(LC_ALL) && !empty(LC_ALL) |
274 |
GEM_ENV+= LC_ALL=${LC_ALL} |
275 |
.else |
276 |
GEM_ENV+= LC_ALL=en_US.UTF-8 |
277 |
.endif |
278 |
|
279 |
.if defined(LC_CTYPE) && !empty(LC_CTYPE) |
280 |
GEM_ENV+= LC_CTYPE=${LC_CTYPE} |
281 |
.else |
282 |
GEM_ENV+= LC_CTYPE=UTF-8 |
283 |
.endif |
284 |
|
285 |
RUBY_DEFAULT_SUFFIX?= ${RUBY_DEFAULT_VER:S/.//} |
264 |
RUBY_DEFAULT_SUFFIX?= ${RUBY_DEFAULT_VER:S/.//} |
286 |
|
265 |
|
287 |
RUBY_DISTVERSION?= ${RUBY_VERSION} |
266 |
RUBY_DISTVERSION?= ${RUBY_VERSION} |
Lines 424-545
Link Here
|
424 |
.endif |
403 |
.endif |
425 |
|
404 |
|
426 |
# |
405 |
# |
427 |
# RubyGems support |
|
|
428 |
# |
429 |
.if defined(USE_RUBYGEMS) |
430 |
|
431 |
BUILD_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems |
432 |
RUN_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems |
433 |
|
434 |
PKGNAMEPREFIX?= rubygem- |
435 |
EXTRACT_SUFX= .gem |
436 |
EXTRACT_ONLY= |
437 |
DIST_SUBDIR= rubygem |
438 |
|
439 |
EXTRACT_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems |
440 |
GEMS_BASE_DIR= lib/ruby/gems/${RUBY_VER} |
441 |
GEMS_DIR= ${GEMS_BASE_DIR}/gems |
442 |
DOC_DIR= ${GEMS_BASE_DIR}/doc |
443 |
CACHE_DIR= ${GEMS_BASE_DIR}/cache |
444 |
SPEC_DIR= ${GEMS_BASE_DIR}/specifications |
445 |
EXT_DIR= ${GEMS_BASE_DIR}/extensions |
446 |
GEM_NAME?= ${PORTNAME}-${PORTVERSION} |
447 |
GEM_LIB_DIR?= ${GEMS_DIR}/${GEM_NAME} |
448 |
GEM_DOC_DIR?= ${DOC_DIR}/${GEM_NAME} |
449 |
GEM_SPEC?= ${SPEC_DIR}/${GEM_NAME}.gemspec |
450 |
GEM_CACHE?= ${CACHE_DIR}/${GEM_NAME}.gem |
451 |
|
452 |
PLIST_SUB+= PORTVERSION="${PORTVERSION}" \ |
453 |
REV="${RUBY_GEM}" \ |
454 |
GEMS_BASE_DIR="lib/ruby/gems/${RUBY_VER}" \ |
455 |
GEMS_DIR="${GEMS_DIR}" \ |
456 |
DOC_DIR="${DOC_DIR}" \ |
457 |
CACHE_DIR="${CACHE_DIR}" \ |
458 |
SPEC_DIR="${SPEC_DIR}" \ |
459 |
EXT_DIR="${EXT_DIR}" \ |
460 |
PORT="${PORTNAME}-${PORTVERSION}" \ |
461 |
GEM_NAME="${GEM_NAME}" \ |
462 |
GEM_LIB_DIR="${GEM_LIB_DIR}" \ |
463 |
GEM_DOC_DIR="${GEM_DOC_DIR}" \ |
464 |
GEM_SPEC="${GEM_SPEC}" \ |
465 |
GEM_CACHE="${GEM_CACHE}" \ |
466 |
EXTRACT_SUFX="${EXTRACT_SUFX}" |
467 |
|
468 |
RUBYGEMBIN= ${LOCALBASE}/bin/gem${RUBY_VER:S/.//} |
469 |
|
470 |
. if defined(DISTFILES) |
471 |
GEMFILES= ${DISTFILES:C/:[^:]+$//} |
472 |
. else |
473 |
GEMFILES= ${DISTNAME}${EXTRACT_SUFX} |
474 |
. endif |
475 |
|
476 |
GEMSPEC= ${PORTNAME}.gemspec |
477 |
|
478 |
RUBYGEM_ARGS=-l --no-update-sources --install-dir ${STAGEDIR}${PREFIX}/lib/ruby/gems/${RUBY_VER} --ignore-dependencies --bindir=${STAGEDIR}${PREFIX}/bin |
479 |
GEM_ENV+= RB_USER_INSTALL=yes |
480 |
.if defined(NOPORTDOCS) |
481 |
RUBYGEM_ARGS+= --no-rdoc --no-ri |
482 |
.else |
483 |
RUBYGEM_ARGS+= --rdoc --ri |
484 |
.endif |
485 |
|
486 |
.if !target(do-extract) |
487 |
do-extract: |
488 |
@${SETENV} ${GEM_ENV} ${RUBYGEMBIN} unpack --target=${WRKDIR} ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} |
489 |
@(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} spec --ruby ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} > ${GEMSPEC} ; then \ |
490 |
if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \ |
491 |
${ECHO_MSG} "===> Extraction failed unexpectedly."; \ |
492 |
(${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \ |
493 |
fi; \ |
494 |
${FALSE}; \ |
495 |
fi) |
496 |
.endif |
497 |
|
498 |
.if !target(do-build) |
499 |
do-build: |
500 |
@(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} build --force ${GEMSPEC} ; then \ |
501 |
if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \ |
502 |
${ECHO_MSG} "===> Compilation failed unexpectedly."; \ |
503 |
(${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \ |
504 |
fi; \ |
505 |
${FALSE}; \ |
506 |
fi) |
507 |
.endif |
508 |
|
509 |
.if !target(do-install) |
510 |
do-install: |
511 |
(cd ${BUILD_WRKSRC}; ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install ${RUBYGEM_ARGS} ${GEMFILES} -- --build-args ${CONFIGURE_ARGS}) |
512 |
${RM} -r ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR}/build_info/ |
513 |
${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f -name '*.so' -exec ${STRIP_CMD} {} + |
514 |
${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f \( -name mkmf.log -or -name gem_make.out \) -delete |
515 |
${RM} -rf ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR}/ext \ |
516 |
${STAGEDIR}${PREFIX}/${CACHE_DIR} 2> /dev/null || ${TRUE} |
517 |
${RMDIR} ${STAGEDIR}${PREFIX}/${EXT_DIR} 2> /dev/null || ${TRUE} |
518 |
.if defined(NOPORTDOCS) |
519 |
-@${RMDIR} ${STAGEDIR}${PREFIX}/${DOC_DIR} |
520 |
.endif |
521 |
.endif |
522 |
|
523 |
. if defined(RUBYGEM_AUTOPLIST) |
524 |
. if !target(post-install-script) |
525 |
post-install-script: |
526 |
@${ECHO} ${GEM_SPEC} >> ${TMPPLIST} |
527 |
.if !defined(NOPORTDOCS) |
528 |
@${FIND} -ds ${STAGEDIR}${PREFIX}/${DOC_DIR} -type f -print | ${SED} -E -e \ |
529 |
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST} |
530 |
.endif |
531 |
@${FIND} -ds ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR} -type f -print | ${SED} -E -e \ |
532 |
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST} |
533 |
@if [ -d ${STAGEDIR}${PREFIX}/${EXT_DIR} ]; then \ |
534 |
${FIND} -ds ${STAGEDIR}${PREFIX}/${EXT_DIR} -type f -print | ${SED} -E -e \ |
535 |
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST} ; \ |
536 |
fi |
537 |
. endif |
538 |
. endif |
539 |
|
540 |
.endif # USE_RUBYGEMS |
541 |
|
542 |
# |
543 |
# extconf.rb support |
406 |
# extconf.rb support |
544 |
# |
407 |
# |
545 |
.if defined(USE_RUBY_EXTCONF) |
408 |
.if defined(USE_RUBY_EXTCONF) |