summaryrefslogtreecommitdiff
path: root/guix/build/utils.scm
AgeCommit message (Collapse)Author
2020-02-17utils: Change 'patch-shebang' to not try to patch Rust source files.Danny Milosavljevic
* guix/build/utils.scm (patch-shebang): Match only absolute paths.
2020-01-30guix: Fix missing export for make-desktop-entry-file.Pierre Neidhardt
* guix/build/utils.scm: Export make-desktop-entry-file.
2019-10-19guix: Add helper for generating desktop entry files.Pierre Neidhardt
* guix/build/utils.scm (make-desktop-entry-file): New procedure.
2019-06-17utils: Add 'invoke/quiet'.Ludovic Courtès
* gnu/build/bootloader.scm (G_): Remove. (open-pipe-with-stderr, invoke/quiet): Move to... * guix/build/utils.scm: ... here. Use 'let-values' instead of 'define-values' because Guile 2.0 (the bootstrap Guile) doesn't know about 'define-values'. * po/guix/POTFILES.in: Remove gnu/build/bootloader.scm, and add guix/build/utils.scm. * tests/build-utils.scm: Remove import of (gnu build bootloader).
2019-02-08guix: Add wrap-script.Ricardo Wurmus
* guix/build/utils.scm (wrap-script): New procedure. (&wrap-error): New condition. (wrap-error?, wrap-error-program, wrap-error-type): New procedures. * tests/build-utils.scm ("wrap-script, simple case", "wrap-script, with encoding declaration", "wrap-script, raises condition"): New tests.
2019-01-29build-system/gnu: Report invocation errors in a human-friendly way.Ludovic Courtès
* guix/build/utils.scm (report-invoke-error): New procedure. * guix/build/gnu-build-system.scm (gnu-build): Guard against 'invoke-error?'.
2019-01-29utils: Switch to the new 'setvbuf' API.Ludovic Courtès
* guix/build/utils.scm (setvbuf) [(and guile-2 (not guile-2.2))]: New procedure. (remove-store-references): Use the 2.2 'setvbuf' API style. * guix/build/gnu-build-system.scm (gnu-build): Likewise.
2018-11-25build-system: python: Do not double wrap executables.Arun Isaac
* guix/build/python-build-system.scm (wrap): Only wrap executables that have not already been wrapped. * guix/build/utils.scm (wrapper?): New function.
2018-08-20utils: Generate valid substitutions in 'wrap-program'.Jelle Licht
* guix/build/utils.scm (wrap-program)[export-variable]: Generate valid bash substitutions when using custom separators.
2018-03-16utils: invoke: Raise exceptions using SRFI-34 and SRFI-35.Mark H Weaver
* guix/build/utils.scm (&invoke-error): New condition type. (invoke-error?, invoke-error-program, invoke-error-arguments) (invoke-error-exit-status, invoke-error-term-signal) (invoke-error-stop-signal): New exported procedures. (invoke): Raise exceptions using SRFI-34 and SRFI-35. * guix/ui.scm (call-with-error-handling): Add a guard clause for &invoke-error conditions.
2018-03-11utils: Add 'false-if-file-not-found'.Ludovic Courtès
* guix/build/utils.scm (false-if-file-not-found): New macro.
2017-09-05guix: Fix Guile current-processor-count deprecation warnings.Mathieu Othacehe
When current-processor-count is used without (ice-9 threads) being used, Guile complains with the following warning: Import (ice-9 threads) to have access to `current-processor-count'. * guix/build/utils.scm: Use (ice-9 threads).
2017-06-01utils: Add helper for invoking programs.Danny Milosavljevic
* guix/build/utils.scm (invoke): New variable. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-05-26utils: Re-export 'delete'.Sergei Trofimovich
* guix/build/utils.scm: Reexport 'delete' binding. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2017-01-26utils: Add helper method to make files writable.Marius Bakke
* gnu/build/activation.scm (make-file-writable): Move this to ... * guix/build/utils.scm (make-file-writable): ... here. Export it. * guix/build/gnu-build-system.scm (strip): Use it.
2017-01-26utils: Add 'gzip-file?' and 'reset-gzip-timestamp'.Ludovic Courtès
* guix/build/utils.scm (%gzip-magic-bytes): New variable. (gzip-file?, reset-gzip-timestamp): New procedures.
2017-01-23search-paths: Allow specs with #f as their separator.Ludovic Courtès
This adds support for single-entry search paths. Fixes <http://bugs.gnu.org/25422>. Reported by Leo Famulari <leo@famulari.name>. * guix/search-paths.scm (<search-path-specification>)[separator]: Document as string or #f. (evaluate-search-paths): Add case for SEPARATOR as #f. (environment-variable-definition): Handle SEPARATOR being #f. * guix/build/utils.scm (list->search-path-as-string): Add case for SEPARATOR as #f. (search-path-as-string->list): Likewise. * guix/build/profiles.scm (abstract-profile): Likewise. * tests/search-paths.scm: New file. * Makefile.am (SCM_TESTS): Add it. * tests/packages.scm ("--search-paths with single-item search path"): New test. * gnu/packages/version-control.scm (git)[native-search-paths](separator): New field.
2016-09-07utils: 'wrap-program' produces only one wrapper file.Ludovic Courtès
* guix/build/utils.scm (wrap-program)[wrapper-file-name] [next-wrapper-number, wrapper-target]: Remove. [wrapped-file, already-wrapped?]: New variables. [last-line]: New procedure. Use it to append to PROG when a wrapper already exists. * tests/build-utils.scm ("wrap-program, one input, multiple calls"): Adjust the list of files to delete.
2016-08-10utils: Fix 'modify-phases' docstring.Taylan Ulrich Bayırlı/Kammer
* guix/build/utils.scm (modify-phases): Fix the documentation string.
2015-10-29utils: Have search-path-as-list pattern search for directories.Eric Bavier
* guix/build/utils.scm (search-path-as-list)[pattern]: Check requested file type. Check pattern against directory names. * guix/search-paths.scm (evaluate-search-paths)[pattern]: Remove symlink hack.
2015-10-03utils: Add 'every*'.Ludovic Courtès
* guix/build/gnu-build-system.scm (every*): Move to... * guix/build/utils.scm (every*): ... here. New procedure.
2015-09-06utils: find-files: Add DIRECTORIES? and FAIL-ON-ERROR? arguments.Mark H Weaver
* guix/build/utils.scm (find-files): Add DIRECTORIES? and FAIL-ON-ERROR? keyword arguments.
2015-08-30utils: Move 'package-name->name+version' to (guix build utils).Ludovic Courtès
* guix/utils.scm (package-name->name+version): Move to... * guix/build/utils.scm (package-name->name+version): ... here. New procedure. * guix/build/emacs-build-system.scm (package-name->name+version): Remove.
2015-08-30utils: Add 'strip-store-file-name'.Ludovic Courtès
* guix/build/utils.scm (strip-store-file-name): New procedure. * guix/build/emacs-build-system.scm (store-directory->name-version): Remove. Update callers to use 'strip-store-file-name'. * gnu/packages/gcc.scm (make-libstdc++-doc)[arguments]: Use 'strip-store-file-name' instead of 'string-drop'.
2015-08-29utils: Add 'install-file'.Ludovic Courtès
* guix/build/utils.scm (install-file): New procedure.
2015-04-06utils: 'find-files' does not follow symlinks by default.Ludovic Courtès
Fixes <http://bugs.gnu.org/20081>. Reported by Tomáš Čech <sleep_walker@suse.cz>. * guix/build/utils.scm (find-files): Add #:stat parameter. Pass it as last argument to 'file-system-fold'.
2015-04-05gremlin: Ignore non-store file names in RUNPATH and warn about them.Ludovic Courtès
* guix/build/gremlin.scm (validate-needed-in-runpath)[runpath]: Add (filter absolute-file-name? ...). Emit a warning when RUNPATH file names that do not match 'store-file-name?'. Change format of error message to begin with file name. * guix/build/utils.scm (store-file-name?): New procedure.
2015-04-01utils: Make the second 'find-files' argument optional.Ludovic Courtès
* guix/build/utils.scm (find-files): Make 'pred' optional.
2015-03-31utils: 'find-files' takes an arbitrary predicate as its second argument.Ludovic Courtès
* guix/build/utils.scm (file-name-predicate): New procedure. (find-files): Rename second parameter to 'pred'. When 'pred' is not a procedure, call 'file-name-predicate'. Use PRED instead of 'regexp-exec' in the leaf procedure.
2015-03-31utils: 'modify-phases' no longer introduces quotes.Ludovic Courtès
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.
2015-02-28utils: Treat 'configure' and Makefiles with an 8-bit encoding.Ludovic Courtès
* guix/build/utils.scm (patch-makefile-SHELL, patch-/usr/bin/file): Wrap 'substitute*' in 'with-fluids'. Fixes <http://hydra.gnu.org/build/262895>.
2015-02-28utils: Change 'patch-shebangs' to use binary input.Ludovic Courtès
* 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.
2015-02-27utils: Call the progress-report proc when 'dump-port' starts.Ludovic Courtès
* guix/build/utils.scm (dump-port): Add call to PROGRESS at the beginning.
2015-02-27build-system/gnu: Set $LC_ALL (or similar) to the chosen locale.Ludovic Courtès
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.
2015-02-26utils: Add 'modify-phases'.Ludovic Courtès
* guix/build/utils.scm (modify-phases): New macro.
2015-02-16utils: Preserve symbolic links in 'wrap-program'.Andreas Enge
* 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>.
2015-02-16utils: Use $0 instead of absolute path to original program in 'wrap-program'.Andreas Enge
* 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>.
2015-02-10utils: Strip duplicates from search path.Eric Bavier
* guix/build/utils.scm (search-path-as-list): Delete duplicate input directories before searching.
2015-01-09build-system/gnu: Patch /usr/bin/file in all 'configure' files.Ludovic Courtès
* 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'.
2014-12-27utils: Export 'search-path-as-list'.Ludovic Courtès
* guix/build/utils.scm (search-path-as-list): Make public. * guix/scripts/environment.scm (for-each-search-path): Use it.
2014-12-27build-support/gnu: Add support for file patterns in search paths.Ludovic Courtès
* 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.
2014-12-27build-system/gnu: Add support for non-directory search paths.Ludovic Courtès
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'.
2014-12-14utils: Change 'wrap-program' to preserve the original argv[0].Ludovic Courtès
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".
2014-12-13utils: Change 'patch-makefile-SHELL' to support ":=" assignments.Ludovic Courtès
Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>. * guix/build/utils.scm (patch-makefile-SHELL): Update regexp to match ":=" assignments.
2014-12-13utils: Use 'which' to find the shell in 'patch-makefile-SHELL'.Ludovic Courtès
* guix/build/utils.scm (patch-makefile-SHELL)[find-shell]: Use 'which'.
2014-12-01utils: Add 'symbolic-link?'.Ludovic Courtès
* guix/build/utils.scm (symbolic-link?): New procedure.
2014-11-26utils: Improve docstring of 'substitute*' & co.Taylan Ulrich Bayırlı/Kammer
* 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>
2014-11-23utils: 'elf-file?' and 'ar-file?' return #f for directories.Ludovic Courtès
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.
2014-11-22utils: Turn 'parallel-job-count' into a parameter.Ludovic Courtès
* guix/build/utils.scm (parallel-job-count): Turn into a SRFI-39 parameter.
2014-11-22utils: Factorize magic bytes detection.Ludovic Courtès
* guix/build/utils.scm (file-header-match): New procedure. (%elf-magic-bytes): New variable. (elf-file?, ar-file?): Define using 'file-header-match'.