unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] build: ruby: Set $GEM_HOME that matches Ruby's $GEM_PATH.
@ 2015-03-07 23:49 David Thompson
  2015-03-09 22:14 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: David Thompson @ 2015-03-07 23:49 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

Ruby's native search path for $GEM_PATH looks like
"/lib/ruby/gems/2.2.0", where the version number at the end is formed by
the major + minor version of our Ruby package followed a ".0", ignoring
the patch version.  However, the Ruby build system was installing gems
into places like "/lib/ruby/gems/2.2.1", using the patch version from
the Ruby used when building.  Because of this, the search path suggested
by 'guix package --search-paths' was useless.  This patch fixes that.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-build-ruby-Set-GEM_HOME-that-matches-Ruby-s-GEM_PATH.patch --]
[-- Type: text/x-diff, Size: 1274 bytes --]

From c616752342336a1018366d1293621e5a29f72587 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Sat, 7 Mar 2015 18:36:13 -0500
Subject: [PATCH] build: ruby: Set $GEM_HOME that matches Ruby's $GEM_PATH.

* guix/build/ruby-build-system.scm (install): Ignore the Ruby patch version
  when creating $GEM_HOME.
---
 guix/build/ruby-build-system.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index 1310c4a..a143df4 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -58,11 +58,11 @@ directory."
 
 (define* (install #:key source inputs outputs #:allow-other-keys)
   (let* ((ruby-version
-          (match:substring (string-match "ruby-(.*)$"
+          (match:substring (string-match "ruby-(.*)\\.[0-9]$"
                                          (assoc-ref inputs "ruby"))
                            1))
          (out (assoc-ref outputs "out"))
-         (gem-home (string-append out "/lib/ruby/gems/" ruby-version)))
+         (gem-home (string-append out "/lib/ruby/gems/" ruby-version ".0")))
     (setenv "GEM_HOME" gem-home)
     (mkdir-p gem-home)
     (zero? (system* "gem" "install" "--local"
-- 
2.1.4


[-- Attachment #3: Type: text/plain, Size: 136 bytes --]


-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] build: ruby: Set $GEM_HOME that matches Ruby's $GEM_PATH.
  2015-03-07 23:49 [PATCH] build: ruby: Set $GEM_HOME that matches Ruby's $GEM_PATH David Thompson
@ 2015-03-09 22:14 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-03-09 22:14 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

David Thompson <dthompson2@worcester.edu> skribis:

> Ruby's native search path for $GEM_PATH looks like
> "/lib/ruby/gems/2.2.0", where the version number at the end is formed by
> the major + minor version of our Ruby package followed a ".0", ignoring
> the patch version.  However, the Ruby build system was installing gems
> into places like "/lib/ruby/gems/2.2.1", using the patch version from
> the Ruby used when building.  Because of this, the search path suggested
> by 'guix package --search-paths' was useless.  This patch fixes that.
>
>
> From c616752342336a1018366d1293621e5a29f72587 Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Sat, 7 Mar 2015 18:36:13 -0500
> Subject: [PATCH] build: ruby: Set $GEM_HOME that matches Ruby's $GEM_PATH.
>
> * guix/build/ruby-build-system.scm (install): Ignore the Ruby patch version
>   when creating $GEM_HOME.

Sure, please push.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-09 22:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-07 23:49 [PATCH] build: ruby: Set $GEM_HOME that matches Ruby's $GEM_PATH David Thompson
2015-03-09 22:14 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).