Skip to content

Commit

Permalink
Framework: sync with upstream
Browse files Browse the repository at this point in the history
Taken from: FreeBSD
  • Loading branch information
fichtner committed Apr 28, 2016
1 parent 9b4a7d5 commit 5ee9b47
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 139 deletions.
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ in the release notes and/or placed into UPDATING.

All ports committers are allowed to commit to this file.

20160426:
AUTHOR: [email protected]

USE_MYSQL and USE_BDB have been replaced by USES=mysql and USES=bdb.

WANT_BDB_VER=XX should be replaced by USES=bdb:XX.

20160414:
AUTHOR: [email protected]

Expand Down
1 change: 0 additions & 1 deletion MOVED
Original file line number Diff line number Diff line change
Expand Up @@ -8300,7 +8300,6 @@ science/py-pydap||2016-04-23|Has expired: Broken for more than 6 months
sysutils/su2||2016-04-23|Has expired: Broken for more than 6 months
www/download-gemist||2016-04-23|Has expired: Broken for more than 6 months
databases/p5-qdbm||2016-04-23|Has expired: Broken for more than 6 months
comms/libfec||2016-04-23|Has expired: Broken for more than 6 months
deskutils/ladon||2016-04-23|Has expired: Broken for more than 6 months
java/linux-sun-jdk17||2016-04-24|Has expired: Unsupported and known for multiple security vulnerabilities
devel/compiler-rt-devel|devel/llvm-devel|2016-04-24|Folded back in to devel/llvm-devel
150 changes: 150 additions & 0 deletions Mk/Uses/gem.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# $FreeBSD$
#
# Support rubygem packages
#
# Feature: gem
# Usage: USES=gem[:autoplist]
# Valid args: autoplist Automatically generate packing list
#
# MAINTAINER: [email protected]

.if !defined(_INCLUDE_USES_GEM_MK)

_INCLUDE_USES_GEM_MK= yes

_valid_ARGS= autoplist noautoplist

# Sanity check
.for arg in ${gem_ARGS}
. if empty(_valid_ARGS:M${arg})
IGNORE= Incorrect 'USES+= gem:${gem_ARGS}' usage: argument [${arg}] is not recognized
. endif
.endfor

BUILD_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems
RUN_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems

PKGNAMEPREFIX?= rubygem-
EXTRACT_SUFX= .gem
EXTRACT_ONLY=
DIST_SUBDIR= rubygem

EXTRACT_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems
GEMS_BASE_DIR= lib/ruby/gems/${RUBY_VER}
GEMS_DIR= ${GEMS_BASE_DIR}/gems
DOC_DIR= ${GEMS_BASE_DIR}/doc
CACHE_DIR= ${GEMS_BASE_DIR}/cache
SPEC_DIR= ${GEMS_BASE_DIR}/specifications
EXT_DIR= ${GEMS_BASE_DIR}/extensions
GEM_NAME?= ${PORTNAME}-${PORTVERSION}
GEM_LIB_DIR?= ${GEMS_DIR}/${GEM_NAME}
GEM_DOC_DIR?= ${DOC_DIR}/${GEM_NAME}
GEM_SPEC?= ${SPEC_DIR}/${GEM_NAME}.gemspec
GEM_CACHE?= ${CACHE_DIR}/${GEM_NAME}.gem
GEMSPEC= ${PORTNAME}.gemspec
GEM_ENV+= RB_USER_INSTALL=yes

.if defined(LANG) && !empty(LANG)
GEM_ENV+= LANG=${LANG}
.else
GEM_ENV+= LANG=en_US.UTF-8
.endif

.if defined(LC_ALL) && !empty(LC_ALL)
GEM_ENV+= LC_ALL=${LC_ALL}
.else
GEM_ENV+= LC_ALL=en_US.UTF-8
.endif

.if defined(LC_CTYPE) && !empty(LC_CTYPE)
GEM_ENV+= LC_CTYPE=${LC_CTYPE}
.else
GEM_ENV+= LC_CTYPE=UTF-8
.endif

PLIST_SUB+= PORTVERSION="${PORTVERSION}" \
REV="${RUBY_GEM}" \
GEMS_BASE_DIR="lib/ruby/gems/${RUBY_VER}" \
GEMS_DIR="${GEMS_DIR}" \
DOC_DIR="${DOC_DIR}" \
CACHE_DIR="${CACHE_DIR}" \
SPEC_DIR="${SPEC_DIR}" \
EXT_DIR="${EXT_DIR}" \
PORT="${PORTNAME}-${PORTVERSION}" \
GEM_NAME="${GEM_NAME}" \
GEM_LIB_DIR="${GEM_LIB_DIR}" \
GEM_DOC_DIR="${GEM_DOC_DIR}" \
GEM_SPEC="${GEM_SPEC}" \
GEM_CACHE="${GEM_CACHE}" \
EXTRACT_SUFX="${EXTRACT_SUFX}"

RUBYGEMBIN= ${LOCALBASE}/bin/gem${RUBY_VER:S/.//}

. if defined(DISTFILES)
GEMFILES= ${DISTFILES:C/:[^:]+$//}
. else
GEMFILES= ${DISTNAME}${EXTRACT_SUFX}
. endif

RUBYGEM_ARGS=-l --no-update-sources --install-dir ${STAGEDIR}${PREFIX}/lib/ruby/gems/${RUBY_VER} --ignore-dependencies --bindir=${STAGEDIR}${PREFIX}/bin

.if ${PORT_OPTIONS:MDOCS}
RUBYGEM_ARGS+= --rdoc --ri
.else
RUBYGEM_ARGS+= --no-rdoc --no-ri
.endif

.if !target(do-extract)
do-extract:
@${SETENV} ${GEM_ENV} ${RUBYGEMBIN} unpack --target=${WRKDIR} ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES}
@(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} spec --ruby ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} > ${GEMSPEC} ; then \
if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
${ECHO_MSG} "===> Extraction failed unexpectedly."; \
(${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
fi; \
${FALSE}; \
fi)
.endif

.if !target(do-build)
do-build:
@(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} build --force ${GEMSPEC} ; then \
if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
${ECHO_MSG} "===> Compilation failed unexpectedly."; \
(${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
fi; \
${FALSE}; \
fi)
.endif

.if !target(do-install)
do-install:
(cd ${BUILD_WRKSRC}; ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install ${RUBYGEM_ARGS} ${GEMFILES} -- --build-args ${CONFIGURE_ARGS})
${RM} -r ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR}/build_info/
${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f -name '*.so' -exec ${STRIP_CMD} {} +
${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f \( -name mkmf.log -or -name gem_make.out \) -delete
${RM} -rf ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR}/ext \
${STAGEDIR}${PREFIX}/${CACHE_DIR} 2> /dev/null || ${TRUE}
${RMDIR} ${STAGEDIR}${PREFIX}/${EXT_DIR} 2> /dev/null || ${TRUE}
.if defined(NOPORTDOCS)
-@${RMDIR} ${STAGEDIR}${PREFIX}/${DOC_DIR}
.endif
.endif

.if empty(gem_ARGS:Mnoautoplist)
_USES_install+= 820:gem-autoplist
gem-autoplist:
@${ECHO} ${GEM_SPEC} >> ${TMPPLIST}
.if !defined(NOPORTDOCS)
@${FIND} -ds ${STAGEDIR}${PREFIX}/${DOC_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST}
.endif
@${FIND} -ds ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST}
@if [ -d ${STAGEDIR}${PREFIX}/${EXT_DIR} ]; then \
${FIND} -ds ${STAGEDIR}${PREFIX}/${EXT_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST} ; \
fi
.endif

.endif
139 changes: 1 addition & 138 deletions Mk/bsd.ruby.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ Ruby_Include_MAINTAINER= [email protected]
# documents from. If this is defined and not empty,
# USE_RUBY_RDTOOL is implied and RUBY_RD_HTML_FILES is
# defined.
# USE_RUBYGEMS - Says that the port uses rubygems packaging system.
# RUBYGEM_AUTOPLIST - Generate packing list for rubygems based port
# automatically.
#
# USE_RUBYGEMS - Do not use this -- instead USES=gem
#
# [variables that each port should not (re)define]
#
Expand Down Expand Up @@ -263,24 +260,6 @@ _RUBY_VENDORDIR?= ${_RUBY_SYSLIBDIR}/ruby/vendor_ruby

.if !defined(_INVALID_RUBY_VER)

.if defined(LANG) && !empty(LANG)
GEM_ENV+= LANG=${LANG}
.else
GEM_ENV+= LANG=en_US.UTF-8
.endif

.if defined(LC_ALL) && !empty(LC_ALL)
GEM_ENV+= LC_ALL=${LC_ALL}
.else
GEM_ENV+= LC_ALL=en_US.UTF-8
.endif

.if defined(LC_CTYPE) && !empty(LC_CTYPE)
GEM_ENV+= LC_CTYPE=${LC_CTYPE}
.else
GEM_ENV+= LC_CTYPE=UTF-8
.endif

RUBY_DEFAULT_SUFFIX?= ${RUBY_DEFAULT_VER:S/.//}

RUBY_DISTVERSION?= ${RUBY_VERSION}
Expand Down Expand Up @@ -391,122 +370,6 @@ RUBY_PROVIDED= "should be" # the latest version is going to be installed
RUBY_FLAGS+= -d
.endif

#
# RubyGems support
#
.if defined(USE_RUBYGEMS)

BUILD_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems
RUN_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems

PKGNAMEPREFIX?= rubygem-
EXTRACT_SUFX= .gem
EXTRACT_ONLY=
DIST_SUBDIR= rubygem

EXTRACT_DEPENDS+= ${RUBYGEMBIN}:devel/ruby-gems
GEMS_BASE_DIR= lib/ruby/gems/${RUBY_VER}
GEMS_DIR= ${GEMS_BASE_DIR}/gems
DOC_DIR= ${GEMS_BASE_DIR}/doc
CACHE_DIR= ${GEMS_BASE_DIR}/cache
SPEC_DIR= ${GEMS_BASE_DIR}/specifications
EXT_DIR= ${GEMS_BASE_DIR}/extensions
GEM_NAME?= ${PORTNAME}-${PORTVERSION}
GEM_LIB_DIR?= ${GEMS_DIR}/${GEM_NAME}
GEM_DOC_DIR?= ${DOC_DIR}/${GEM_NAME}
GEM_SPEC?= ${SPEC_DIR}/${GEM_NAME}.gemspec
GEM_CACHE?= ${CACHE_DIR}/${GEM_NAME}.gem

PLIST_SUB+= PORTVERSION="${PORTVERSION}" \
REV="${RUBY_GEM}" \
GEMS_BASE_DIR="lib/ruby/gems/${RUBY_VER}" \
GEMS_DIR="${GEMS_DIR}" \
DOC_DIR="${DOC_DIR}" \
CACHE_DIR="${CACHE_DIR}" \
SPEC_DIR="${SPEC_DIR}" \
EXT_DIR="${EXT_DIR}" \
PORT="${PORTNAME}-${PORTVERSION}" \
GEM_NAME="${GEM_NAME}" \
GEM_LIB_DIR="${GEM_LIB_DIR}" \
GEM_DOC_DIR="${GEM_DOC_DIR}" \
GEM_SPEC="${GEM_SPEC}" \
GEM_CACHE="${GEM_CACHE}" \
EXTRACT_SUFX="${EXTRACT_SUFX}"

RUBYGEMBIN= ${LOCALBASE}/bin/gem${RUBY_VER:S/.//}

. if defined(DISTFILES)
GEMFILES= ${DISTFILES:C/:[^:]+$//}
. else
GEMFILES= ${DISTNAME}${EXTRACT_SUFX}
. endif

GEMSPEC= ${PORTNAME}.gemspec

RUBYGEM_ARGS=-l --no-update-sources --install-dir ${STAGEDIR}${PREFIX}/lib/ruby/gems/${RUBY_VER} --ignore-dependencies --bindir=${STAGEDIR}${PREFIX}/bin
GEM_ENV+= RB_USER_INSTALL=yes
.if defined(NOPORTDOCS)
RUBYGEM_ARGS+= --no-rdoc --no-ri
.else
RUBYGEM_ARGS+= --rdoc --ri
.endif

.if !target(do-extract)
do-extract:
@${SETENV} ${GEM_ENV} ${RUBYGEMBIN} unpack --target=${WRKDIR} ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES}
@(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} spec --ruby ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} > ${GEMSPEC} ; then \
if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
${ECHO_MSG} "===> Extraction failed unexpectedly."; \
(${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
fi; \
${FALSE}; \
fi)
.endif

.if !target(do-build)
do-build:
@(cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} build --force ${GEMSPEC} ; then \
if [ -n "${BUILD_FAIL_MESSAGE}" ] ; then \
${ECHO_MSG} "===> Compilation failed unexpectedly."; \
(${ECHO_CMD} "${BUILD_FAIL_MESSAGE}") | ${FMT} 75 79 ; \
fi; \
${FALSE}; \
fi)
.endif

.if !target(do-install)
do-install:
(cd ${BUILD_WRKSRC}; ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install ${RUBYGEM_ARGS} ${GEMFILES} -- --build-args ${CONFIGURE_ARGS})
${RM} -r ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR}/build_info/
${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f -name '*.so' -exec ${STRIP_CMD} {} +
${FIND} ${STAGEDIR}${PREFIX}/${GEMS_BASE_DIR} -type f \( -name mkmf.log -or -name gem_make.out \) -delete
${RM} -rf ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR}/ext \
${STAGEDIR}${PREFIX}/${CACHE_DIR} 2> /dev/null || ${TRUE}
${RMDIR} ${STAGEDIR}${PREFIX}/${EXT_DIR} 2> /dev/null || ${TRUE}
.if defined(NOPORTDOCS)
-@${RMDIR} ${STAGEDIR}${PREFIX}/${DOC_DIR}
.endif
.endif

. if defined(RUBYGEM_AUTOPLIST)
. if !target(post-install-script)
post-install-script:
@${ECHO} ${GEM_SPEC} >> ${TMPPLIST}
.if !defined(NOPORTDOCS)
@${FIND} -ds ${STAGEDIR}${PREFIX}/${DOC_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST}
.endif
@${FIND} -ds ${STAGEDIR}${PREFIX}/${GEM_LIB_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST}
@if [ -d ${STAGEDIR}${PREFIX}/${EXT_DIR} ]; then \
${FIND} -ds ${STAGEDIR}${PREFIX}/${EXT_DIR} -type f -print | ${SED} -E -e \
's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST} ; \
fi
. endif
. endif

.endif # USE_RUBYGEMS

#
# extconf.rb support
#
Expand Down
8 changes: 8 additions & 0 deletions Mk/bsd.sanity.mk
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ DEV_ERROR+= "WANT_SDL is no longer supported. If you need SDL, use USE_SDL, if y
DEV_ERROR+= "USE_RC_SUBR=yes has not been supported for a long time, remove it."
.endif

.if defined(USE_RUBYGEMS) && !defined(RUBYGEM_AUTOPLIST)
DEV_ERROR+= "USE_RUBYGEMS is no longer supported, please use USES=gem:noautoplist"
.endif

.if defined(RUBYGEM_AUTOPLIST)
DEV_ERROR+= "RUBYGEM_AUTOPLIST is no longer supported, please use USES=gem"
.endif

SANITY_UNSUPPORTED= USE_OPENAL USE_FAM USE_MAKESELF USE_ZIP USE_LHA USE_CMAKE \
USE_READLINE USE_ICONV PERL_CONFIGURE PERL_MODBUILD \
USE_PERL5_BUILD USE_PERL5_RUN USE_DISPLAY USE_FUSE \
Expand Down

0 comments on commit 5ee9b47

Please sign in to comment.