Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Sep 2011 08:48:55 -0400
From:      Steve Wills <swills@FreeBSD.org>
To:        ruby@FreeBSD.org
Subject:   gem patching
Message-ID:  <4E749737.6010500@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------080406010107090405090108
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

There has been a long standing need to be able to patch rubygem- ports.
I've had some ideas on it and finally got around to working on a patch.
Please see attached or check:

http://people.freebsd.org/~swills/ruby_gem_patching.txt

It's a very rough first draft, but it did allow me to drop a patch into
a "files" dir in a rubygem- port and have it applied. It does break some
rubygem- ports which seem to not have their gemspec updated to work with
the latest ruby gems. To avoid that issue, perhaps similar things could
be done on a per port basis or these changes could be enabled with a
USE_RUBYGEMS_PATCH flag. Like I said, it's a very rough first draft, but
I wanted to get it out there for comment in case I'm completely on the
wrong track.

Thanks,
Steve
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iQEcBAEBAgAGBQJOdJc2AAoJEPXPYrMgexuhUQ8H/iaApSmXEpFtqv8f6BEHjwEm
sZ4jBkatjYDnWE6WSYA8rii9/0FLycjdc4gbxYEM2N3uSlIZxKuC+Q/yX/LDwghX
JEe5GLy/JtdeXmuw8LcCGd7kPS5RIOhT84KpOTo1Bln+wYRiWz5tA2Png2BeMJ7U
8VQ70/nmmqit2J8NNPWsrg331e79WkKvXWvvO+Oj4ke/iBcsqn/aNg79xMPV3+ld
1HIwncWLW5QneVsh2VDgs2oPTS4iGT8J+0NDnR0Hyt8ev3VF5jkIPcNBeLlQqWuU
93ePUXUveKJaoo5R34vyFQw3H6NEB1NFMS3dlj7emt5iDO24e1JatWI5FL3P+fU=
=W2He
-----END PGP SIGNATURE-----

--------------080406010107090405090108
Content-Type: text/plain;
 name="ruby_gem_patching.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="ruby_gem_patching.txt"

Index: Mk/bsd.ruby.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.ruby.mk,v
retrieving revision 1.210
diff -u -r1.210 bsd.ruby.mk
--- Mk/bsd.ruby.mk	24 Aug 2011 00:52:12 -0000	1.210
+++ Mk/bsd.ruby.mk	10 Sep 2011 20:42:42 -0000
@@ -389,6 +389,7 @@
 . if ${RUBY_VER} == 1.8
 BUILD_DEPENDS+=	${RUBYGEMBIN}:${PORTSDIR}/devel/ruby-gems
 RUN_DEPENDS+=	${RUBYGEMBIN}:${PORTSDIR}/devel/ruby-gems
+EXTRACT_DEPENDS+=	${RUBYGEMBIN}:${PORTSDIR}/devel/ruby-gems
 . endif
 
 PKGNAMEPREFIX?=	rubygem-
@@ -396,8 +397,6 @@
 EXTRACT_ONLY=
 DIST_SUBDIR=	rubygem
 
-NO_BUILD=	yes
-
 GEMS_BASE_DIR=	lib/ruby/gems/${RUBY_VER}
 GEMS_DIR=	${GEMS_BASE_DIR}/gems
 DOC_DIR=	${GEMS_BASE_DIR}/doc
@@ -437,10 +436,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 ${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)

--------------080406010107090405090108
Content-Type: application/octet-stream;
 name="ruby_gem_patching.txt.sig"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="ruby_gem_patching.txt.sig"

iQEcBAABAgAGBQJOdJc3AAoJEPXPYrMgexuhis4H/j4YuEfcdKoxik9qFxy7VO7nfCQeQeaa
qFCIjQs1MwyEbmV8P+C9SaKwICPei3BhpEZNIVsPXSfkvUKBqkORkOyrEUdVQS2cYCzxBf9n
584bB+27lEpB8DNLirIOpAey9YT3/z3rPFEnSCzjfiVtdPnUHs06crCR399psoowMku4ts8c
zwdrmBkA/+L69youWxwH60cgR1i9fWHsa7fXMGqRLyrNimvmssF6wahlFLK01BGrV9roy090
h6oWLaHnstAVOdw0gY/2GLtSJtZwdfBCcUa7G5fSjkw7fLks7L7VzsMGi2CxMN8ZVMjhX9f9
jHCV8xPHUWe318/dgrgwUUE=
--------------080406010107090405090108--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E749737.6010500>