From 38fb960f497e9e7b61e609bd31abf3ed1d20c589 Mon Sep 17 00:00:00 2001 From: Steve Wills Date: Wed, 27 Apr 2016 20:19:16 +0000 Subject: [PATCH] Improve gem.mk * Check for valid args to USES=gem * Make autoplist default, allowing it to be specified (which is a no-op), or turned off * Add sanity checks for USE_RUBYGEMS RUBYGEM_AUTOPLIST Requested by: mat Discussed with: mat --- Mk/Uses/gem.mk | 13 ++++++++++--- Mk/bsd.sanity.mk | 8 ++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Mk/Uses/gem.mk b/Mk/Uses/gem.mk index 2ff912890182..7ff5ed7e2315 100644 --- a/Mk/Uses/gem.mk +++ b/Mk/Uses/gem.mk @@ -12,6 +12,15 @@ _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 @@ -122,7 +131,7 @@ do-install: .endif .endif -.if ${gem_ARGS} == "autoplist" +.if empty(gem_ARGS:Mnoautoplist) _USES_install+= 820:gem-autoplist gem-autoplist: @${ECHO} ${GEM_SPEC} >> ${TMPPLIST} @@ -136,8 +145,6 @@ gem-autoplist: ${FIND} -ds ${STAGEDIR}${PREFIX}/${EXT_DIR} -type f -print | ${SED} -E -e \ 's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST} ; \ fi -.else -IGNORE= Incorrect 'USES+=gem:${gem_ARGS}' expecting 'USES+=gem[:autoplist]' .endif .endif diff --git a/Mk/bsd.sanity.mk b/Mk/bsd.sanity.mk index 7f5258ba8117..dddeea76708d 100644 --- a/Mk/bsd.sanity.mk +++ b/Mk/bsd.sanity.mk @@ -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 \