Wrap files in bin/ and sbin/ with the location of the gem itself and the
location of any other gems in use (GEM_PATH). This ensures that the bin files
will run with the right environment when executed.
It does however mean that native-inputs will also get wrapped up in any
binaries, which is not good, as it increases the size of the closure, and
risks this code being used at runtime.
* guix/build/ruby-build-system.scm (wrap): New procedure.
(%standard-phases): Add the wrap phase.
A modified copy of wrap-program from (guix build utils). The wrap-program
procedure doesn't work well for Ruby scripts, as it breaks using the -S flag
with ruby to execute the script, as when -S is passed to ruby, it expects the
script on the PATH to use ruby in the shebang, and not bash.
Therefore, to wrap the program, but keep the shebang as ruby, wrap it with a
ruby script instead.
wrap-ruby-program uses .real/foo rather than .foo-real, as this might be
neater. This procedure also includes a call to Gem.clear_paths to make it
possible to set the GEM_PATH through this method, and for it to take effect.
* gnu/build/ruby-build-system.scm (wrap-ruby-program): New procedure.
* guix/build/ruby-build-system.scm (install): Install gems to the vendor
directory, rather than the GEM_HOME. The vendor directory does not include
the version of ruby used to install the gem in the path, which makes it
easier to add it to the GEM_PATH for all versions of ruby to use.
(gem-home): Remove procedure.
* gnu/packages/ruby.scm (ruby, ruby-2.1)[native-search-paths]: Switch to
lib/ruby/vendor_ruby.
(ruby-1.8)[native-search-paths]: Remove native-search-paths.
(gem-directory): Remove procedure.
(ruby-ansi, ruby-ae)[arguments]: Remove use of gem-directory.
(ruby-metaclass, ruby-instantiator, ruby-introspection, ruby-mocha,
ruby-nokogiri, ruby-minitest-tu-shim, ruby-redcloth)[arguments]: Remove use
of gem-home.
(ruby-git, ruby-httpclient)[arguments]: Remove use of GEM_HOME.
* gnu/packages/databases.scm (es-dump-restore)[arguments]: Remove use of
GEM_HOME.
This is another instance of <https://bugs.gnu.org/22966>.
The Microsoft-IIS/7.5 server at static.nvd.nist.gov would sometimes hang
when receiving our requests byte by byte.
* guix/build/download.scm (tls-wrap) [!guile-2.0]: Add 'setvbuf' call.
This ensures the timeout applies when connecting to the port returned by
PASV.
* guix/ftp-client.scm (ftp-list): Add #:timeout parameter. Use
'connect*' instead of 'connect' and pass TIMEOUT.
(ftp-retr): Likewise.
* guix/build/download.scm (ftp-fetch): Pass TIMEOUT to 'ftp-retr'.
Suggested by Dave Love <fx@gnu.org>.
* guix/build-system/gnu.scm (%license-file-regexp): New variable.
(gnu-build): Add #:license-file-regexp and use it.
(gnu-cross-build): Likewise.
* guix/build/gnu-build-system.scm (%license-file-regexp): New variable.
(install-license-files): New procedure.
(%standard-phases): Add it.
Fixes <https://bugs.gnu.org/29091>.
Reported by Eric Bavier <bavier@cray.com>.
* guix/build/compile.scm (relative-file): New procedure.
(load-files): Use it before calling 'file-name->module-name'.
(compile-files): Likewise before calling 'scm->go'.
* guix/build/pull.scm (build-guix): Remove 'with-directory-excursion'
and file name hack from ce33c3af76.
Pass OUT to 'all-scheme-files'.
Fixes <https://bugs.gnu.org/28956>.
Reported by Leo Famulari <leo@famulari.name>.
* build-aux/build-self.scm (build): Add (guix build compile) to
#:modules.
* guix/build/pull.scm (build-guix): Wrap 'compile-files' call in
'with-directory-excursion'. Strip "./" from FILES when passing it to
'compile-files'.
Among other things, this removes (guix utils), (guix ui), (guix config),
etc. from the closure of (guix build download), as was the case since
798648515b.
* guix/utils.scm (<progress-reporter>, call-with-progress-reporter):
Move to...
* guix/progress.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
* guix/build/download.scm (current-terminal-columns)
(nearest-exact-integer, duration->seconds, seconds->string)
(byte-count->string, progress-bar, string-pad-middle)
(rate-limited, progress-reporter/file, dump-port*)
(time-monotonic): Move to progress.scm.
* guix/scripts/download.scm: Adjust accordingly.
* guix/scripts/substitute.scm: Likewise.
* guix/build/download.scm (http-fetch): Remove 'file' parameter. Change
to return an input port and the content-length. Make public.
(url-fetch): Adjust accordingly.
This is a followup to 36626c556e.
* guix/build/download.scm (http-fetch): Rename 'port-or-bv' to 'port'.
Assume (port? port) is always true, and remove other branch.
Previously the regex would match from /bin/ to a closing quote. However, this
is greedy, so will match up until the last ". This causes problems when there
are several quotes on the same line, for example:
org-effectiveness.el:
196: (call-process "/bin/bash" nil t nil "-c" strplot)
Therefore, change . to \S so that it doesn't include whitespace
characters. Changing to a lazy quantifier would be an option, if that were
supported.
* guix/build/emacs-build-system.scm (patch-el-files): Change the regular
expression used.
Previously the string-append here would error, which isn't useful as it
doesn't tell you which command couldn't be found. To make the error
actionable, catch it earlier, and explicitly error.
* guix/build/emacs-build-system.scm (patch-el-files): Handle (which cmd)
returning #f.