summaryrefslogtreecommitdiff
path: root/guix/build/utils.scm
Commit message (Collapse)AuthorAge
...
* utils: 'modify-phases' no longer introduces quotes.Ludovic Courtès2015-03-31
| | | | | | | | | | | | | | | | | | | Suggested by Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>. * guix/build/utils.scm (%modify-phases): Remove quotes. * guix/build/cmake-build-system.scm (%standard-phases): Adjust accordingly. * guix/build/glib-or-gtk-build-system.scm (%standard-phases): Likewise. * guix/build/gnu-dist.scm (%dist-phases): Likewise. * guix/build/perl-build-system.scm (%standard-phases): Likewise. * guix/build/python-build-system.scm (%standard-phases): Likewise. * guix/build/ruby-build-system.scm (%standard-phases): Likewise. * guix/build/waf-build-system.scm (%standard-phases): Likewise. * gnu/packages/bash.scm, gnu/packages/code.scm, gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/graphics.scm, gnu/packages/image.scm, gnu/packages/key-mon.scm, gnu/packages/ocr.scm, gnu/packages/plotutils.scm, gnu/packages/search.scm, gnu/packages/video.scm: Likewise.
* utils: Treat 'configure' and Makefiles with an 8-bit encoding.Ludovic Courtès2015-02-28
| | | | | * guix/build/utils.scm (patch-makefile-SHELL, patch-/usr/bin/file): Wrap 'substitute*' in 'with-fluids'. Fixes <http://hydra.gnu.org/build/262895>.
* utils: Change 'patch-shebangs' to use binary input.Ludovic Courtès2015-02-28
| | | | | | | * 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.
* utils: Call the progress-report proc when 'dump-port' starts.Ludovic Courtès2015-02-27
| | | | | * guix/build/utils.scm (dump-port): Add call to PROGRESS at the beginning.
* build-system/gnu: Set $LC_ALL (or similar) to the chosen locale.Ludovic Courtès2015-02-27
| | | | | | | 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.
* utils: Add 'modify-phases'.Ludovic Courtès2015-02-26
| | | | * guix/build/utils.scm (modify-phases): New macro.
* utils: Preserve symbolic links in 'wrap-program'.Andreas Enge2015-02-16
| | | | | | | | | * 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>.
* utils: Use $0 instead of absolute path to original program in 'wrap-program'.Andreas Enge2015-02-16
| | | | | | | | | | * 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>.
* utils: Strip duplicates from search path.Eric Bavier2015-02-10
| | | | | * guix/build/utils.scm (search-path-as-list): Delete duplicate input directories before searching.
* build-system/gnu: Patch /usr/bin/file in all 'configure' files.Ludovic Courtès2015-01-09
| | | | | | | | * 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'.
* utils: Export 'search-path-as-list'.Ludovic Courtès2014-12-27
| | | | | * guix/build/utils.scm (search-path-as-list): Make public. * guix/scripts/environment.scm (for-each-search-path): Use it.
* build-support/gnu: Add support for file patterns in search paths.Ludovic Courtès2014-12-27
| | | | | | | | | * guix/build/utils.scm (search-path-as-list): Add #:pattern parameter and honor it. (set-path-environment-variable): Likewise, and pass it to 'search-path-as-list'. * guix/packages.scm (search-path-specification->sexp): Add PATTERN slot. * guix/build/gnu-build-system.scm (set-paths): Adjust accordingly.
* build-system/gnu: Add support for non-directory search paths.Ludovic Courtès2014-12-27
| | | | | | | | | | | | | 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'.
* utils: Change 'wrap-program' to preserve the original argv[0].Ludovic Courtès2014-12-14
| | | | | | | | 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".
* utils: Change 'patch-makefile-SHELL' to support ":=" assignments.Ludovic Courtès2014-12-13
| | | | | | | Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>. * guix/build/utils.scm (patch-makefile-SHELL): Update regexp to match ":=" assignments.
* utils: Use 'which' to find the shell in 'patch-makefile-SHELL'.Ludovic Courtès2014-12-13
| | | | * guix/build/utils.scm (patch-makefile-SHELL)[find-shell]: Use 'which'.
* utils: Add 'symbolic-link?'.Ludovic Courtès2014-12-01
| | | | * guix/build/utils.scm (symbolic-link?): New procedure.
* utils: Improve docstring of 'substitute*' & co.Taylan Ulrich Bayırlı/Kammer2014-11-26
| | | | | | | | | | * 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>
* utils: 'elf-file?' and 'ar-file?' return #f for directories.Ludovic Courtès2014-11-23
| | | | | | | | | 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.
* utils: Turn 'parallel-job-count' into a parameter.Ludovic Courtès2014-11-22
| | | | * guix/build/utils.scm (parallel-job-count): Turn into a SRFI-39 parameter.
* utils: Factorize magic bytes detection.Ludovic Courtès2014-11-22
| | | | | | * guix/build/utils.scm (file-header-match): New procedure. (%elf-magic-bytes): New variable. (elf-file?, ar-file?): Define using 'file-header-match'.
* utils: Add 'ar-file?'.Ludovic Courtès2014-11-22
| | | | | * guix/build/utils.scm (%ar-magic-bytes): New variable. (ar-file?): New procedure.
* utils: Add 'elf-file?'.Ludovic Courtès2014-11-22
| | | | * guix/build/utils.scm (elf-file?): New procedure.
* utils: Export 'parallel-job-count'.Ludovic Courtès2014-11-22
| | | | | | * guix/build/utils.scm (parallel-job-count): New procedure. * guix/build/gnu-build-system.scm (%parallel-job-count): Remove. (build, check): Use 'parallel-job-count' instead.
* utils: Import (ice-9 format).Mark H Weaver2014-09-14
| | | | * guix/build/utils.scm: Import (ice-9 format).
* utils: Allow wrap-program to be called multiple times.Eric Bavier2014-09-13
| | | | | | | | * 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.
* utils: Clean trailing whitespace at end of SHELLEric Bavier2014-09-05
| | | | * guix/build/utils.scm (patch-makefile-SHELL): Remove trailing whitespace.
* utils: Preserve makefile shell arguments during patch.Eric Bavier2014-08-28
| | | | * guix/build/utils.scm (patch-makefile-SHELL): Preserve shell arguments.
* utils: 'delete-file-recursively' doesn't follow mount points by default.Ludovic Courtès2014-05-20
| | | | | * guix/build/utils.scm (delete-file-recursively): Add #:follow-mounts? parameter and honor it.
* build-system/gnu: Reset timestamps on build tree when source is a directory.Ludovic Courtès2014-04-14
| | | | | | | | * guix/build/utils.scm (copy-recursively): Add #:keep-mtime? parameter and honor it. * guix/build/gnu-build-system.scm (unpack): Use #:keep-mtime? #t. * gnu/packages/admin.scm (shadow)[arguments]: Remove 'reset-timestamps' phase.
* Change default store values from /nix/store to /gnu/store.Ludovic Courtès2014-03-10
| | | | | | | | | * 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.
* utils: 'find-files' always returns a proper list.Ludovic Courtès2013-10-16
| | | | | | | 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.
* utils: 'find-files' returns a sorted list.Ludovic Courtès2013-09-15
| | | | | * guix/build/utils.scm (find-files): Sort the result lexicographically. * guix/scripts/pull.scm (unpack): Don't sort the result of 'find-files'.
* utils: Re-export `alist-cons' and `alist-delete'.Ludovic Courtès2013-07-03
| | | | * guix/build/utils.scm: Re-export `alist-cons' and `alist-delete'.
* utils: `set-path-environment-variable' calls `unsetenv' for empty values.Ludovic Courtès2013-06-22
| | | | | | | * 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.
* utils: Adjust 'wrap-program'.Nikita Karetnikov2013-04-30
| | | | | | | | * 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>
* utils: Add 'wrap-program'.Nikita Karetnikov2013-03-07
| | | | * guix/build/utils.scm (wrap-program): New procedure.
* utils: Add a #:follow-symlinks? parameter to `copy-recursively'.Ludovic Courtès2013-03-05
| | | | | * guix/build/utils.scm (copy-recursively): Turn `log' into a keyword parameter. Add the `follow-symlinks?' parameter and honor it.
* utils: Add `delete-file-recursively'.Ludovic Courtès2013-03-05
| | | | * guix/build/utils.scm (delete-file-recursively): New procedure.
* Patch-shebang: Do not add space after interpreter without argument.Andreas Enge2013-02-23
| | | | | | * 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.
* Patch-shebang: Handle "#!/usr/bin/env command"Andreas Enge2013-02-23
| | | | | * guix/build/utils.scm (patch-shebang): Handle replacement of "#!.*/env CMD ARGS" by "#!/nix/store/path/.../to/CMD ARGS".
* Update license headers of builder-side code.Ludovic Courtès2013-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | Change license headers with this script: (use-modules (guix build utils)) (fluid-set! %default-port-encoding "UTF-8") (substitute* (cons "distro/packages/ld-wrapper.scm" (find-files "guix/build" "\\.scm$")) (("^([[:graph:]]+) This file is part of Guix." _ comment-start) (string-append comment-start " This file is part of GNU Guix.")) (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start) (string-append comment-start " GNU Guix --- Functional package management for GNU\n")) (("^([[:graph:]]+) Guix is " _ comment-start) (string-append comment-start " GNU Guix is ")) (("^([[:graph:]]+) along with Guix." _ comment-start) (string-append comment-start " along with GNU Guix.")) (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start) (string-append comment-start " Copyright ©"))) * distro/packages/ld-wrapper.scm, guix/build/download.scm, guix/build/gnu-build-system.scm, guix/build/union.scm, guix/build/utils.scm: Update license headers.
* utils: Add `which'.Ludovic Courtès2013-01-05
| | | | | | | | * guix/build/utils.scm (which): New procedure. * distro/packages/lsh.scm (lsh): Use `which' instead of `search-path'. * distro/packages/perl.scm (perl): Likewise. * distro/packages/attr.scm (attr): Likewise.
* utils: Use binary I/O primitives for `remove-store-references'.Ludovic Courtès2013-01-01
| | | | | * guix/build/utils.scm (fold-port-matches)[get-char]: New procedure. (remove-store-references): Use `put-u8' and `put-bytevector'.
* utils: Restore the mtime/atime of patched files.Ludovic Courtès2012-12-31
| | | | | | | * guix/build/utils.scm (set-file-time): New procedure. (patch-shebang): New `keep-mtime?' parameter; call `set-file-time' when it's true. (patch-makefile-SHELL): Likewise.
* build-system/gnu: Patch shebangs in all the source; patch SHELL in makefiles.Ludovic Courtès2012-12-21
| | | | | | | | | | | | | | | | | | | * guix/build/utils.scm (call-with-ascii-input-file): New procedure. (patch-shebang): Use it. (patch-makefile-SHELL): New procedure. * guix/build/gnu-build-system.scm (patch-source-shebangs): Patch all the files, not just executables; remove `po/Makefile.in.in' patching. (patch-generated-files): Rename to... (patch-generated-file-shebangs): ... this. Patch executables and makefiles. (%standard-phases): Adjust accordingly. * distro/packages/autotools.scm (libtool): Remove call to `patch-shebang'. * distro/packages/base.scm (gcc-4.7): Likewise. (guile-final): Remove hack to skip `test-command-line-encoding2'. * distro/packages/bash.scm (bash): Remove `pre-configure-phase'. * distro/packages/readline.scm (readline): Likewise. * distro/packages/ncurses.scm (ncurses): Remove `pre-install-phase'.
* utils: Add a `progress' parameter to `dump-port'.Ludovic Courtès2012-12-20
| | | | | * guix/build/utils.scm (dump-port): Add a `progress' keyword parameter. Call it after each transfer.
* build-system/gnu: Patch shebangs in executable source files.Ludovic Courtès2012-12-15
| | | | | | | | | | | 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'.
* utils: Make the buffer size of `dump-port' a parameter.Ludovic Courtès2012-12-15
| | | | | * guix/build/utils.scm (dump-port): Make `buffer-size' a keyword parameter.
* utils: Remove special `substitute*' syntax for lists of files.Ludovic Courtès2012-10-26
| | | | | | | | * 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.