From owner-freebsd-ruby@FreeBSD.ORG Sun Jul 29 00:28:44 2012 Return-Path: Delivered-To: ruby@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24AFB1065676 for ; Sun, 29 Jul 2012 00:28:44 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mouf.net (mouf.net [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b3]) by mx1.freebsd.org (Postfix) with ESMTP id D093E8FC17 for ; Sun, 29 Jul 2012 00:28:43 +0000 (UTC) Received: from meatwad.mouf.net (cpe-024-162-230-236.nc.res.rr.com [24.162.230.236]) (authenticated bits=0) by mouf.net (8.14.5/8.14.5) with ESMTP id q6T0RkdW070432 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NOT) for ; Sat, 28 Jul 2012 20:27:47 -0400 (EDT) (envelope-from swills@FreeBSD.org) Message-ID: <501483B6.6080905@FreeBSD.org> Date: Sat, 28 Jul 2012 20:28:38 -0400 From: Steve Wills User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120604 Thunderbird/12.0.1 MIME-Version: 1.0 To: ruby@FreeBSD.org X-Enigmail-Version: 1.4.2 Content-Type: multipart/mixed; boundary="------------020503070008020401050703" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mouf.net [199.48.129.64]); Sat, 28 Jul 2012 20:27:47 -0400 (EDT) X-Spam-Status: No, score=1.3 required=4.5 tests=RCVD_IN_RP_RNBL autolearn=no version=3.3.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mouf.net X-Virus-Scanned: clamav-milter 0.97.5 at mouf.net X-Virus-Status: Clean Cc: Subject: patching rubygems X-BeenThere: freebsd-ruby@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Ruby discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jul 2012 00:28:44 -0000 This is a multi-part message in MIME format. --------------020503070008020401050703 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I've done some more work on the issue of patching rubygems and have produced the attached patch. I'm doing some testing by building all the rubygem- ports on 9.0 with both 1.9 and 1.8 as default ruby. The build with ruby 1.9 finished and the patch has only caused issues building the following ports: devel/rubygem-analogger devel/rubygem-clio devel/rubygem-rapt graphics/rubygem-captcha japanese/rubygem-jpmobile net-im/rubygem-earthquake science/rubygem-ai4r security/rubygem-ezcrypto www/rubygem-scrubyt The batch with ruby 1.9 hasn't finished yet, but I don't expect it to find many more issues. The basic idea is we extract and then build the gem rather than just installing the built gem. This gives us a chance to patch the gem in between the extract and build. We could for example change the dependencies of a port of we know it works with newer version of the other gems it depends on. This would make updating some gems much easier and should only make the build time very slightly longer. We'd of course want to get an exp-run done before committing this, and at this point I'm not sure if there's time to get this in before 9.1 or not, but it would be nice. Comments? Thanks, Steve --------------020503070008020401050703 Content-Type: text/plain; charset=us-ascii; name="gem_patching.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gem_patching.diff" Index: Mk/bsd.ruby.mk =================================================================== --- Mk/bsd.ruby.mk (revision 301657) +++ Mk/bsd.ruby.mk (working copy) @@ -203,6 +203,8 @@ RUBY_WRKSRC= ${WRKDIR}/ruby-${RUBY_DISTVERSION} +GEM_ENV?= LC_CTYPE=UTF-8 + RUBY_CONFIGURE_ARGS+= --with-rubyhdrdir="${PREFIX}/include/ruby-1.9/" \ --with-rubylibprefix="${PREFIX}/lib/ruby" \ --docdir="${RUBY_DOCDIR}" \ @@ -387,8 +389,7 @@ EXTRACT_ONLY= DIST_SUBDIR= rubygem -NO_BUILD= yes - +EXTRACT_DEPENDS+= ${RUBYGEMBIN}:${PORTSDIR}/devel/ruby-gems GEMS_BASE_DIR= lib/ruby/gems/${RUBY_VER} GEMS_DIR= ${GEMS_BASE_DIR}/gems DOC_DIR= ${GEMS_BASE_DIR}/doc @@ -428,10 +429,23 @@ RUBYGEM_ARGS+= --no-rdoc .endif +do-extract: + @${RM} -rf ${WRKDIR} + @${MKDIR} ${WRKDIR} + ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} unpack --target=${WRKDIR} ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} + ${TAR} -xOzf ${DISTDIR}/${DIST_SUBDIR}/${GEMFILES} metadata.gz | ${GZCAT} > ${BUILD_WRKSRC}/${GEMFILES}spec + +do-build: + (cd ${BUILD_WRKSRC}; if ! ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} build --force ${GEMFILES}spec ; then \ + if [ x != x${BUILD_FAIL_MESSAGE} ] ; then \ + ${ECHO_MSG} "===> Compilation failed unexpectedly."; \ + (${ECHO_CMD} ${BUILD_FAIL_MESSAGE}) | ${FMT} 75 79 ; \ + fi; \ + ${FALSE}; \ + fi) + do-install: -.for _D in ${GEMFILES} - ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install ${RUBYGEM_ARGS} ${DISTDIR}/${DIST_SUBDIR}/${_D} -- --build-args ${CONFIGURE_ARGS} -.endfor + @(cd ${BUILD_WRKSRC}; ${SETENV} ${GEM_ENV} ${RUBYGEMBIN} install ${RUBYGEM_ARGS} ${GEMFILES} -- --build-args ${CONFIGURE_ARGS}) . if defined(RUBYGEM_AUTOPLIST) . if !target(post-install-script) --------------020503070008020401050703--