* guix/build/utils.scm (get-char*): New procedure.
(patch-shebang): Use it instead of 'read-char'.
(fold-port-matches): Remove local 'get-char' and use 'get-char*'
instead.
Suggested by Mark H Weaver.
* guix/build/utils.scm (locale-category->string): New procedure.
* guix/build/gnu-build-system.scm (install-locale): Add 'setenv' call.
* guix/build/utils.scm (wrap-program): Preserve symbolic links instead of
copying the contents of the link.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Closes <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19743>.
* guix/build/utils.scm (wrap-program): Create scripts that use $0 (which is
usually just the base name) instead of the absolute path to the original
program. Alternative implementation of 2ed11b3.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Closes <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19742>.
* guix/build/utils.scm (patch-/usr/bin/file): New procedure.
* guix/build/gnu-build-system.scm (patch-usr-bin-file): Rewrite using
it. Patch all the files returned by 'find-files' that are executable.
* gnu/packages/gawk.scm (gawk)[arguments]: Remove use of 'substitute*'
for 'extension/configure'.
Partly fixes <http://bugs.gnu.org/18033>.
* guix/build/utils.scm (search-path-as-list): Rename 'sub-directories'
parameter to 'files'. Add #:type parameter and honor it.
(set-path-environment-variable): Likewise. Pass #:type to
'search-path-as-list'.
* guix/packages.scm (search-path-specification->sexp): Add 'directory as
the last item of the tuple.
* guix/build/gnu-build-system.scm (set-paths): Add 'type' to search-path
pattern. Pass #:type to 'set-path-environment-variable'.
Suggested by Mark H Weaver <mhw@netris.org>
in <http://bugs.gnu.org/19138>.
* guix/build/utils.scm (wrap-program): Change wrapper to use "exec -a
PROG" instead of just "exec".
* guix/build/utils.scm (substitute): Clarify first sentence of
docstring and add warning to the docstring about using '$' to match
an end of line.
(substitute*): Add warning to the docstring about using '$' to match
an end of line.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This avoids uncaught exceptions when the 'strip' phase would call these
procedures on symlinks to directories, such as 'lib/terminfo' in
ncurses (see <http://hydra.gnu.org/build/167310/nixlog/1/tail-reload>.)
* guix/build/utils.scm (file-header-match): Catch 'system-error', and
return #f upon EISDIR.
* guix/build/utils.scm (wrap-program): Multiple invocations of
wrap-program for the same file create successive wrappers. Adjust
docstring.
* tests/build-utils.scm: Test new wrap-program behavior.
(%store): New variable.
* gnu/packages/ld-wrapper.scm (%store-directory): Change the default to
/gnu/store.
* guix/build/utils.scm (%store-directory): New procedure.
(remove-store-references): Use it for the default value of 'store'.
* guix/packages.scm (patch-and-repack)[builder]: Change default store to
/gnu/store.
Reported at <http://bugs.gnu.org/15608>.
* guix/build/utils.scm (find-files): Change the 'error' procedure to
return RESULT. Before we would end up with an improper list.
* guix/build/utils.scm (set-path-environment-variable): When VALUE is
the empty string, call `unsetenv' instead of `setenv'.
* gnu/packages/guile.scm (guile-2.0)[arguments]: Remove `unsetenv'
trick.
* guix/build/utils.scm (wrap-program): Fix computation of PROG-REAL and
PROG-TMP when PROG is an absolute file name. Add "$@" in the
generated script, and quote PROG-REAL.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/build/utils.scm (patch-shebang): Do not add a space after a command
interpreter not followed by an argument; this made two tests of
coreutils fail.
This allows many packages to build in a chroot that lacks /bin and
thus /bin/sh.
* guix/build/gnu-build-system.scm (patch-source-shebangs): New
procedure.
(%standard-phases): Add it.
* guix/build/utils.scm (executable-file?): New procedure.
* distro/packages/perl.scm (perl): Don't use /bin/sh to run `Configure'.
* guix/build/utils.scm (substitute*): Remove special syntax for
list-of-files; instead, check whether FILE is `list?' at run time.
* distro/packages/base.scm (gcc-4.7, %binutils-static): Adjust
accordingly.