On 09/01/16 02:52, Ludovic Courtès wrote:
Ben Woodcroft <b.woodcr...@uq.edu.au> skribis:
From 28dee96b0de99adf8657457660b9e3733434d2b4 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrust...@gmail.com>
Date: Mon, 4 Jan 2016 09:38:42 +1000
Subject: [PATCH 4/4] gnu: ruby: Update to 2.3.0.
* gnu/packages/ruby.scm (ruby): Update to 2.3.0.
Please mention the switch to ‘modify-phases’ here.
I even made it a separate commit.
[..]
I overlooked this part before but: (1) this looks weird (the spaces
around ‘=’ suggest it’s Makefile syntax, not shell syntax), and (2) we
shouldn’t use the bundled libffi.
How much work would it be to fix #2? It would be awesome if you could
do that. Sorry for the extra work!
All good, was easy to fix. I also removed it from ruby-2.2 which bundles
the same libffi version.
However, it seems 11 rubygems are also bundled. To unbundle these and
deal with the circular dependencies, I reckon we should create a new
ruby-base package that removes the bundled gems, then we package the 11
gems and their dependencies using ruby-base, and the 'ruby' package then
inherits from ruby-base but also propagates the 11 gems. However I don't
think I have time to implement this right now, especially since most of
the 11 haven't been packaged by us yet and core-updates is to be merged
soon.
So do we merge this update as-is or wait for a more perfect solution?
+(define-public ruby-2.2
+ (package (inherit ruby)
+ (version "2.2.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+ (version-major+minor version)
+ "/ruby-" version ".tar.bz2"))
+ (sha256
+ (base32
+ "0g3ps4q3iz7wj9m45n8xyxzw8nh29ljdqb87b0f6i0p3853gz2yj"))))
+ (arguments
+ `(#:test-target "test"
+ #:parallel-tests? #f
+ #:phases
+ (alist-cons-before
+ 'configure 'replace-bin-sh
+ (lambda _
+ (substitute* '("Makefile.in"
+ "ext/pty/pty.c"
+ "io.c"
+ "lib/mkmf.rb"
+ "process.c"
+ "test/rubygems/test_gem_ext_configure_builder.rb"
+ "test/rdoc/test_rdoc_parser.rb"
+ "test/ruby/test_rubyoptions.rb"
+ "test/ruby/test_process.rb"
+ "test/ruby/test_system.rb"
+ "tool/rbinstall.rb")
+ (("/bin/sh") (which "sh"))))
+ %standard-phases)))))
AFAICS all of ‘arguments’ can be omitted once the above libffi
substitution is removed.
(If it there’s still a need for different phases, it should use
‘substitute-keyword-arguments’ to modify only #:phases, and then
‘modify-phases’ rather than ‘alist-cons-before’.)
Thanks for the tip, but ruby-2.2 is a now simple inherit.
Could you send an updated patch, hopefully the last one? :-)
Please feel free to suggest further changes if you spot anything further.
Thanks for the review,
ben