From: David Thompson <dthompson2@worcester.edu>
To: guix-devel@gnu.org
Subject: [PATCH] build: ruby: Set $GEM_HOME that matches Ruby's $GEM_PATH.
Date: Sat, 07 Mar 2015 18:49:58 -0500 [thread overview]
Message-ID: <874mpw4bbt.fsf@fsf.org> (raw)
[-- 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
next reply other threads:[~2015-03-07 23:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-07 23:49 David Thompson [this message]
2015-03-09 22:14 ` [PATCH] build: ruby: Set $GEM_HOME that matches Ruby's $GEM_PATH Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874mpw4bbt.fsf@fsf.org \
--to=dthompson2@worcester.edu \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.