From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] build: ruby: Patch executables to set necessary gem load path. Date: Mon, 09 Mar 2015 23:18:15 +0100 Message-ID: <87k2ypq0go.fsf@gnu.org> References: <871tl04aux.fsf@fsf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV60D-00088V-Dt for guix-devel@gnu.org; Mon, 09 Mar 2015 18:18:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YV60A-0002CK-19 for guix-devel@gnu.org; Mon, 09 Mar 2015 18:18:21 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV609-0002CG-VH for guix-devel@gnu.org; Mon, 09 Mar 2015 18:18:17 -0400 In-Reply-To: <871tl04aux.fsf@fsf.org> (David Thompson's message of "Sat, 07 Mar 2015 19:00:06 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel@gnu.org David Thompson skribis: > This patch addresses the issue of how to ensure that Ruby executables > are able to load all of the additional Ruby libraries that they need in > order to work: with a new 'patch-executables' build phase. Instead of > using wrap-program, I instead take advantage of the wrappers that the > 'gem' command already creates for Ruby executables. There's guaranteed > to be a line in which the executable's host gem is loaded that looks > like `gem 'foo', version`. I simply insert a Ruby code snippet above it > that adds all of the necessary gems to the 'Gem.path' array. OK. > Users of Ruby programs must still apply the $GEM_PATH suggested by 'guix > package --search-paths' in order for the gem that the executable belongs > to (the gem that they explicitly installed) to be found. I think this > is reasonable and much like how you must set the proper load paths for > Guile programs to work. Makes sense. > From 614fedc2b359f123dfdf4e31eee30e7ce47e1bd2 Mon Sep 17 00:00:00 2001 > From: David Thompson > Date: Sat, 7 Mar 2015 18:39:52 -0500 > Subject: [PATCH] build: ruby: Patch executables to set necessary gem load > path. > > * guix/build/ruby-build-system.scm (gem-directory): New procedure. > (install): Deduplicate gem directory code. > (patch-executables): New procedure. > (%standard-phases): Add 'patch-executables' phase. [...] > +(define* (patch-executables #:key inputs outputs #:allow-other-keys) Please add a docstring, with the rationale you gave in this message as part of the docstring or in a comment. OK to push with this change, thank you! Ludo=E2=80=99.